From bf2ada0b670679b17ff84700804de16606193165 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 16 Oct 2011 16:39:49 +0100 Subject: [PATCH] Fix up review comments --- openlp/core/lib/eventreceiver.py | 5 +++++ openlp/core/lib/pluginmanager.py | 3 +++ openlp/core/ui/maindisplay.py | 2 +- openlp/plugins/alerts/alertsplugin.py | 15 +++++++++++++++ openlp/plugins/alerts/lib/alertstab.py | 2 +- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 1b957e5df..ef21ffde4 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -219,6 +219,11 @@ class EventReceiver(QtCore.QObject): ``cursor_normal`` Resets the cursor to default + + ``maindisplay_css_updated`` + CSS has been updated which needs to be changed on the main display. + + """ def __init__(self): """ diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 4b706a4c6..277842167 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -44,6 +44,9 @@ class PluginManager(object): @staticmethod def get_instance(): + """ + Obtain a single instance of class. + """ return PluginManager.instance def __init__(self, plugin_dir): diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 5e9077e2f..01b616d9d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -82,7 +82,7 @@ class MainDisplay(QtGui.QGraphicsView): QtCore.SIGNAL(u'openlp_phonon_creation'), self.createMediaObject) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'css_update'), self.cssChanged) + QtCore.SIGNAL(u'maindisplay_css_updated'), self.cssChanged) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_updated'), self.configChanged) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 594649e53..b5a6de8c7 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -179,18 +179,33 @@ class AlertsPlugin(Plugin): } def getDisplayJavaScript(self): + """ + Add Javascript to the main display. + """ return JAVASCRIPT def getDisplayCss(self): + """ + Add CSS to the main display. + """ align = VerticalType.Names[self.settings_tab.location] return CSS % (align, self.settings_tab.font_face, self.settings_tab.font_size, self.settings_tab.font_color, self.settings_tab.bg_color) def getDisplayHtml(self): + """ + Add HTML to the main display. + """ return HTML def refreshCss(self, frame): + """ + Trigger an update of the CSS in the maindisplay. + + `frame` + The Web frame holding the page + """ align = VerticalType.Names[self.settings_tab.location] frame.evaluateJavaScript(u'update_css("%s", "%s", "%s", "%s", "%s")' % (align, self.settings_tab.font_face, self.settings_tab.font_size, diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 8d709a3b8..3cf3c0ab3 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -191,7 +191,7 @@ class AlertsTab(SettingsTab): settings.setValue(u'location', QtCore.QVariant(self.location)) settings.endGroup() if self.changed: - Receiver.send_message(u'css_update') + Receiver.send_message(u'maindisplay_css_updated') self.changed = False def updateDisplay(self):