forked from openlp/openlp
More Fixes and clean ups
bzr-revno: 358
This commit is contained in:
parent
86115ec964
commit
2faca83bd9
@ -19,6 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
from PyQt4.QtGui import QColor
|
||||||
|
|
||||||
from openlp.core import translate
|
from openlp.core import translate
|
||||||
from openlp.core.lib import SettingsTab
|
from openlp.core.lib import SettingsTab
|
||||||
@ -30,6 +31,7 @@ class AlertsTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
SettingsTab.__init__(self, u'Alerts')
|
SettingsTab.__init__(self, u'Alerts')
|
||||||
|
self.load()
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
self.setObjectName(u'AlertsTab')
|
self.setObjectName(u'AlertsTab')
|
||||||
@ -64,22 +66,35 @@ class AlertsTab(SettingsTab):
|
|||||||
self.FontColorLabel = QtGui.QLabel(self.ColorWidget)
|
self.FontColorLabel = QtGui.QLabel(self.ColorWidget)
|
||||||
self.FontColorLabel.setObjectName(u'FontColorLabel')
|
self.FontColorLabel.setObjectName(u'FontColorLabel')
|
||||||
self.ColorLayout.addWidget(self.FontColorLabel)
|
self.ColorLayout.addWidget(self.FontColorLabel)
|
||||||
self.FontColorPanel = QtGui.QGraphicsView(self.ColorWidget)
|
|
||||||
self.FontColorPanel.setMinimumSize(QtCore.QSize(24, 24))
|
self.FontColourButton = QtGui.QPushButton(self.ColorWidget)
|
||||||
self.FontColorPanel.setMaximumSize(QtCore.QSize(24, 24))
|
self.FontColourButton.setObjectName("FontColourButton")
|
||||||
self.FontColorPanel.setObjectName(u'FontColorPanel')
|
self.ColorLayout.addWidget(self.FontColourButton)
|
||||||
self.ColorLayout.addWidget(self.FontColorPanel)
|
|
||||||
|
# self.FontColorPanel = QtGui.QGraphicsView(self.ColorWidget)
|
||||||
|
# self.FontColorPanel.setMinimumSize(QtCore.QSize(24, 24))
|
||||||
|
# self.FontColorPanel.setMaximumSize(QtCore.QSize(24, 24))
|
||||||
|
# self.FontColorPanel.setObjectName(u'FontColorPanel')
|
||||||
|
# self.ColorLayout.addWidget(self.FontColorPanel)
|
||||||
|
|
||||||
self.ColorSpacerItem = QtGui.QSpacerItem(40, 20,
|
self.ColorSpacerItem = QtGui.QSpacerItem(40, 20,
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
self.ColorLayout.addItem(self.ColorSpacerItem)
|
self.ColorLayout.addItem(self.ColorSpacerItem)
|
||||||
self.BackgroundColorLabel = QtGui.QLabel(self.ColorWidget)
|
self.BackgroundColorLabel = QtGui.QLabel(self.ColorWidget)
|
||||||
self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel')
|
self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel')
|
||||||
self.ColorLayout.addWidget(self.BackgroundColorLabel)
|
self.ColorLayout.addWidget(self.BackgroundColorLabel)
|
||||||
self.BackgroundColorPanel = QtGui.QGraphicsView(self.ColorWidget)
|
|
||||||
self.BackgroundColorPanel.setMinimumSize(QtCore.QSize(24, 24))
|
self.BackgroundColourButton = QtGui.QPushButton(self.ColorWidget)
|
||||||
self.BackgroundColorPanel.setMaximumSize(QtCore.QSize(24, 24))
|
self.BackgroundColourButton.setObjectName("BackgroundColourButton")
|
||||||
self.BackgroundColorPanel.setObjectName(u'BackgroundColorPanel')
|
self.ColorLayout.addWidget(self.BackgroundColourButton)
|
||||||
self.ColorLayout.addWidget(self.BackgroundColorPanel)
|
|
||||||
|
# self.BackgroundColorPanel = QtGui.QGraphicsView(self.ColorWidget)
|
||||||
|
# self.BackgroundColorPanel.setMinimumSize(QtCore.QSize(24, 24))
|
||||||
|
# self.BackgroundColorPanel.setMaximumSize(QtCore.QSize(24, 24))
|
||||||
|
# self.BackgroundColorPanel.setObjectName(u'BackgroundColorPanel')
|
||||||
|
# self.ColorLayout.addWidget(self.BackgroundColorPanel)
|
||||||
|
|
||||||
|
|
||||||
self.FontLayout.addWidget(self.ColorWidget)
|
self.FontLayout.addWidget(self.ColorWidget)
|
||||||
self.LengthWidget = QtGui.QWidget(self.FontGroupBox)
|
self.LengthWidget = QtGui.QWidget(self.FontGroupBox)
|
||||||
self.LengthWidget.setObjectName(u'LengthWidget')
|
self.LengthWidget.setObjectName(u'LengthWidget')
|
||||||
@ -131,7 +146,8 @@ class AlertsTab(SettingsTab):
|
|||||||
self.SlideRightLayout.addItem(self.SlideRightSpacer)
|
self.SlideRightLayout.addItem(self.SlideRightSpacer)
|
||||||
self.AlertsLayout.addWidget(self.AlertRightColumn)
|
self.AlertsLayout.addWidget(self.AlertRightColumn)
|
||||||
|
|
||||||
QtCore.QObject.connect(self.BackgroundColorPanel, QtCore.SIGNAL("pressed()"), self.onBackgroundColorPanelclicked)
|
QtCore.QObject.connect(self.BackgroundColourButton, QtCore.SIGNAL("pressed()"), self.onBackgroundColourButtonclicked)
|
||||||
|
QtCore.QObject.connect(self.FontColourButton, QtCore.SIGNAL("pressed()"), self.onFontColourButtonclicked)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.FontGroupBox.setTitle(translate(u'AlertsTab', u'Font'))
|
self.FontGroupBox.setTitle(translate(u'AlertsTab', u'Font'))
|
||||||
@ -142,5 +158,18 @@ class AlertsTab(SettingsTab):
|
|||||||
self.LengthSpinBox.setSuffix(translate(u'AlertsTab', u's'))
|
self.LengthSpinBox.setSuffix(translate(u'AlertsTab', u's'))
|
||||||
self.PreviewGroupBox.setTitle(translate(u'AlertsTab', u'Preview'))
|
self.PreviewGroupBox.setTitle(translate(u'AlertsTab', u'Preview'))
|
||||||
|
|
||||||
def onBackgroundColorPanelclicked(self):
|
def onBackgroundColourButtonclicked(self):
|
||||||
print "pressed background"
|
print "pressed background"
|
||||||
|
|
||||||
|
def onFontColourButtonclicked(self):
|
||||||
|
print "pressed font"
|
||||||
|
old_name = 0
|
||||||
|
colour = QtGui.QColorDialog.getColor(QColor(old_name), self).name()
|
||||||
|
print colour
|
||||||
|
self.FontColourButton.setStyleSheet('background-color: %s' % colour)
|
||||||
|
|
||||||
|
def load(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def save(self):
|
||||||
|
pass
|
||||||
|
@ -30,6 +30,7 @@ class BiblesTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
SettingsTab.__init__(self, u'Bibles')
|
SettingsTab.__init__(self, u'Bibles')
|
||||||
|
self.load()
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
self.setObjectName(u'BiblesTab')
|
self.setObjectName(u'BiblesTab')
|
||||||
@ -128,28 +129,25 @@ class BiblesTab(SettingsTab):
|
|||||||
self.BibleSearchCheckBox.setText(translate("SettingsForm", "Search-as-you-type"))
|
self.BibleSearchCheckBox.setText(translate("SettingsForm", "Search-as-you-type"))
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
bible_output_style = self.config.get_config("bible_output_style", "Paragraph")
|
bible_output_style = self.config.get_config("output style", "P")
|
||||||
if bible_output_style == "Paragraph":
|
if bible_output_style == "P":
|
||||||
self.ParagraphRadioButton.setChecked()
|
self.ParagraphRadioButton.setChecked(True)
|
||||||
|
self.paragraph_format = True
|
||||||
else:
|
else:
|
||||||
self.VerseRadioButton.setChecked()
|
self.VerseRadioButton.setChecked(True)
|
||||||
# self.SettingsOutputStyleComboBox.setCurrentIndex(int(self.config.get_config("bible_output_style", 0)))
|
self.paragraph_format = False
|
||||||
# self.SettingsVerseStyleComboBox.setCurrentIndex(int(self.config.get_config("bible_verse_style", 0)))
|
display_new_chapters = self.config.get_config("display new chapters", "0")
|
||||||
# try:
|
#self.NewChaptersCheckBox.setState(display_new_chapters)
|
||||||
# self.SettingsNewChapterCheck.setCheckState(int(self.config.get_config("bible_new_chapter", 0)))
|
if display_new_chapters == 0:
|
||||||
#except:
|
self.display_new_chapters = True
|
||||||
# pass
|
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
print "VRB =- ", self.VerseRadioButton.isChecked()
|
|
||||||
print "PRB =- ", self.ParagraphRadioButton.isChecked()
|
|
||||||
if self.ParagraphRadioButton.isChecked():
|
if self.ParagraphRadioButton.isChecked():
|
||||||
self.config.set_config("bible_output_style", "Paragraph")
|
self.config.set_config("output style", "P")
|
||||||
else:
|
else:
|
||||||
self.config.set_config("bible_output_style", "Verse")
|
self.config.set_config("output style", "V")
|
||||||
print "NCCB =- ", self.NewChaptersCheckBox.checkState()
|
self.config.set_config("display new chapter", str(self.NewChaptersCheckBox.checkState()))
|
||||||
print "DSCB =- ", self.DisplayStyleComboBox.currentIndex()
|
self.config.set_config("display brackets", str(self.DisplayStyleComboBox.currentIndex()))
|
||||||
print "BSCB =- ",self.BibleSearchCheckBox.checkState()
|
self.config.set_config("search as type", str(self.BibleSearchCheckBox.checkState()))
|
||||||
#self.config.set_config("bible_output_style", str(self.SettingsOutputStyleComboBox.currentIndex()))
|
|
||||||
#self.config.set_config("bible_verse_style", str(self.SettingsVerseStyleComboBox.currentIndex()))
|
|
||||||
#self.config.set_config("bible_new_chapter", str(self.SettingsNewChapterCheck.checkState()))
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>SettingsDialog</class>
|
<class>SettingsDialog</class>
|
||||||
<widget class="QDialog" name="SettingsDialog">
|
<widget class="QDialog" name="SettingsDialog">
|
||||||
@ -26,7 +27,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="SettingsTabWidget">
|
<widget class="QTabWidget" name="SettingsTabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="GeneralTab">
|
<widget class="QWidget" name="GeneralTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -40,7 +41,7 @@
|
|||||||
<number>8</number>
|
<number>8</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" native="1" name="GeneralLeftWidget" >
|
<widget class="QWidget" name="GeneralLeftWidget" native="true">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="MonitorGroupBox">
|
<widget class="QGroupBox" name="MonitorGroupBox">
|
||||||
@ -133,7 +134,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" native="1" name="GeneralRightWidget" >
|
<widget class="QWidget" name="GeneralRightWidget" native="true">
|
||||||
<layout class="QVBoxLayout" name="GeneralRightLayout">
|
<layout class="QVBoxLayout" name="GeneralRightLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>8</number>
|
<number>8</number>
|
||||||
@ -313,12 +314,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QRadioButton" name="GlobalLevelRadioButton">
|
<widget class="QRadioButton" name="GlobalLevelRadioButton">
|
||||||
<property name="text" >
|
|
||||||
<string>Global level</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Global level</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
@ -348,7 +349,7 @@
|
|||||||
<number>8</number>
|
<number>8</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" native="1" name="AlertLeftColumn" >
|
<widget class="QWidget" name="AlertLeftColumn" native="true">
|
||||||
<layout class="QVBoxLayout" name="SlideLeftLayout">
|
<layout class="QVBoxLayout" name="SlideLeftLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>8</number>
|
<number>8</number>
|
||||||
@ -379,14 +380,8 @@
|
|||||||
<widget class="QFontComboBox" name="FontComboBox"/>
|
<widget class="QFontComboBox" name="FontComboBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" native="1" name="ColorWidget" >
|
<widget class="QWidget" name="ColorWidget" native="true">
|
||||||
<layout class="QHBoxLayout" name="ColorLayout" >
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="spacing" >
|
|
||||||
<number>8</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="FontColorLabel">
|
<widget class="QLabel" name="FontColorLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -395,18 +390,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGraphicsView" name="FontColorPanel" >
|
<widget class="QPushButton" name="FontColourButton">
|
||||||
<property name="minimumSize" >
|
<property name="text">
|
||||||
<size>
|
<string/>
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -431,18 +417,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGraphicsView" name="BackgroundColorPanel" >
|
<widget class="QPushButton" name="BackgroundColourButton">
|
||||||
<property name="minimumSize" >
|
<property name="text">
|
||||||
<size>
|
<string/>
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -450,7 +427,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" native="1" name="LengthWidget" >
|
<widget class="QWidget" name="LengthWidget" native="true">
|
||||||
<layout class="QHBoxLayout" name="LengthLayout">
|
<layout class="QHBoxLayout" name="LengthLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>8</number>
|
<number>8</number>
|
||||||
@ -467,15 +444,15 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="LengthSpinBox">
|
<widget class="QSpinBox" name="LengthSpinBox">
|
||||||
|
<property name="value">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>s</string>
|
<string>s</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>180</number>
|
<number>180</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value" >
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -514,7 +491,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" native="1" name="SlideRightColumn" >
|
<widget class="QWidget" name="SlideRightColumn" native="true">
|
||||||
<layout class="QVBoxLayout" name="SlideRightLayout">
|
<layout class="QVBoxLayout" name="SlideRightLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>8</number>
|
<number>8</number>
|
||||||
@ -525,7 +502,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="PreviewGroupBox">
|
<widget class="QGroupBox" name="PreviewGroupBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -576,7 +553,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="ButtonsBox">
|
<widget class="QDialogButtonBox" name="ButtonsBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
|
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
Loading…
Reference in New Issue
Block a user