forked from openlp/openlp
Change Tab load code to base class instead of plugins
Code VideoTab to save and reload value bzr-revno: 378
This commit is contained in:
parent
8533912cea
commit
dffcec7ca3
|
@ -38,6 +38,7 @@ class SettingsTab(QtGui.QWidget):
|
|||
self.config = PluginConfig(u"Main")
|
||||
else:
|
||||
self.config = PluginConfig(str(title))
|
||||
self.load()
|
||||
|
||||
def setTitle(self, title):
|
||||
self.tabTitle = title
|
||||
|
|
|
@ -31,7 +31,6 @@ class AlertsTab(SettingsTab):
|
|||
"""
|
||||
def __init__(self):
|
||||
SettingsTab.__init__(self, u'Alerts')
|
||||
self.load()
|
||||
|
||||
def setupUi(self):
|
||||
self.setObjectName(u'AlertsTab')
|
||||
|
@ -156,7 +155,7 @@ class AlertsTab(SettingsTab):
|
|||
QtCore.QObject.connect(self.FontComboBox,\
|
||||
QtCore.SIGNAL("activated(int)"), self.onFontComboBoxclicked)
|
||||
QtCore.QObject.connect(self.LengthSpinBox,\
|
||||
QtCore.SIGNAL("valueChanged(int)"), self.onLengthSpinBoxclicked)
|
||||
QtCore.SIGNAL("valueChanged(int)"), self.onLengthSpinBoxchanged)
|
||||
|
||||
def retranslateUi(self):
|
||||
self.FontGroupBox.setTitle(translate(u'AlertsTab', u'Font'))
|
||||
|
@ -180,7 +179,7 @@ class AlertsTab(SettingsTab):
|
|||
self.FontColourButton.setStyleSheet('background-color: %s' % self.font_color)
|
||||
self._update_display()
|
||||
|
||||
def onLengthSpinBoxclicked(self):
|
||||
def onLengthSpinBoxchanged(self):
|
||||
self.spin_length = self.LengthSpinBox.value()
|
||||
|
||||
def load(self):
|
||||
|
@ -212,3 +211,9 @@ class AlertsTab(SettingsTab):
|
|||
font.setPointSize(20)
|
||||
self.FontPreview.setFont(font)
|
||||
self.FontPreview.setStyleSheet("alignment : centre; background-color: "+ self.bg_color+ "; color: " + self.font_color)
|
||||
|
||||
def load(self):
|
||||
pass
|
||||
|
||||
def save(self):
|
||||
pass
|
||||
|
|
|
@ -30,7 +30,6 @@ class BiblesTab(SettingsTab):
|
|||
"""
|
||||
def __init__(self):
|
||||
SettingsTab.__init__(self, u'Bibles')
|
||||
self.load()
|
||||
|
||||
def setupUi(self):
|
||||
self.setObjectName(u'BiblesTab')
|
||||
|
|
|
@ -52,6 +52,9 @@ class VideoTab(SettingsTab):
|
|||
|
||||
self.VideoLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.VideoModeGroupBox)
|
||||
|
||||
QtCore.QObject.connect(self.UseVMRCheckBox,\
|
||||
QtCore.SIGNAL("stateChanged(int)"), self.onVMRCheckBoxchanged)
|
||||
|
||||
def retranslateUi(self):
|
||||
self.VideoModeGroupBox.setTitle(translate("SettingsForm", "Video Mode"))
|
||||
self.UseVMRCheckBox.setText(translate("SettingsForm", "Use Video Mode Rendering"))
|
||||
|
@ -60,3 +63,22 @@ class VideoTab(SettingsTab):
|
|||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'DejaVu Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">No video preview available with VMR enabled</span></p></body></html>"))
|
||||
|
||||
def onVMRCheckBoxchanged(self):
|
||||
mode_layout = self.UseVMRCheckBox.checkState()
|
||||
self.mode_layout = False
|
||||
if mode_layout == 2: # we have a set value convert to True/False
|
||||
self.mode_layout = True
|
||||
|
||||
def load(self):
|
||||
mode_layout = self.config.get_config("use mode layout",u"0" )
|
||||
self.mode_layout = True
|
||||
# used for first time initialisation
|
||||
# mode_layout will be a string with True/False so need to fix and make boolean
|
||||
if mode_layout == '0'or mode_layout == "False":
|
||||
self.mode_layout = False
|
||||
else:
|
||||
self.UseVMRCheckBox.setChecked(True)
|
||||
|
||||
def save(self):
|
||||
self.config.set_config("use mode layout", str(self.mode_layout))
|
||||
|
|
Loading…
Reference in New Issue