openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #19367
[Merge] lp:~googol/openlp/registry into lp:openlp
Andreas Preikschat has proposed merging lp:~googol/openlp/registry into lp:openlp.
Requested reviews:
Tim Bentley (trb143)
Raoul Snyman (raoul-snyman)
Andreas Preikschat (googol)
For more details, see:
https://code.launchpad.net/~googol/openlp/registry/+merge/148749
Hello,
- fixed alert display regression
- fixed image plugin regression
- fixed remote plugin regression
To be reviewed after Tim's branch: lp:~trb143/openlp/event_receiver_removal
--
https://code.launchpad.net/~googol/openlp/registry/+merge/148749
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/alerts/lib/alertsmanager.py'
--- openlp/plugins/alerts/lib/alertsmanager.py 2013-02-07 08:42:17 +0000
+++ openlp/plugins/alerts/lib/alertsmanager.py 2013-02-15 16:20:31 +0000
@@ -35,7 +35,11 @@
from PyQt4 import QtCore
+<<<<<<< TREE
from openlp.core.lib import Registry, translate
+=======
+from openlp.core.lib import Receiver, translate, Registry
+>>>>>>> MERGE-SOURCE
log = logging.getLogger(__name__)
@@ -87,7 +91,7 @@
return
text = self.alert_list.pop(0)
alertTab = self.parent().settingsTab
- self.parent().liveController.display.alert(text, alertTab.location)
+ self.live_controller.display.alert(text, alertTab.location)
# Check to see if we have a timer running.
if self.timer_id == 0:
self.timer_id = self.startTimer(int(alertTab.timeout) * 1000)
@@ -103,9 +107,10 @@
log.debug(u'timer event')
if event.timerId() == self.timer_id:
alertTab = self.parent().settingsTab
- self.parent().liveController.display.alert(u'', alertTab.location)
+ self.live_controller.display.alert(u'', alertTab.location)
self.killTimer(self.timer_id)
self.timer_id = 0
+<<<<<<< TREE
self.generate_alert()
def _get_main_window(self):
@@ -116,4 +121,16 @@
self._main_window = Registry().get(u'main_window')
return self._main_window
- main_window = property(_get_main_window)
\ No newline at end of file
+ main_window = property(_get_main_window)=======
+ self.generateAlert()
+
+ def _get_live_controller(self):
+ """
+ Adds the live controller to the class dynamically
+ """
+ if not hasattr(self, u'_live_controller'):
+ self._live_controller = Registry().get(u'live_controller')
+ return self._live_controller
+
+ live_controller = property(_get_live_controller)
+>>>>>>> MERGE-SOURCE
=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py 2013-02-07 08:42:17 +0000
+++ openlp/plugins/images/imageplugin.py 2013-02-15 16:20:31 +0000
@@ -31,7 +31,11 @@
import logging
+<<<<<<< TREE
from openlp.core.lib import Plugin, StringContent, Registry, ImageSource, Settings, build_icon, translate
+=======
+from openlp.core.lib import Plugin, StringContent, Receiver, ImageSource, Settings, Registry, build_icon, translate
+>>>>>>> MERGE-SOURCE
from openlp.plugins.images.lib import ImageMediaItem, ImageTab
log = logging.getLogger(__name__)
@@ -98,4 +102,14 @@
last part of saving the config.
"""
background = QtGui.QColor(Settings().value(self.settingsSection + u'/background color'))
- self.liveController.imageManager.update_images_border(ImageSource.ImagePlugin, background)
+ self.image_manager.update_images_border(ImageSource.ImagePlugin, background)
+
+ def _get_image_manager(self):
+ """
+ Adds the image manager to the class dynamically
+ """
+ if not hasattr(self, u'_image_manager'):
+ self._image_manager = Registry().get(u'image_manager')
+ return self._image_manager
+
+ image_manager = property(_get_image_manager)
=== modified file 'openlp/plugins/remotes/lib/httpserver.py'
--- openlp/plugins/remotes/lib/httpserver.py 2013-02-07 08:42:17 +0000
+++ openlp/plugins/remotes/lib/httpserver.py 2013-02-15 16:20:31 +0000
@@ -123,7 +123,11 @@
from PyQt4 import QtCore, QtNetwork
from mako.template import Template
+<<<<<<< TREE
from openlp.core.lib import Registry, Settings, PluginStatus, StringContent
+=======
+from openlp.core.lib import Receiver, Settings, PluginStatus, StringContent, Registry
+>>>>>>> MERGE-SOURCE
from openlp.core.utils import AppLocation, translate
log = logging.getLogger(__name__)
@@ -250,12 +254,11 @@
def _get_service_items(self):
service_items = []
- service_manager = self.parent.plugin.serviceManager
if self.parent.current_item:
current_unique_identifier = self.parent.current_item.unique_identifier
else:
current_unique_identifier = None
- for item in service_manager.serviceItems:
+ for item in self.service_manager.serviceItems:
service_item = item[u'service_item']
service_items.append({
u'id': unicode(service_item.unique_identifier),
@@ -386,13 +389,13 @@
Poll OpenLP to determine the current slide number and item name.
"""
result = {
- u'service': self.parent.plugin.serviceManager.service_id,
+ u'service': self.service_manager.service_id,
u'slide': self.parent.current_slide or 0,
u'item': self.parent.current_item.unique_identifier if self.parent.current_item else u'',
u'twelve':Settings().value(u'remotes/twelve hour'),
- u'blank': self.parent.plugin.liveController.blankScreen.isChecked(),
- u'theme': self.parent.plugin.liveController.themeScreen.isChecked(),
- u'display': self.parent.plugin.liveController.desktopScreen.isChecked()
+ u'blank': self.live_controller.blankScreen.isChecked(),
+ u'theme': self.live_controller.themeScreen.isChecked(),
+ u'display': self.live_controller.desktopScreen.isChecked()
}
return HttpResponse(json.dumps({u'results': result}),
{u'Content-Type': u'application/json'})
@@ -412,7 +415,7 @@
"""
Send an alert.
"""
- plugin = self.parent.plugin.pluginManager.get_plugin_by_name("alerts")
+ plugin = self.plugin_manager.get_plugin_by_name("alerts")
if plugin.status == PluginStatus.Active:
try:
text = json.loads(self.url_params[u'data'][0])[u'request'][u'text']
@@ -504,7 +507,7 @@
"""
if action == u'search':
searches = []
- for plugin in self.parent.plugin.pluginManager.plugins:
+ for plugin in self.plugin_manager.plugins:
if plugin.status == PluginStatus.Active and plugin.mediaItem and plugin.mediaItem.hasSearch:
searches.append([plugin.name, unicode(plugin.textStrings[StringContent.Name][u'plural'])])
return HttpResponse(
@@ -523,7 +526,7 @@
except KeyError, ValueError:
return HttpResponse(code=u'400 Bad Request')
text = urllib.unquote(text)
- plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type)
+ plugin = self.plugin_manager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and plugin.mediaItem and plugin.mediaItem.hasSearch:
results = plugin.mediaItem.search(text, False)
else:
@@ -539,7 +542,7 @@
id = json.loads(self.url_params[u'data'][0])[u'request'][u'id']
except KeyError, ValueError:
return HttpResponse(code=u'400 Bad Request')
- plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type)
+ plugin = self.plugin_manager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and plugin.mediaItem:
plugin.mediaItem.goLive(id, remote=True)
return HttpResponse(code=u'200 OK')
@@ -552,7 +555,7 @@
id = json.loads(self.url_params[u'data'][0])[u'request'][u'id']
except KeyError, ValueError:
return HttpResponse(code=u'400 Bad Request')
- plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type)
+ plugin = self.plugin_manager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and plugin.mediaItem:
item_id = plugin.mediaItem.createItemFromId(id)
plugin.mediaItem.addToService(item_id, remote=True)
@@ -583,3 +586,33 @@
self.socket.close()
self.socket = None
self.parent.close_connection(self)
+
+ def _get_service_manager(self):
+ """
+ Adds the service manager to the class dynamically
+ """
+ if not hasattr(self, u'_service_manager'):
+ self._service_manager = Registry().get(u'service_manager')
+ return self._service_manager
+
+ service_manager = property(_get_service_manager)
+
+ def _get_live_controller(self):
+ """
+ Adds the live controller to the class dynamically
+ """
+ if not hasattr(self, u'_live_controller'):
+ self._live_controller = Registry().get(u'live_controller')
+ return self._live_controller
+
+ live_controller = property(_get_live_controller)
+
+ def _get_plugin_manager(self):
+ """
+ Adds the plugin manager to the class dynamically
+ """
+ if not hasattr(self, u'_plugin_manager'):
+ self._plugin_manager = Registry().get(u'plugin_manager')
+ return self._plugin_manager
+
+ plugin_manager = property(_get_plugin_manager)
Follow ups