forked from openlp/openlp
Pass active presentation types to other controllers
This commit is contained in:
parent
124480f3d2
commit
1fd98217ab
@ -104,6 +104,9 @@ class EventReceiver(QtCore.QObject):
|
||||
``remote_edit_clear``
|
||||
Informs all components that remote edit has been aborted.
|
||||
|
||||
``presentation types``
|
||||
Informs all components of the presentation types supported.
|
||||
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'EventReceiver')
|
||||
@ -161,4 +164,4 @@ class Receiver():
|
||||
"""
|
||||
Get the global ``eventreceiver`` instance.
|
||||
"""
|
||||
return Receiver.eventreceiver
|
||||
return Receiver.eventreceiver
|
||||
|
@ -225,12 +225,17 @@ class ServiceManager(QtGui.QWidget):
|
||||
QtCore.SIGNAL(u'update_themes'), self.updateThemeList)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'remote_edit_clear'), self.onRemoteEditClear)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'presentation types'), self.onPresentationTypes)
|
||||
# Last little bits of setting up
|
||||
self.config = PluginConfig(u'ServiceManager')
|
||||
self.servicePath = self.config.get_data_path()
|
||||
self.service_theme = unicode(
|
||||
self.config.get_config(u'service theme', u''))
|
||||
|
||||
def onPresentationTypes(self, presentation_types):
|
||||
self.presentation_types = presentation_types
|
||||
|
||||
def onMoveSelectionUp(self):
|
||||
"""
|
||||
Moves the selection up the window
|
||||
@ -617,7 +622,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
else:
|
||||
pos = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0]
|
||||
count = item.data(0, QtCore.Qt.UserRole).toInt()[0]
|
||||
#adjuest for zero based arrays
|
||||
#adjust for zero based arrays
|
||||
pos = pos - 1
|
||||
return pos, count
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
import os
|
||||
import logging
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon
|
||||
from openlp.core.lib import Plugin, build_icon, Receiver
|
||||
from openlp.plugins.presentations.lib import *
|
||||
|
||||
class PresentationPlugin(Plugin):
|
||||
@ -51,6 +51,12 @@ class PresentationPlugin(Plugin):
|
||||
log.info(u'Presentations Initialising')
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
presentation_types = []
|
||||
for controller in self.controllers:
|
||||
if self.controllers[controller].enabled:
|
||||
presentation_types.append({u'%s' % controller : self.controllers[controller].supports})
|
||||
Receiver.send_message(
|
||||
u'presentation types', presentation_types)
|
||||
|
||||
def finalise(self):
|
||||
log.info(u'Plugin Finalise')
|
||||
@ -106,4 +112,4 @@ class PresentationPlugin(Plugin):
|
||||
'the ability to show presentations using a number of different '
|
||||
'programs. The choice of available presentation programs is '
|
||||
'available to the user in a drop down box.')
|
||||
return about_text
|
||||
return about_text
|
||||
|
Loading…
Reference in New Issue
Block a user