diff --git a/openlp/plugins/remotes/html/stage.css b/openlp/plugins/remotes/html/stage.css index f5a8453f4..9ae413ec1 100644 --- a/openlp/plugins/remotes/html/stage.css +++ b/openlp/plugins/remotes/html/stage.css @@ -3,8 +3,8 @@ * ------------------------------------------------------------------------- * * Copyright (c) 2008-2010 Raoul Snyman * * Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael * - * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, * - * Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, * + * Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin K�hler, * + * Andreas Preikschat, Mattias P�ldaru, Christian Richter, Philip Ridout, * * Jeffrey Smith, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode * * Woldsund * * ------------------------------------------------------------------------- * @@ -46,7 +46,7 @@ body { } #clock { - font-size: 40pt; + font-size: 30pt; color: yellow; text-align: right; } diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 8daa1c7b0..b9df5ebd3 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -427,7 +427,9 @@ class HttpConnection(object): Send an alert. """ text = json.loads(self.url_params[u'data'][0])[u'request'][u'text'] - Receiver.send_message(u'alerts_text', [text]) + plugin = self.parent.plugin.pluginManager.get_plugin_by_name("alerts") + if plugin.status == PluginStatus.Active: + Receiver.send_message(u'alerts_text', [text]) return HttpResponse(json.dumps({u'results': {u'success': True}}), {u'Content-Type': u'application/json'}) diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index 70005226c..042e206fc 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui, QtNetwork -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab, translate, Receiver ZERO_URL = u'0.0.0.0' @@ -160,12 +160,20 @@ class RemoteTab(SettingsTab): self.setUrls() def save(self): + changed = False + if QtCore.QSettings().value(self.settingsSection + u'/ip address', + QtCore.QVariant(ZERO_URL).toString() != self.addressEdit.text() or + QtCore.QSettings().value(self.settingsSection + u'/port', + QtCore.QVariant(4316).toInt()[0]) != self.portSpinBox.value()): + changed = True QtCore.QSettings().setValue(self.settingsSection + u'/port', QtCore.QVariant(self.portSpinBox.value())) QtCore.QSettings().setValue(self.settingsSection + u'/ip address', QtCore.QVariant(self.addressEdit.text())) QtCore.QSettings().setValue(self.settingsSection + u'/twelve hour', QtCore.QVariant(self.twelveHour)) + if changed: + Receiver.send_message(u'remote_config_updated') def onTwelveHourCheckBoxChanged(self, check_state): self.twelveHour = False diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index d51c3b147..dc180a827 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -27,7 +27,10 @@ import logging -from openlp.core.lib import Plugin, StringContent, translate, build_icon +from PyQt4 import QtCore + +from openlp.core.lib import Plugin, StringContent, translate, build_icon,\ + Receiver from openlp.plugins.remotes.lib import RemoteTab, HttpServer log = logging.getLogger(__name__) @@ -45,6 +48,9 @@ class RemotesPlugin(Plugin): self.icon = build_icon(self.icon_path) self.weight = -1 self.server = None + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'remote_config_updated'), + self.config_updated) def initialise(self): """ @@ -86,3 +92,11 @@ class RemotesPlugin(Plugin): self.textStrings[StringContent.VisibleName] = { u'title': translate('RemotePlugin', 'Remote', 'container title') } + + def config_updated(self): + """ + Called when Config is changed to restart the server on new address or + port + """ + self.finalise() + self.initialise()