forked from openlp/openlp
fix up alert changing triggers
This commit is contained in:
parent
9176911810
commit
e87b4658d8
@ -58,6 +58,7 @@ class MainDisplay(QtGui.QGraphicsView):
|
|||||||
self.screens = ScreenList.get_instance()
|
self.screens = ScreenList.get_instance()
|
||||||
self.plugins = PluginManager.get_instance().plugins
|
self.plugins = PluginManager.get_instance().plugins
|
||||||
self.alertTab = None
|
self.alertTab = None
|
||||||
|
self.rebuildCSS = False
|
||||||
self.hideMode = None
|
self.hideMode = None
|
||||||
self.videoHide = False
|
self.videoHide = False
|
||||||
self.override = {}
|
self.override = {}
|
||||||
@ -81,6 +82,20 @@ class MainDisplay(QtGui.QGraphicsView):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'openlp_phonon_creation'),
|
QtCore.SIGNAL(u'openlp_phonon_creation'),
|
||||||
self.createMediaObject)
|
self.createMediaObject)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'alertTab_updated'), self.alertTabChanged)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'config_updated'), self.configChanged)
|
||||||
|
|
||||||
|
def alertTabChanged(self):
|
||||||
|
print "alert"
|
||||||
|
self.rebuildCSS = True
|
||||||
|
|
||||||
|
def configChanged(self):
|
||||||
|
print "config"
|
||||||
|
if self.rebuildCSS:
|
||||||
|
print "Need to rebuild"
|
||||||
|
self.rebuildCSS = False
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
"""
|
"""
|
||||||
|
@ -58,7 +58,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
|||||||
# load all the settings
|
# load all the settings
|
||||||
self.settingListWidget.clear()
|
self.settingListWidget.clear()
|
||||||
for tabIndex in range(0, self.stackedLayout.count() + 1):
|
for tabIndex in range(0, self.stackedLayout.count() + 1):
|
||||||
# take at 0 and the rest shuffell up.
|
# take at 0 and the rest shuffle up.
|
||||||
self.stackedLayout.takeAt(0)
|
self.stackedLayout.takeAt(0)
|
||||||
self.insertTab(self.generalTab, 0, PluginStatus.Active)
|
self.insertTab(self.generalTab, 0, PluginStatus.Active)
|
||||||
self.insertTab(self.themesTab, 1, PluginStatus.Active)
|
self.insertTab(self.themesTab, 1, PluginStatus.Active)
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate
|
from openlp.core.lib import SettingsTab, translate, Receiver
|
||||||
from openlp.core.lib.ui import UiStrings, create_valign_combo
|
from openlp.core.lib.ui import UiStrings, create_valign_combo
|
||||||
|
|
||||||
class AlertsTab(SettingsTab):
|
class AlertsTab(SettingsTab):
|
||||||
@ -140,6 +140,7 @@ class AlertsTab(SettingsTab):
|
|||||||
|
|
||||||
def onTimeoutSpinBoxChanged(self):
|
def onTimeoutSpinBoxChanged(self):
|
||||||
self.timeout = self.timeoutSpinBox.value()
|
self.timeout = self.timeoutSpinBox.value()
|
||||||
|
self.changed = True
|
||||||
|
|
||||||
def onFontSizeSpinBoxChanged(self):
|
def onFontSizeSpinBoxChanged(self):
|
||||||
self.font_size = self.fontSizeSpinBox.value()
|
self.font_size = self.fontSizeSpinBox.value()
|
||||||
@ -171,10 +172,15 @@ class AlertsTab(SettingsTab):
|
|||||||
font.setFamily(self.font_face)
|
font.setFamily(self.font_face)
|
||||||
self.fontComboBox.setCurrentFont(font)
|
self.fontComboBox.setCurrentFont(font)
|
||||||
self.updateDisplay()
|
self.updateDisplay()
|
||||||
|
self.changed = False
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settingsSection)
|
settings.beginGroup(self.settingsSection)
|
||||||
|
# Check value has changed as no event handles this field
|
||||||
|
if settings.value(u'location', QtCore.QVariant(1)).toInt()[0] != \
|
||||||
|
self.verticalComboBox.currentIndex():
|
||||||
|
self.changed = True
|
||||||
settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
|
settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
|
||||||
settings.setValue(u'font color', QtCore.QVariant(self.font_color))
|
settings.setValue(u'font color', QtCore.QVariant(self.font_color))
|
||||||
settings.setValue(u'font size', QtCore.QVariant(self.font_size))
|
settings.setValue(u'font size', QtCore.QVariant(self.font_size))
|
||||||
@ -184,6 +190,9 @@ class AlertsTab(SettingsTab):
|
|||||||
self.location = self.verticalComboBox.currentIndex()
|
self.location = self.verticalComboBox.currentIndex()
|
||||||
settings.setValue(u'location', QtCore.QVariant(self.location))
|
settings.setValue(u'location', QtCore.QVariant(self.location))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
if self.changed:
|
||||||
|
Receiver.send_message(u'alertTab_updated')
|
||||||
|
self.changed = False
|
||||||
|
|
||||||
def updateDisplay(self):
|
def updateDisplay(self):
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
@ -193,4 +202,5 @@ class AlertsTab(SettingsTab):
|
|||||||
self.fontPreview.setFont(font)
|
self.fontPreview.setFont(font)
|
||||||
self.fontPreview.setStyleSheet(u'background-color: %s; color: %s' %
|
self.fontPreview.setStyleSheet(u'background-color: %s; color: %s' %
|
||||||
(self.bg_color, self.font_color))
|
(self.bg_color, self.font_color))
|
||||||
|
self.changed = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user