This commit is contained in:
rimach 2010-04-25 21:29:39 +02:00
commit 95a1419d9c
31 changed files with 349 additions and 311 deletions

View File

@ -117,7 +117,7 @@ class OpenLP(QtGui.QApplication):
pass pass
#provide a listener for widgets to reqest a screen update. #provide a listener for widgets to reqest a screen update.
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'process_events'), self.processEvents) QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
self.setApplicationName(u'OpenLP') self.setApplicationName(u'OpenLP')
self.setApplicationVersion(app_version[u'version']) self.setApplicationVersion(app_version[u'version'])
if os.name == u'nt': if os.name == u'nt':

View File

@ -35,36 +35,87 @@ class EventReceiver(QtCore.QObject):
system. This is a private class and should not be used directly system. This is a private class and should not be used directly
but rather via the Receiver class. but rather via the Receiver class.
``stop_import`` ``openlp_process_events``
Stops the Bible Import
``pre_load_bibles``
Triggers the plugin to relaod the bible lists
``process_events``
Requests the Application to flush the events queue Requests the Application to flush the events queue
``{plugin}_add_service_item`` ``openlp_version_check``
ask the plugin to push the selected items to the service item Version has changed so pop up window.
``update_themes`` ``config_updated``
Informs components the config has changed
``config_screen_changed``
The display monitor has been changed
``slidecontroller_{live|preview}_first``
Moves to the first slide
``slidecontroller_{live|preview}_next``
Moves to the next slide
``slidecontroller_{live|preview}_next_noloop``
Moves to the next slide without auto advance
``slidecontroller_{live|preview}_previous``
Moves to the previous slide
``slidecontroller_{live|preview}_previous_noloop``
Moves to the previous slide, without auto advance
``slidecontroller_{live|preview}_last``
Moves to the last slide
``slidecontroller_{live|preview}_started``
Broadcasts that an item has been made live/previewed
``slidecontroller_{live|preview}_change``
Informs the slidecontroller that a slide change has occurred
``slidecontroller_live_spin_delay``
Pushes out the loop delay
``slidecontroller_live_stop_loop``
Stop the loop on the main display
``servicecontroller_next_item``
Display the next item in the service
``maindisplay_blank``
Blank the maindisplay window
``maindisplay_hide``
Hide the maindisplay window
``maindisplay_show``
Return the maindisplay window
``maindisplay_active``
The maindisplay has been made active
``maindisplay_status_text``
Changes the bottom status bar text on the maindisplay window
``maindisplay_blank_check``
Check to see if the blank display message is required
``videodisplay_start``
Open a media item and prepare for playing
``videodisplay_play``
Start playing a media item
``videodisplay_pause``
Pause a media item
``videodisplay_stop``
Stop playing a media item
``theme_update_list``
send out message with new themes send out message with new themes
``update_global_theme`` ``theme_update_global``
Tell the components we have a new global theme Tell the components we have a new global theme
``load_song_list``
Tells the the song plugin to reload the song list
``load_custom_list``
Tells the the custom plugin to reload the custom list
``update_spin_delay``
Pushes out the Image loop delay
``request_spin_delay``
Requests a spin delay
``{plugin}_start`` ``{plugin}_start``
Requests a plugin to start a external program Requests a plugin to start a external program
Path and file provided in message Path and file provided in message
@ -81,42 +132,47 @@ class EventReceiver(QtCore.QObject):
``{plugin}_last`` ``{plugin}_last``
Requests a plugin to handle a last event Requests a plugin to handle a last event
``{plugin}_slide``
Requests a plugin to handle a go to specific slide event
``{plugin}_stop`` ``{plugin}_stop``
Requests a plugin to handle a stop event Requests a plugin to handle a stop event
``{plugin}_blank``
Requests a plugin to handle a blank screen event
``{plugin}_unblank``
Requests a plugin to handle an unblank screen event
``{plugin}_edit`` ``{plugin}_edit``
Requests a plugin edit a database item with the key as the payload Requests a plugin edit a database item with the key as the payload
``songusage_live`` ``{plugin}_edit_clear``
Sends live song audit requests to the audit component Editing has been completed
``audit_changed`` ``{plugin}_load_list``
Audit information may have changed Tells the the plugin to reload the media manager list
``config_updated`` ``{plugin}_preview``
Informs components the config has changed Tells the plugin it's item can be previewed
``preview_song`` ``{plugin}_add_service_item``
Tells the song plugin the edit has finished and the song can be previewed Ask the plugin to push the selected items to the service item
Only available if the edit was triggered by the Preview button.
``slidecontroller_change`` ``alerts_text``
Informs the slidecontroller that a slide change has occurred Displays an alert message
``bibles_nobook``
Attempt to find book resulted in no match
``remote_edit_clear`` ``bibles_showprogress``
Informs all components that remote edit has been aborted. Show progress of bible verse import
``presentation types`` ``bibles_hideprogress``
Informs all components of the presentation types supported. Hide progress of bible verse import
``blank_check`` ``bibles_stop_import``
Check to see if th eblank display message is required Stops the Bible Import
``version_check``
Version has changed so pop up window.
``mainDisplay_active``
Version has changed so pop up window.
""" """
def __init__(self): def __init__(self):
@ -173,4 +229,3 @@ class Receiver():
Get the global ``eventreceiver`` instance. Get the global ``eventreceiver`` instance.
""" """
return Receiver.eventreceiver return Receiver.eventreceiver

View File

@ -425,12 +425,13 @@ class MediaManagerItem(QtGui.QWidget):
else: else:
#Is it posssible to process multiple list items to generate multiple #Is it posssible to process multiple list items to generate multiple
#service items? #service items?
if self.singleServiceItem: if self.singleServiceItem or self.remoteTriggered:
log.debug(self.PluginNameShort + u' Add requested') log.debug(self.PluginNameShort + u' Add requested')
service_item = self.buildServiceItem() service_item = self.buildServiceItem()
if service_item: if service_item:
service_item.from_plugin = False service_item.from_plugin = False
self.parent.service_manager.addServiceItem(service_item) self.parent.service_manager.addServiceItem(service_item,
replace=self.remoteTriggered)
else: else:
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
for item in items: for item in items:
@ -453,10 +454,10 @@ class MediaManagerItem(QtGui.QWidget):
self.trUtf8('You must select a existing service item to add to.')) self.trUtf8('You must select a existing service item to add to.'))
elif self.title.lower() == service_item.name.lower(): elif self.title.lower() == service_item.name.lower():
self.generateSlideData(service_item) self.generateSlideData(service_item)
self.parent.service_manager.addServiceItem(service_item) self.parent.service_manager.addServiceItem(service_item,
replace=True)
else: else:
#Turn off the remote edit update message indicator #Turn off the remote edit update message indicator
self.parent.service_manager.remoteEditTriggered = False
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
self.trUtf8('Invalid Service Item'), self.trUtf8('Invalid Service Item'),
self.trUtf8(unicode('You must select a %s service item.' % self.title))) self.trUtf8(unicode('You must select a %s service item.' % self.title)))

View File

@ -336,6 +336,3 @@ class ServiceItem(object):
""" """
return self._raw_frames[row][u'path'] return self._raw_frames[row][u'path']
def request_audit(self):
if self.audit:
Receiver.send_message(u'songusage_live', self.audit)

View File

@ -258,4 +258,5 @@ class GeneralTab(SettingsTab):
if self.screens.monitor_number != self.MonitorNumber: if self.screens.monitor_number != self.MonitorNumber:
self.screens.monitor_number = self.MonitorNumber self.screens.monitor_number = self.MonitorNumber
self.screens.set_current_display(self.MonitorNumber) self.screens.set_current_display(self.MonitorNumber)
Receiver.send_message(u'screen_changed') Receiver.send_message(u'config_screen_changed')
Receiver.send_message(u'config_updated')

View File

@ -66,26 +66,27 @@ class DisplayWidget(QtGui.QWidget):
def __init__(self, parent=None, name=None): def __init__(self, parent=None, name=None):
QtGui.QWidget.__init__(self, None) QtGui.QWidget.__init__(self, None)
self.parent = parent self.parent = parent
self.hotkey_map = {QtCore.Qt.Key_Return: 'servicemanager_next_item', self.hotkey_map = {
QtCore.Qt.Key_Space: 'live_slidecontroller_next_noloop', QtCore.Qt.Key_Return: 'servicemanager_next_item',
QtCore.Qt.Key_Enter: 'live_slidecontroller_next_noloop', QtCore.Qt.Key_Space: 'slidecontroller_live_next_noloop',
QtCore.Qt.Key_0: 'servicemanager_next_item', QtCore.Qt.Key_Enter: 'slidecontroller_live_next_noloop',
QtCore.Qt.Key_Backspace: 'live_slidecontroller_previous_noloop'} QtCore.Qt.Key_0: 'servicemanager_next_item',
QtCore.Qt.Key_Backspace: 'slidecontroller_live_previous_noloop'}
def keyPressEvent(self, event): def keyPressEvent(self, event):
if type(event) == QtGui.QKeyEvent: if type(event) == QtGui.QKeyEvent:
#here accept the event and do something #here accept the event and do something
if event.key() == QtCore.Qt.Key_Up: if event.key() == QtCore.Qt.Key_Up:
Receiver.send_message(u'live_slidecontroller_previous') Receiver.send_message(u'slidecontroller_live_previous')
event.accept() event.accept()
elif event.key() == QtCore.Qt.Key_Down: elif event.key() == QtCore.Qt.Key_Down:
Receiver.send_message(u'live_slidecontroller_next') Receiver.send_message(u'slidecontroller_live_next')
event.accept() event.accept()
elif event.key() == QtCore.Qt.Key_PageUp: elif event.key() == QtCore.Qt.Key_PageUp:
Receiver.send_message(u'live_slidecontroller_first') Receiver.send_message(u'slidecontroller_live_first')
event.accept() event.accept()
elif event.key() == QtCore.Qt.Key_PageDown: elif event.key() == QtCore.Qt.Key_PageDown:
Receiver.send_message(u'live_slidecontroller_last') Receiver.send_message(u'slidecontroller_live_last')
event.accept() event.accept()
elif event.key() in self.hotkey_map: elif event.key() in self.hotkey_map:
Receiver.send_message(self.hotkey_map[event.key()]) Receiver.send_message(self.hotkey_map[event.key()])
@ -113,7 +114,7 @@ class MainDisplay(DisplayWidget):
``screens`` ``screens``
The list of screens. The list of screens.
""" """
log.debug(u'Initilisation started') log.debug(u'Initialisation started')
DisplayWidget.__init__(self, parent) DisplayWidget.__init__(self, parent)
self.parent = parent self.parent = parent
self.setWindowTitle(u'OpenLP Display') self.setWindowTitle(u'OpenLP Display')
@ -133,11 +134,11 @@ class MainDisplay(DisplayWidget):
self.hasTransition = False self.hasTransition = False
self.mediaBackground = False self.mediaBackground = False
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'live_slide_hide'), self.hideDisplay) QtCore.SIGNAL(u'maindisplay_hide'), self.hideDisplay)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'live_slide_show'), self.showDisplay) QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_start'), self.hideDisplay) QtCore.SIGNAL(u'videodisplay_start'), self.hideDisplay)
def setup(self): def setup(self):
""" """
@ -194,7 +195,7 @@ class MainDisplay(DisplayWidget):
def resetDisplay(self): def resetDisplay(self):
log.debug(u'resetDisplay') log.debug(u'resetDisplay')
Receiver.send_message(u'stop_display_loop') Receiver.send_message(u'slidecontroller_live_stop_loop')
if self.primary: if self.primary:
self.setVisible(False) self.setVisible(False)
else: else:
@ -218,7 +219,7 @@ class MainDisplay(DisplayWidget):
if not self.primary: if not self.primary:
self.setVisible(True) self.setVisible(True)
self.showFullScreen() self.showFullScreen()
Receiver.send_message(u'flush_alert') Receiver.send_message(u'maindisplay_active')
def addImageWithText(self, frame): def addImageWithText(self, frame):
log.debug(u'addImageWithText') log.debug(u'addImageWithText')
@ -296,7 +297,6 @@ class MainDisplay(DisplayWidget):
elif self.display_frame: elif self.display_frame:
self.frameView(self.display_frame) self.frameView(self.display_frame)
class VideoDisplay(Phonon.VideoWidget): class VideoDisplay(Phonon.VideoWidget):
""" """
This is the form that is used to display videos on the projector. This is the form that is used to display videos on the projector.
@ -314,7 +314,7 @@ class VideoDisplay(Phonon.VideoWidget):
``screens`` ``screens``
The list of screens. The list of screens.
""" """
log.debug(u'VideoDisplay Initilisation started') log.debug(u'VideoDisplay Initialisation started')
Phonon.VideoWidget.__init__(self) Phonon.VideoWidget.__init__(self)
self.setWindowTitle(u'OpenLP Video Display') self.setWindowTitle(u'OpenLP Video Display')
self.parent = parent self.parent = parent
@ -325,15 +325,15 @@ class VideoDisplay(Phonon.VideoWidget):
Phonon.createPath(self.mediaObject, self) Phonon.createPath(self.mediaObject, self)
Phonon.createPath(self.mediaObject, self.audioObject) Phonon.createPath(self.mediaObject, self.audioObject)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_start'), self.onMediaQueue) QtCore.SIGNAL(u'videodisplay_start'), self.onMediaQueue)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_play'), self.onMediaPlay) QtCore.SIGNAL(u'videodisplay_play'), self.onMediaPlay)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_pause'), self.onMediaPause) QtCore.SIGNAL(u'videodisplay_pause'), self.onMediaPause)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_stop'), self.onMediaStop) QtCore.SIGNAL(u'videodisplay_stop'), self.onMediaStop)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_config'), self.setup) QtCore.SIGNAL(u'config_updated'), self.setup)
def keyPressEvent(self, event): def keyPressEvent(self, event):
if type(event) == QtGui.QKeyEvent: if type(event) == QtGui.QKeyEvent:
@ -350,7 +350,7 @@ class VideoDisplay(Phonon.VideoWidget):
Sets up the screen on a particular screen. Sets up the screen on a particular screen.
""" """
log.debug(u'VideoDisplay Setup %s for %s ' %(self.screens, log.debug(u'VideoDisplay Setup %s for %s ' %(self.screens,
self.screens.monitor_number)) self.screens.monitor_number))
self.setVisible(False) self.setVisible(False)
self.screen = self.screens.current self.screen = self.screens.current
#Sort out screen locations and sizes #Sort out screen locations and sizes
@ -365,7 +365,8 @@ class VideoDisplay(Phonon.VideoWidget):
def onMediaQueue(self, message): def onMediaQueue(self, message):
log.debug(u'VideoDisplay Queue new media message %s' % message) log.debug(u'VideoDisplay Queue new media message %s' % message)
file = os.path.join(message[1], message[2]) file = os.path.join(message[0].get_frame_path(),
message[0].get_frame_title())
source = self.mediaObject.setCurrentSource(Phonon.MediaSource(file)) source = self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
self.onMediaPlay() self.onMediaPlay()

View File

@ -68,11 +68,11 @@ class VersionThread(QtCore.QThread):
Run the thread. Run the thread.
""" """
time.sleep(1) time.sleep(1)
Receiver.send_message(u'blank_check') Receiver.send_message(u'maindisplay_blank_check')
version = check_latest_version(self.generalConfig, self.app_version) version = check_latest_version(self.generalConfig, self.app_version)
#new version has arrived #new version has arrived
if version != self.app_version[u'full']: if version != self.app_version[u'full']:
Receiver.send_message(u'version_check', u'%s' % version) Receiver.send_message(u'openlp_version_check', u'%s' % version)
class Ui_MainWindow(object): class Ui_MainWindow(object):
def setupUi(self, MainWindow): def setupUi(self, MainWindow):
@ -512,15 +512,15 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtCore.QObject.connect(self.OptionsSettingsItem, QtCore.QObject.connect(self.OptionsSettingsItem,
QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked) QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_global_theme'), self.defaultThemeChanged) QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'version_check'), self.versionCheck) QtCore.SIGNAL(u'openlp_version_check'), self.versionCheck)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'blank_check'), self.blankCheck) QtCore.SIGNAL(u'maindisplay_blank_check'), self.blankCheck)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'screen_changed'), self.screenChanged) QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'status_message'), self.showStatusMessage) QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage)
QtCore.QObject.connect(self.FileNewItem, QtCore.QObject.connect(self.FileNewItem,
QtCore.SIGNAL(u'triggered()'), QtCore.SIGNAL(u'triggered()'),
self.ServiceManagerContents.onNewService) self.ServiceManagerContents.onNewService)

View File

@ -103,9 +103,6 @@ class ServiceManager(QtGui.QWidget):
self.droppos = 0 self.droppos = 0
#is a new service and has not been saved #is a new service and has not been saved
self.isNew = True self.isNew = True
#Indicates if remoteTriggering is active. If it is the next addServiceItem call
#will replace the currently selected one.
self.remoteEditTriggered = False
self.serviceNoteForm = ServiceNoteForm() self.serviceNoteForm = ServiceNoteForm()
self.serviceItemEditForm = ServiceItemEditForm() self.serviceItemEditForm = ServiceItemEditForm()
#start with the layout #start with the layout
@ -186,11 +183,7 @@ class ServiceManager(QtGui.QWidget):
QtCore.QObject.connect(self.ServiceManagerList, QtCore.QObject.connect(self.ServiceManagerList,
QtCore.SIGNAL(u'itemExpanded(QTreeWidgetItem*)'), self.expanded) QtCore.SIGNAL(u'itemExpanded(QTreeWidgetItem*)'), self.expanded)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_themes'), self.updateThemeList) QtCore.SIGNAL(u'theme_update_list'), 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)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'servicemanager_next_item'), self.nextItem) QtCore.SIGNAL(u'servicemanager_next_item'), self.nextItem)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
@ -257,9 +250,6 @@ class ServiceManager(QtGui.QWidget):
if action == self.liveAction: if action == self.liveAction:
self.makeLive() self.makeLive()
def onPresentationTypes(self, presentation_types):
self.presentation_types = presentation_types
def onServiceItemNoteForm(self): def onServiceItemNoteForm(self):
item, count = self.findServiceItem() item, count = self.findServiceItem()
self.serviceNoteForm.textEdit.setPlainText( self.serviceNoteForm.textEdit.setPlainText(
@ -643,7 +633,7 @@ class ServiceManager(QtGui.QWidget):
#does not impact the saved song so True may also be valid #does not impact the saved song so True may also be valid
self.parent.serviceChanged(False, self.serviceName) self.parent.serviceChanged(False, self.serviceName)
def addServiceItem(self, item, rebuild=False, expand=True): def addServiceItem(self, item, rebuild=False, expand=True, replace=False):
""" """
Add a Service item to the list Add a Service item to the list
@ -653,10 +643,9 @@ class ServiceManager(QtGui.QWidget):
""" """
sitem, count = self.findServiceItem() sitem, count = self.findServiceItem()
item.render() item.render()
if self.remoteEditTriggered: if replace:
item.merge(self.serviceItems[sitem][u'service_item']) item.merge(self.serviceItems[sitem][u'service_item'])
self.serviceItems[sitem][u'service_item'] = item self.serviceItems[sitem][u'service_item'] = item
self.remoteEditTriggered = False
self.repaintServiceList(sitem + 1, 0) self.repaintServiceList(sitem + 1, 0)
self.parent.LiveController.replaceServiceManagerItem(item) self.parent.LiveController.replaceServiceManagerItem(item)
else: else:
@ -699,8 +688,6 @@ class ServiceManager(QtGui.QWidget):
if item == -1: if item == -1:
return False return False
else: else:
#Switch on remote edit update functionality.
self.remoteEditTriggered = True
return self.serviceItems[item][u'service_item'] return self.serviceItems[item][u'service_item']
def makeLive(self): def makeLive(self):
@ -725,14 +712,10 @@ class ServiceManager(QtGui.QWidget):
item, count = self.findServiceItem() item, count = self.findServiceItem()
if self.serviceItems[item][u'service_item']\ if self.serviceItems[item][u'service_item']\
.is_capable(ItemCapabilities.AllowsEdit): .is_capable(ItemCapabilities.AllowsEdit):
self.remoteEditTriggered = True
Receiver.send_message(u'%s_edit' % Receiver.send_message(u'%s_edit' %
self.serviceItems[item][u'service_item'].name, u'L:%s' % self.serviceItems[item][u'service_item'].name.lower(), u'L:%s' %
self.serviceItems[item][u'service_item'].editId ) self.serviceItems[item][u'service_item'].editId )
def onRemoteEditClear(self):
self.remoteEditTriggered = False
def findServiceItem(self): def findServiceItem(self):
""" """
Finds a ServiceItem in the list Finds a ServiceItem in the list

View File

@ -54,11 +54,12 @@ class SlideList(QtGui.QTableWidget):
def __init__(self, parent=None, name=None): def __init__(self, parent=None, name=None):
QtGui.QTableWidget.__init__(self, parent.Controller) QtGui.QTableWidget.__init__(self, parent.Controller)
self.parent = parent self.parent = parent
self.hotkey_map = {QtCore.Qt.Key_Return: 'servicemanager_next_item', self.hotkey_map = {
QtCore.Qt.Key_Space: 'live_slidecontroller_next_noloop', QtCore.Qt.Key_Return: 'servicemanager_next_item',
QtCore.Qt.Key_Enter: 'live_slidecontroller_next_noloop', QtCore.Qt.Key_Space: 'slidecontroller_live_next_noloop',
QtCore.Qt.Key_0: 'servicemanager_next_item', QtCore.Qt.Key_Enter: 'slidecontroller_live_next_noloop',
QtCore.Qt.Key_Backspace: 'live_slidecontroller_previous_noloop'} QtCore.Qt.Key_0: 'servicemanager_next_item',
QtCore.Qt.Key_Backspace: 'slidecontroller_live_previous_noloop'}
def keyPressEvent(self, event): def keyPressEvent(self, event):
if type(event) == QtGui.QKeyEvent: if type(event) == QtGui.QKeyEvent:
@ -124,11 +125,11 @@ class SlideController(QtGui.QWidget):
if self.isLive: if self.isLive:
self.TypeLabel.setText(self.trUtf8('Live')) self.TypeLabel.setText(self.trUtf8('Live'))
self.split = 1 self.split = 1
prefix = u'live_slidecontroller' self.type_prefix = u'live'
else: else:
self.TypeLabel.setText(self.trUtf8('Preview')) self.TypeLabel.setText(self.trUtf8('Preview'))
self.split = 0 self.split = 0
prefix = u'preview_slidecontroller' self.type_prefix = u'preview'
self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter) self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter)
self.PanelLayout.addWidget(self.TypeLabel) self.PanelLayout.addWidget(self.TypeLabel)
@ -196,7 +197,7 @@ class SlideController(QtGui.QWidget):
u'Hide screen', u':/slides/slide_desktop.png', u'Hide screen', u':/slides/slide_desktop.png',
self.trUtf8('Hide Screen'), self.onHideDisplay, True) self.trUtf8('Hide Screen'), self.onHideDisplay, True)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'live_slide_blank'), self.blankScreen) QtCore.SIGNAL(u'maindisplay_blank'), self.blankScreen)
if not self.isLive: if not self.isLive:
self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
@ -251,13 +252,15 @@ class SlideController(QtGui.QWidget):
self.SongMenu.setText(self.trUtf8('Go to Verse')) self.SongMenu.setText(self.trUtf8('Go to Verse'))
self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup) self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu) self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu)
self.SongMenu.setMenu(QtGui.QMenu(self.trUtf8('Go to Verse'), self.Toolbar)) self.SongMenu.setMenu(QtGui.QMenu(self.trUtf8('Go to Verse'),
self.Toolbar))
self.Toolbar.makeWidgetsInvisible([u'Song Menu']) self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
# Screen preview area # Screen preview area
self.PreviewFrame = QtGui.QFrame(self.Splitter) self.PreviewFrame = QtGui.QFrame(self.Splitter)
self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225)) self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225))
self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy( self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy(
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Label)) QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum,
QtGui.QSizePolicy.Label))
self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel) self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
self.PreviewFrame.setFrameShadow(QtGui.QFrame.Sunken) self.PreviewFrame.setFrameShadow(QtGui.QFrame.Sunken)
self.PreviewFrame.setObjectName(u'PreviewFrame') self.PreviewFrame.setObjectName(u'PreviewFrame')
@ -302,30 +305,38 @@ class SlideController(QtGui.QWidget):
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected) QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected)
if isLive: if isLive:
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay) QtCore.SIGNAL(u'slidecontroller_live_spin_delay'),
Receiver.send_message(u'request_spin_delay') self.receiveSpinDelay)
if isLive: if isLive:
self.Toolbar.makeWidgetsInvisible(self.loop_list) self.Toolbar.makeWidgetsInvisible(self.loop_list)
else: else:
self.Toolbar.makeWidgetsInvisible(self.song_edit_list) self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
self.Mediabar.setVisible(False) self.Mediabar.setVisible(False)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'stop_display_loop'), self.onStopLoop) QtCore.SIGNAL(u'slidecontroller_%s_stop_loop' % self.type_prefix),
self.onStopLoop)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_first' % prefix), self.onSlideSelectedFirst) QtCore.SIGNAL(u'slidecontroller_%s_first' % self.type_prefix),
self.onSlideSelectedFirst)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_next' % prefix), self.onSlideSelectedNext) QtCore.SIGNAL(u'slidecontroller_%s_next' % self.type_prefix),
self.onSlideSelectedNext)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_previous' % prefix), self.onSlideSelectedPrevious) QtCore.SIGNAL(u'slidecontroller_%s_previous' % self.type_prefix),
self.onSlideSelectedPrevious)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_next_noloop' % prefix), self.onSlideSelectedNextNoloop) QtCore.SIGNAL(u'slidecontroller_%s_next_noloop' % self.type_prefix),
self.onSlideSelectedNextNoloop)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_previous_noloop' % prefix), QtCore.SIGNAL(u'slidecontroller_%s_previous_noloop' %
self.type_prefix),
self.onSlideSelectedPreviousNoloop) self.onSlideSelectedPreviousNoloop)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_last' % prefix), self.onSlideSelectedLast) QtCore.SIGNAL(u'slidecontroller_%s_last' % self.type_prefix),
self.onSlideSelectedLast)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_change' % prefix), self.onSlideChange) QtCore.SIGNAL(u'slidecontroller_%s_change' % self.type_prefix),
self.onSlideChange)
QtCore.QObject.connect(self.Splitter, QtCore.QObject.connect(self.Splitter,
QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter) QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
@ -460,20 +471,18 @@ class SlideController(QtGui.QWidget):
Loads a ServiceItem into the system from ServiceManager Loads a ServiceItem into the system from ServiceManager
Display the slide number passed Display the slide number passed
""" """
log.debug(u'processsManagerItem') log.debug(u'processManagerItem')
#If old item was a command tell it to stop #If old item was a command tell it to stop
if self.serviceItem and self.serviceItem.is_command(): if self.serviceItem and self.serviceItem.is_command():
self.onMediaStop() self.onMediaStop()
if serviceItem.is_media(): if serviceItem.is_media():
self.onMediaStart(serviceItem) self.onMediaStart(serviceItem)
elif serviceItem.is_command(): if self.isLive:
if self.isLive: blanked = self.blankButton.isChecked()
blanked = self.blankButton.isChecked() else:
else: blanked = False
blanked = False Receiver.send_message(u'%s_start' % serviceItem.name.lower(),
Receiver.send_message(u'%s_start' % serviceItem.name.lower(), \ [serviceItem, self.isLive, blanked, slideno])
[serviceItem.title, serviceItem.get_frame_path(),
serviceItem.get_frame_title(), slideno, self.isLive, blanked])
self.slideList = {} self.slideList = {}
width = self.parent.ControlSplitter.sizes()[self.split] width = self.parent.ControlSplitter.sizes()[self.split]
#Set pointing cursor when we have somthing to point at #Set pointing cursor when we have somthing to point at
@ -537,7 +546,7 @@ class SlideController(QtGui.QWidget):
self.PreviewListWidget.resizeRowsToContents() self.PreviewListWidget.resizeRowsToContents()
self.PreviewListWidget.setColumnWidth(0, self.labelWidth) self.PreviewListWidget.setColumnWidth(0, self.labelWidth)
self.PreviewListWidget.setColumnWidth(1, self.PreviewListWidget.setColumnWidth(1,
self.PreviewListWidget.viewport().size().width() - self.labelWidth ) self.PreviewListWidget.viewport().size().width() - self.labelWidth)
if slideno > self.PreviewListWidget.rowCount(): if slideno > self.PreviewListWidget.rowCount():
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount())
else: else:
@ -545,9 +554,11 @@ class SlideController(QtGui.QWidget):
self.enableToolBar(serviceItem) self.enableToolBar(serviceItem)
self.onSlideSelected() self.onSlideSelected()
self.PreviewListWidget.setFocus() self.PreviewListWidget.setFocus()
Receiver.send_message(u'%s_%s_started' %
(self.serviceItem.name.lower(),
'live' if self.isLive else 'preview'),
[serviceItem])
log.log(15, u'Display Rendering took %4s' % (time.time() - before)) log.log(15, u'Display Rendering took %4s' % (time.time() - before))
if self.isLive:
self.serviceItem.request_audit()
#Screen event methods #Screen event methods
def onSlideSelectedFirst(self): def onSlideSelectedFirst(self):
@ -556,9 +567,9 @@ class SlideController(QtGui.QWidget):
""" """
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'%s_first' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive])
if self.serviceItem.is_command(): if self.serviceItem.is_command():
Receiver.send_message(u'%s_first'% \
self.serviceItem.name.lower(), self.isLive)
self.updatePreview() self.updatePreview()
else: else:
self.PreviewListWidget.selectRow(0) self.PreviewListWidget.selectRow(0)
@ -573,7 +584,7 @@ class SlideController(QtGui.QWidget):
self.blankButton.setChecked(True) self.blankButton.setChecked(True)
self.blankScreen(HideMode.Blank, self.blankButton.isChecked()) self.blankScreen(HideMode.Blank, self.blankButton.isChecked())
self.parent.generalConfig.set_config(u'screen blank', self.parent.generalConfig.set_config(u'screen blank',
self.blankButton.isChecked()) self.blankButton.isChecked())
def onThemeDisplay(self, force=False): def onThemeDisplay(self, force=False):
""" """
@ -601,13 +612,14 @@ class SlideController(QtGui.QWidget):
Blank the display screen. Blank the display screen.
""" """
if self.serviceItem is not None: if self.serviceItem is not None:
if self.serviceItem.is_command(): if blanked:
if blanked: Receiver.send_message(u'%s_blank' % self.serviceItem.name.lower(),
Receiver.send_message(u'%s_blank'% self.serviceItem.name.lower()) [self.serviceItem, self.isLive])
else:
Receiver.send_message(u'%s_unblank'% self.serviceItem.name.lower())
else: else:
self.parent.mainDisplay.blankDisplay(blankType, blanked) Receiver.send_message(u'%s_unblank'
% self.serviceItem.name.lower(),
[self.serviceItem, self.isLive])
self.parent.mainDisplay.blankDisplay(blankType, blanked)
else: else:
self.parent.mainDisplay.blankDisplay(blankType, blanked) self.parent.mainDisplay.blankDisplay(blankType, blanked)
@ -619,9 +631,9 @@ class SlideController(QtGui.QWidget):
row = self.PreviewListWidget.currentRow() row = self.PreviewListWidget.currentRow()
self.selectedRow = 0 self.selectedRow = 0
if row > -1 and row < self.PreviewListWidget.rowCount(): if row > -1 and row < self.PreviewListWidget.rowCount():
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive, row])
if self.serviceItem.is_command() and self.isLive: if self.serviceItem.is_command() and self.isLive:
Receiver.send_message(u'%s_slide'% \
self.serviceItem.name.lower(), u'%s:%s' % (row, self.isLive))
self.updatePreview() self.updatePreview()
else: else:
before = time.time() before = time.time()
@ -673,9 +685,9 @@ class SlideController(QtGui.QWidget):
""" """
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'%s_next' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive])
if self.serviceItem.is_command(): if self.serviceItem.is_command():
Receiver.send_message(u'%s_next' % \
self.serviceItem.name.lower(), self.isLive)
self.updatePreview() self.updatePreview()
else: else:
row = self.PreviewListWidget.currentRow() + 1 row = self.PreviewListWidget.currentRow() + 1
@ -697,9 +709,9 @@ class SlideController(QtGui.QWidget):
""" """
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'%s_previous' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive])
if self.serviceItem.is_command(): if self.serviceItem.is_command():
Receiver.send_message(
u'%s_previous'% self.serviceItem.name.lower(), self.isLive)
self.updatePreview() self.updatePreview()
else: else:
row = self.PreviewListWidget.currentRow() - 1 row = self.PreviewListWidget.currentRow() - 1
@ -717,9 +729,9 @@ class SlideController(QtGui.QWidget):
""" """
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'%s_last' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive])
if self.serviceItem.is_command(): if self.serviceItem.is_command():
Receiver.send_message(u'%s_last' % \
self.serviceItem.name.lower(), self.isLive)
self.updatePreview() self.updatePreview()
else: else:
self.PreviewListWidget.selectRow( self.PreviewListWidget.selectRow(
@ -749,8 +761,8 @@ class SlideController(QtGui.QWidget):
def onEditSong(self): def onEditSong(self):
self.songEdit = True self.songEdit = True
Receiver.send_message(u'%s_edit' % self.serviceItem.name, u'P:%s' % Receiver.send_message(u'%s_edit' % self.serviceItem.name.lower(),
self.serviceItem.editId ) u'P:%s' % self.serviceItem.editId)
def onGoLive(self): def onGoLive(self):
""" """
@ -763,9 +775,8 @@ class SlideController(QtGui.QWidget):
def onMediaStart(self, item): def onMediaStart(self, item):
if self.isLive: if self.isLive:
Receiver.send_message(u'%s_start' % item.name.lower(), \ Receiver.send_message(u'videodisplay_start',
[item.title, item.get_frame_path(), [item, self.blankButton.isChecked()])
item.get_frame_title(), self.isLive, self.blankButton.isChecked()])
else: else:
self.mediaObject.stop() self.mediaObject.stop()
self.mediaObject.clearQueue() self.mediaObject.clearQueue()
@ -777,13 +788,13 @@ class SlideController(QtGui.QWidget):
def onMediaPause(self): def onMediaPause(self):
if self.isLive: if self.isLive:
Receiver.send_message(u'%s_pause'% self.serviceItem.name.lower()) Receiver.send_message(u'videodisplay_pause')
else: else:
self.mediaObject.pause() self.mediaObject.pause()
def onMediaPlay(self): def onMediaPlay(self):
if self.isLive: if self.isLive:
Receiver.send_message(u'%s_play'% self.serviceItem.name.lower(), self.isLive) Receiver.send_message(u'videodisplay_play')
else: else:
self.SlidePreview.hide() self.SlidePreview.hide()
self.video.show() self.video.show()
@ -791,7 +802,7 @@ class SlideController(QtGui.QWidget):
def onMediaStop(self): def onMediaStop(self):
if self.isLive: if self.isLive:
Receiver.send_message(u'%s_stop'% self.serviceItem.name.lower(), self.isLive) Receiver.send_message(u'videodisplay_stop')
else: else:
self.mediaObject.stop() self.mediaObject.stop()
self.video.hide() self.video.hide()

View File

@ -102,7 +102,7 @@ class ThemeManager(QtGui.QWidget):
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.changeGlobalFromScreen) self.changeGlobalFromScreen)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_global_theme'), self.changeGlobalFromTab) QtCore.SIGNAL(u'theme_update_global'), self.changeGlobalFromTab)
#Variables #Variables
self.themelist = [] self.themelist = []
self.path = os.path.join(ConfigHelper.get_data_path(), u'themes') self.path = os.path.join(ConfigHelper.get_data_path(), u'themes')
@ -147,8 +147,7 @@ class ThemeManager(QtGui.QWidget):
name = u'%s (%s)' % (self.global_theme, self.trUtf8('default')) name = u'%s (%s)' % (self.global_theme, self.trUtf8('default'))
self.ThemeListWidget.item(count).setText(name) self.ThemeListWidget.item(count).setText(name)
self.config.set_config(u'global theme', self.global_theme) self.config.set_config(u'global theme', self.global_theme)
Receiver.send_message( Receiver.send_message(u'theme_update_global', self.global_theme)
u'update_global_theme', self.global_theme)
self.pushThemes() self.pushThemes()
def onAddTheme(self): def onAddTheme(self):
@ -291,7 +290,7 @@ class ThemeManager(QtGui.QWidget):
self.pushThemes() self.pushThemes()
def pushThemes(self): def pushThemes(self):
Receiver.send_message(u'update_themes', self.getThemes() ) Receiver.send_message(u'theme_update_list', self.getThemes() )
def getThemes(self): def getThemes(self):
return self.themelist return self.themelist

View File

@ -103,7 +103,7 @@ class ThemesTab(SettingsTab):
QtCore.QObject.connect(self.DefaultComboBox, QtCore.QObject.connect(self.DefaultComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged) QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_themes'), self.updateThemeList) QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
def retranslateUi(self): def retranslateUi(self):
self.GlobalGroupBox.setTitle(self.trUtf8('Global theme')) self.GlobalGroupBox.setTitle(self.trUtf8('Global theme'))
@ -136,12 +136,12 @@ class ThemesTab(SettingsTab):
def save(self): def save(self):
self.config.set_config(u'theme level', self.theme_level) self.config.set_config(u'theme level', self.theme_level)
self.config.set_config(u'global theme',self.global_theme) self.config.set_config(u'global theme',self.global_theme)
Receiver.send_message(u'update_global_theme', self.global_theme) Receiver.send_message(u'theme_update_global', self.global_theme)
self.parent.RenderManager.set_global_theme( self.parent.RenderManager.set_global_theme(
self.global_theme, self.theme_level) self.global_theme, self.theme_level)
def postSetUp(self): def postSetUp(self):
Receiver.send_message(u'update_global_theme', self.global_theme) Receiver.send_message(u'theme_update_global', self.global_theme)
def onSongLevelButtonPressed(self): def onSongLevelButtonPressed(self):
self.theme_level = ThemeLevel.Song self.theme_level = ThemeLevel.Song
@ -188,4 +188,4 @@ class ThemesTab(SettingsTab):
if not preview.isNull(): if not preview.isNull():
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation) QtCore.Qt.SmoothTransformation)
self.DefaultListView.setPixmap(preview) self.DefaultListView.setPixmap(preview)

View File

@ -88,7 +88,6 @@ class alertsPlugin(Plugin):
def onAlertsTrigger(self): def onAlertsTrigger(self):
self.alertForm.loadList() self.alertForm.loadList()
self.alertForm.exec_() self.alertForm.exec_()
Receiver.send_message(u'text_onTop')
def about(self): def about(self):
about_text = self.trUtf8('<b>Alerts Plugin</b><br>This plugin ' about_text = self.trUtf8('<b>Alerts Plugin</b><br>This plugin '

View File

@ -44,13 +44,11 @@ class AlertsManager(QtCore.QObject):
self.timer_id = 0 self.timer_id = 0
self.alertList = [] self.alertList = []
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'flush_alert'), self.generateAlert) QtCore.SIGNAL(u'maindisplay_active'), self.generateAlert)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'alert_text'), self.displayAlert) QtCore.SIGNAL(u'alerts_text'), self.displayAlert)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'screen_changed'), self.screenChanged) QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_updated'), self.screenChanged)
def screenChanged(self): def screenChanged(self):
log.debug(u'screen changed') log.debug(u'screen changed')
@ -84,10 +82,10 @@ class AlertsManager(QtCore.QObject):
self.screenChanged() self.screenChanged()
self.alertList.append(text) self.alertList.append(text)
if self.timer_id != 0: if self.timer_id != 0:
Receiver.send_message(u'status_message', Receiver.send_message(u'maindisplay_status_text',
self.trUtf8(u'Alert message created and delayed')) self.trUtf8(u'Alert message created and delayed'))
return return
Receiver.send_message(u'status_message', u'') Receiver.send_message(u'maindisplay_status_text', u'')
self.generateAlert() self.generateAlert()
def generateAlert(self): def generateAlert(self):

View File

@ -240,7 +240,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
""" """
log.debug('Cancel button pressed!') log.debug('Cancel button pressed!')
if self.currentId() == 3: if self.currentId() == 3:
Receiver.send_message(u'openlpstopimport') Receiver.send_message(u'bibles_stop_import')
def onCurrentIdChanged(self, id): def onCurrentIdChanged(self, id):
if id == 3: if id == 3:
@ -354,7 +354,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
log.debug(u'IncrementBar %s', status_text) log.debug(u'IncrementBar %s', status_text)
self.ImportProgressLabel.setText(status_text) self.ImportProgressLabel.setText(status_text)
self.ImportProgressBar.setValue(self.ImportProgressBar.value() + 1) self.ImportProgressBar.setValue(self.ImportProgressBar.value() + 1)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
def preImport(self): def preImport(self):
self.finishButton.setVisible(False) self.finishButton.setVisible(False)
@ -362,7 +362,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setMaximum(1188)
self.ImportProgressBar.setValue(0) self.ImportProgressBar.setValue(0)
self.ImportProgressLabel.setText(self.trUtf8('Starting import...')) self.ImportProgressLabel.setText(self.trUtf8('Starting import...'))
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
def performImport(self): def performImport(self):
bible_type = self.field(u'source_format').toInt()[0] bible_type = self.field(u'source_format').toInt()[0]
@ -424,4 +424,4 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
self.ImportProgressBar.setValue(self.ImportProgressBar.maximum()) self.ImportProgressBar.setValue(self.ImportProgressBar.maximum())
self.finishButton.setVisible(True) self.finishButton.setVisible(True)
self.cancelButton.setVisible(False) self.cancelButton.setVisible(False)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')

View File

@ -146,7 +146,7 @@ class BiblesTab(SettingsTab):
self.BibleDualCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.BibleDualCheckBox, QtCore.SIGNAL(u'stateChanged(int)'),
self.onBibleDualCheckBox) self.onBibleDualCheckBox)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_themes'), self.updateThemeList) QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
def retranslateUi(self): def retranslateUi(self):
self.VerseDisplayGroupBox.setTitle(self.trUtf8('Verse Display')) self.VerseDisplayGroupBox.setTitle(self.trUtf8('Verse Display'))
@ -225,4 +225,4 @@ class BiblesTab(SettingsTab):
# Not Found # Not Found
id = 0 id = 0
self.bible_theme = u'' self.bible_theme = u''
self.BibleThemeComboBox.setCurrentIndex(id) self.BibleThemeComboBox.setCurrentIndex(id)

View File

@ -52,7 +52,7 @@ class CSVBible(BibleDB):
raise KeyError(u'You have to supply a file to import verses from.') raise KeyError(u'You have to supply a file to import verses from.')
self.versesfile = kwargs[u'versesfile'] self.versesfile = kwargs[u'versesfile']
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) QtCore.SIGNAL(u'bibles_stop_import'), self.stop_import)
def stop_import(self): def stop_import(self):
""" """
@ -77,7 +77,7 @@ class CSVBible(BibleDB):
details = chardet.detect(line[1]) details = chardet.detect(line[1])
self.create_book(unicode(line[1], details['encoding']), self.create_book(unicode(line[1], details['encoding']),
line[2], int(line[0])) line[2], int(line[0]))
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
except: except:
log.exception(u'Loading books from file failed') log.exception(u'Loading books from file failed')
success = False success = False
@ -105,7 +105,7 @@ class CSVBible(BibleDB):
self.commit() self.commit()
self.create_verse(book.id, line[1], line[2], self.create_verse(book.id, line[1], line[2],
unicode(line[3], details['encoding'])) unicode(line[3], details['encoding']))
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
self.commit() self.commit()
except: except:
log.exception(u'Loading verses from file failed') log.exception(u'Loading verses from file failed')
@ -118,4 +118,3 @@ class CSVBible(BibleDB):
return False return False
else: else:
return success return success

View File

@ -203,9 +203,9 @@ class BGExtract(BibleCommon):
# Let's get the page, and then open it in BeautifulSoup, so as to # Let's get the page, and then open it in BeautifulSoup, so as to
# attempt to make "easy" work of bad HTML. # attempt to make "easy" work of bad HTML.
page = urllib2.urlopen(urlstring) page = urllib2.urlopen(urlstring)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
soup = BeautifulSoup(page) soup = BeautifulSoup(page)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
verses = soup.find(u'div', u'result-text-style-normal') verses = soup.find(u'div', u'result-text-style-normal')
verse_number = 0 verse_number = 0
verse_list = {0: u''} verse_list = {0: u''}
@ -213,7 +213,7 @@ class BGExtract(BibleCommon):
# This is a PERFECT example of opening the Cthulu tag! # This is a PERFECT example of opening the Cthulu tag!
# O Bible Gateway, why doth ye such horrific HTML produce? # O Bible Gateway, why doth ye such horrific HTML produce?
for verse in verses: for verse in verses:
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
if isinstance(verse, Tag) and verse.name == u'div' and filter(lambda a: a[0] == u'class', verse.attrs)[0][1] == u'footnotes': if isinstance(verse, Tag) and verse.name == u'div' and filter(lambda a: a[0] == u'class', verse.attrs)[0][1] == u'footnotes':
break break
if isinstance(verse, Tag) and verse.name == u'sup' and filter(lambda a: a[0] == u'class', verse.attrs)[0][1] != u'versenum': if isinstance(verse, Tag) and verse.name == u'sup' and filter(lambda a: a[0] == u'class', verse.attrs)[0][1] != u'versenum':
@ -222,7 +222,7 @@ class BGExtract(BibleCommon):
continue continue
if isinstance(verse, Tag) and (verse.name == u'p' or verse.name == u'font') and verse.contents: if isinstance(verse, Tag) and (verse.name == u'p' or verse.name == u'font') and verse.contents:
for item in verse.contents: for item in verse.contents:
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
if isinstance(item, Tag) and (item.name == u'h4' or item.name == u'h5'): if isinstance(item, Tag) and (item.name == u'h4' or item.name == u'h5'):
continue continue
if isinstance(item, Tag) and item.name == u'sup' and filter(lambda a: a[0] == u'class', item.attrs)[0][1] != u'versenum': if isinstance(item, Tag) and item.name == u'sup' and filter(lambda a: a[0] == u'class', item.attrs)[0][1] != u'versenum':
@ -235,7 +235,7 @@ class BGExtract(BibleCommon):
continue continue
if isinstance(item, Tag) and item.name == u'font': if isinstance(item, Tag) and item.name == u'font':
for subitem in item.contents: for subitem in item.contents:
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
if isinstance(subitem, Tag) and subitem.name == u'sup' and filter(lambda a: a[0] == u'class', subitem.attrs)[0][1] != u'versenum': if isinstance(subitem, Tag) and subitem.name == u'sup' and filter(lambda a: a[0] == u'class', subitem.attrs)[0][1] != u'versenum':
continue continue
if isinstance(subitem, Tag) and subitem.name == u'p' and not subitem.contents: if isinstance(subitem, Tag) and subitem.name == u'p' and not subitem.contents:
@ -294,37 +294,37 @@ class CWExtract(BibleCommon):
(version, urlbookname.lower(), chapter) (version, urlbookname.lower(), chapter)
log.debug(u'URL: %s', chapter_url) log.debug(u'URL: %s', chapter_url)
page = urllib2.urlopen(chapter_url) page = urllib2.urlopen(chapter_url)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
if not page: if not page:
return None return None
soup = BeautifulSoup(page) soup = BeautifulSoup(page)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
htmlverses = soup.findAll(u'span', u'versetext') htmlverses = soup.findAll(u'span', u'versetext')
verses = {} verses = {}
reduce_spaces = re.compile(r'[ ]{2,}') reduce_spaces = re.compile(r'[ ]{2,}')
fix_punctuation = re.compile(r'[ ]+([.,;])') fix_punctuation = re.compile(r'[ ]+([.,;])')
for verse in htmlverses: for verse in htmlverses:
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
versenumber = int(verse.contents[0].contents[0]) versenumber = int(verse.contents[0].contents[0])
versetext = u'' versetext = u''
for part in verse.contents: for part in verse.contents:
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
if isinstance(part, NavigableString): if isinstance(part, NavigableString):
versetext = versetext + part versetext = versetext + part
elif part and part.attrMap and \ elif part and part.attrMap and \
(part.attrMap[u'class'] == u'WordsOfChrist' or \ (part.attrMap[u'class'] == u'WordsOfChrist' or \
part.attrMap[u'class'] == u'strongs'): part.attrMap[u'class'] == u'strongs'):
for subpart in part.contents: for subpart in part.contents:
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
if isinstance(subpart, NavigableString): if isinstance(subpart, NavigableString):
versetext = versetext + subpart versetext = versetext + subpart
elif subpart and subpart.attrMap and \ elif subpart and subpart.attrMap and \
subpart.attrMap[u'class'] == u'strongs': subpart.attrMap[u'class'] == u'strongs':
for subsub in subpart.contents: for subsub in subpart.contents:
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
if isinstance(subsub, NavigableString): if isinstance(subsub, NavigableString):
versetext = versetext + subsub versetext = versetext + subsub
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
# Fix up leading and trailing spaces, multiple spaces, and spaces # Fix up leading and trailing spaces, multiple spaces, and spaces
# between text and , and . # between text and , and .
versetext = versetext.strip(u'\n\r\t ') versetext = versetext.strip(u'\n\r\t ')
@ -415,14 +415,14 @@ class HTTPBible(BibleDB):
if not db_book: if not db_book:
book_details = self.lookup_book(book) book_details = self.lookup_book(book)
if not book_details: if not book_details:
Receiver.send_message(u'bible_nobook') Receiver.send_message(u'bibles_nobook')
return [] return []
db_book = self.create_book(book_details[u'name'], db_book = self.create_book(book_details[u'name'],
book_details[u'abbreviation'], book_details[u'testament_id']) book_details[u'abbreviation'], book_details[u'testament_id'])
book = db_book.name book = db_book.name
if BibleDB.get_verse_count(self, book, reference[1]) == 0: if BibleDB.get_verse_count(self, book, reference[1]) == 0:
Receiver.send_message(u'bible_showprogress') Receiver.send_message(u'bibles_showprogress')
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
search_results = self.get_chapter(self.name, book, reference[1]) search_results = self.get_chapter(self.name, book, reference[1])
if search_results and search_results.has_verselist(): if search_results and search_results.has_verselist():
## We have found a book of the bible lets check to see ## We have found a book of the bible lets check to see
@ -430,14 +430,14 @@ class HTTPBible(BibleDB):
## we get a correct book. For example it is possible ## we get a correct book. For example it is possible
## to request ac and get Acts back. ## to request ac and get Acts back.
bookname = search_results.get_book() bookname = search_results.get_book()
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
# check to see if book/chapter exists # check to see if book/chapter exists
db_book = self.get_book(bookname) db_book = self.get_book(bookname)
self.create_chapter(db_book.id, search_results.get_chapter(), self.create_chapter(db_book.id, search_results.get_chapter(),
search_results.get_verselist()) search_results.get_verselist())
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
Receiver.send_message(u'bible_hideprogress') Receiver.send_message(u'bibles_hideprogress')
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
return BibleDB.get_verses(self, reference_list) return BibleDB.get_verses(self, reference_list)
def get_chapter(self, version, book, chapter): def get_chapter(self, version, book, chapter):
@ -496,4 +496,3 @@ class HTTPBible(BibleDB):
The hostname or IP address of the proxy server. The hostname or IP address of the proxy server.
""" """
self.proxy_server = server self.proxy_server = server

View File

@ -63,7 +63,7 @@ class BibleMediaItem(MediaManagerItem):
# place to store the search results # place to store the search results
self.search_results = {} self.search_results = {}
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlpreloadbibles'), self.reloadBibles) QtCore.SIGNAL(u'bibles_load_list'), self.reloadBibles)
def _decodeQtObject(self, listobj, key): def _decodeQtObject(self, listobj, key):
obj = listobj[QtCore.QString(key)] obj = listobj[QtCore.QString(key)]
@ -257,11 +257,11 @@ class BibleMediaItem(MediaManagerItem):
QtCore.QObject.connect(self.QuickSearchEdit, QtCore.QObject.connect(self.QuickSearchEdit,
QtCore.SIGNAL(u'returnPressed()'), self.onQuickSearchButton) QtCore.SIGNAL(u'returnPressed()'), self.onQuickSearchButton)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'bible_showprogress'), self.onSearchProgressShow) QtCore.SIGNAL(u'bibles_showprogress'), self.onSearchProgressShow)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'bible_hideprogress'), self.onSearchProgressHide) QtCore.SIGNAL(u'bibles_hideprogress'), self.onSearchProgressHide)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'bible_nobook'), self.onNoBookFound) QtCore.SIGNAL(u'bibles_nobook'), self.onNoBookFound)
def addListViewToToolBar(self): def addListViewToToolBar(self):
MediaManagerItem.addListViewToToolBar(self) MediaManagerItem.addListViewToToolBar(self)
@ -322,7 +322,7 @@ class BibleMediaItem(MediaManagerItem):
def setQuickMessage(self, text): def setQuickMessage(self, text):
self.QuickMessage.setText(text) self.QuickMessage.setText(text)
self.AdvancedMessage.setText(text) self.AdvancedMessage.setText(text)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
#minor delay to get the events processed #minor delay to get the events processed
time.sleep(0.1) time.sleep(0.1)
@ -353,7 +353,7 @@ class BibleMediaItem(MediaManagerItem):
def onSearchProgressShow(self): def onSearchProgressShow(self):
self.SearchProgress.setVisible(True) self.SearchProgress.setVisible(True)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
#self.SearchProgress.setMinimum(0) #self.SearchProgress.setMinimum(0)
#self.SearchProgress.setMaximum(2) #self.SearchProgress.setMaximum(2)
#self.SearchProgress.setValue(1) #self.SearchProgress.setValue(1)

View File

@ -49,7 +49,7 @@ class OpenSongBible(BibleDB):
raise KeyError(u'You have to supply a file name to import from.') raise KeyError(u'You have to supply a file name to import from.')
self.filename = kwargs['filename'] self.filename = kwargs['filename']
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) QtCore.SIGNAL(u'bibles_stop_import'), self.stop_import)
def stop_import(self): def stop_import(self):
""" """
@ -92,7 +92,7 @@ class OpenSongBible(BibleDB):
int(verse.attrib[u'n']), int(verse.attrib[u'n']),
unicode(verse.text) unicode(verse.text)
) )
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
self.wizard.incrementProgressBar( self.wizard.incrementProgressBar(
QtCore.QString('%s %s %s' % (self.trUtf8('Importing'),\ QtCore.QString('%s %s %s' % (self.trUtf8('Importing'),\
db_book.name, chapter.attrib[u'n']))) db_book.name, chapter.attrib[u'n'])))

View File

@ -84,7 +84,7 @@ class OSISBible(BibleDB):
if fbibles: if fbibles:
fbibles.close() fbibles.close()
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) QtCore.SIGNAL(u'bibles_stop_import'), self.stop_import)
def stop_import(self): def stop_import(self):
""" """
@ -167,7 +167,7 @@ class OSISBible(BibleDB):
.replace(u'</div>', u'').replace(u'</w>', u'') .replace(u'</div>', u'').replace(u'</w>', u'')
verse_text = self.spaces_regex.sub(u' ', verse_text) verse_text = self.spaces_regex.sub(u' ', verse_text)
self.create_verse(db_book.id, chapter, verse, verse_text) self.create_verse(db_book.id, chapter, verse, verse_text)
Receiver.send_message(u'process_events') Receiver.send_message(u'openlp_process_events')
self.commit() self.commit()
self.wizard.incrementProgressBar(u'Finishing import...') self.wizard.incrementProgressBar(u'Finishing import...')
if match_count == 0: if match_count == 0:

View File

@ -77,7 +77,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'),
self.onVerseListViewPressed) self.onVerseListViewPressed)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_themes'), self.loadThemes) QtCore.SIGNAL(u'theme_update_list'), self.loadThemes)
# Create other objects and forms # Create other objects and forms
self.custommanager = custommanager self.custommanager = custommanager
self.initialise() self.initialise()
@ -86,7 +86,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
log.debug(u'onPreview') log.debug(u'onPreview')
if button.text() == unicode(self.trUtf8('Save && Preview')) \ if button.text() == unicode(self.trUtf8('Save && Preview')) \
and self.saveCustom(): and self.saveCustom():
Receiver.send_message(u'preview_custom') Receiver.send_message(u'custom_preview')
def initialise(self): def initialise(self):
self.editAll = False self.editAll = False
@ -135,13 +135,13 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
self.previewButton.setVisible(True) self.previewButton.setVisible(True)
def closePressed(self): def closePressed(self):
Receiver.send_message(u'remote_edit_clear') Receiver.send_message(u'custom_edit_clear')
self.close() self.close()
def accept(self): def accept(self):
log.debug(u'accept') log.debug(u'accept')
if self.saveCustom(): if self.saveCustom():
Receiver.send_message(u'load_custom_list') Receiver.send_message(u'custom_load_list')
self.close() self.close()
def saveCustom(self): def saveCustom(self):

View File

@ -58,13 +58,13 @@ class CustomMediaItem(MediaManagerItem):
def addEndHeaderBar(self): def addEndHeaderBar(self):
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_edit' % self.parent.name), self.onRemoteEdit) QtCore.SIGNAL(u'custom_edit'), self.onRemoteEdit)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'remote_edit_clear' ), self.onRemoteEditClear) QtCore.SIGNAL(u'custom_edit_clear' ), self.onRemoteEditClear)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'load_custom_list'), self.initialise) QtCore.SIGNAL(u'custom_load_list'), self.initialise)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'preview_custom'), self.onPreviewClick) QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick)
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8('Custom') self.PluginNameVisible = self.trUtf8('Custom')

View File

@ -76,7 +76,9 @@ class ImageTab(SettingsTab):
def save(self): def save(self):
self.config.set_config(u'loop delay', self.loop_delay) self.config.set_config(u'loop delay', self.loop_delay)
Receiver.send_message(u'update_spin_delay', self.loop_delay) Receiver.send_message(u'slidecontroller_live_spin_delay',
self.loop_delay)
def postSetUp(self): def postSetUp(self):
Receiver.send_message(u'update_spin_delay', self.loop_delay) Receiver.send_message(u'slidecontroller_live_spin_delay',
self.loop_delay)

View File

@ -55,7 +55,7 @@ class Controller(object):
self.doc.start_presentation() self.doc.start_presentation()
if isBlank: if isBlank:
self.blank() self.blank()
Receiver.send_message(u'live_slide_hide') Receiver.send_message(u'maindisplay_hide')
self.doc.slidenumber = 0 self.doc.slidenumber = 0
def activate(self): def activate(self):
@ -144,7 +144,7 @@ class Controller(object):
""" """
log.debug(u'Live = %s, shutdown' % self.isLive) log.debug(u'Live = %s, shutdown' % self.isLive)
if self.isLive: if self.isLive:
Receiver.send_message(u'live_slide_show') Receiver.send_message(u'maindisplay_show')
self.doc.close_presentation() self.doc.close_presentation()
self.doc = None self.doc = None
#self.doc.slidenumber = 0 #self.doc.slidenumber = 0
@ -186,23 +186,23 @@ class MessageListener(object):
self.liveHandler = Controller(True) self.liveHandler = Controller(True)
# messages are sent from core.ui.slidecontroller # messages are sent from core.ui.slidecontroller
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_start'), self.startup) QtCore.SIGNAL(u'presentation_start'), self.startup)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_stop'), self.shutdown) QtCore.SIGNAL(u'presentation_stop'), self.shutdown)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_first'), self.first) QtCore.SIGNAL(u'presentation_first'), self.first)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_previous'), self.previous) QtCore.SIGNAL(u'presentation_previous'), self.previous)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_next'), self.next) QtCore.SIGNAL(u'presentation_next'), self.next)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_last'), self.last) QtCore.SIGNAL(u'presentation_last'), self.last)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_slide'), self.slide) QtCore.SIGNAL(u'presentation_slide'), self.slide)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_blank'), self.blank) QtCore.SIGNAL(u'presentation_blank'), self.blank)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_unblank'), self.unblank) QtCore.SIGNAL(u'presentation_unblank'), self.unblank)
self.timer = QtCore.QTimer() self.timer = QtCore.QTimer()
self.timer.setInterval(500) self.timer.setInterval(500)
QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.timeout) QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.timeout)
@ -212,84 +212,78 @@ class MessageListener(object):
Start of new presentation Start of new presentation
Save the handler as any new presentations start here Save the handler as any new presentations start here
""" """
isLive, item = self.decode_message(message)
log.debug(u'Startup called with message %s' % message) log.debug(u'Startup called with message %s' % message)
self.handler, file, isLive, isBlank = self.decodeMessage(message) isBlank = message[2]
file = os.path.join(item.get_frame_path(),
item.get_frame_title())
self.handler = item.title
if self.handler == self.mediaitem.Automatic: if self.handler == self.mediaitem.Automatic:
self.handler = self.mediaitem.findControllerByType(file) self.handler = self.mediaitem.findControllerByType(file)
if not self.handler: if not self.handler:
return return
if isLive: if isLive:
controller = self.liveHandler controller = self.liveHandler
else: else:
controller = self.previewHandler controller = self.previewHandler
controller.addHandler(self.controllers[self.handler], file, isBlank) controller.addHandler(self.controllers[self.handler], file, isBlank)
def decode_message(self, message):
return message[1], message[0]
def slide(self, message): def slide(self, message):
slide, live = self.splitMessage(message) isLive, item = self.decode_message(message)
if live: if isLive:
self.liveHandler.slide(slide, live) self.liveHandler.slide(slide, live)
else: else:
self.previewHandler.slide(slide, live) self.previewHandler.slide(slide, live)
def first(self, isLive): def first(self, message):
isLive, item = self.decode_message(message)
if isLive: if isLive:
self.liveHandler.first() self.liveHandler.first()
else: else:
self.previewHandler.first() self.previewHandler.first()
def last(self, isLive): def last(self, message):
isLive, item = self.decode_message(message)
if isLive: if isLive:
self.liveHandler.last() self.liveHandler.last()
else: else:
self.previewHandler.last() self.previewHandler.last()
def next(self, isLive): def next(self, message):
isLive, item = self.decode_message(message)
if isLive: if isLive:
self.liveHandler.next() self.liveHandler.next()
else: else:
self.previewHandler.next() self.previewHandler.next()
def previous(self, isLive): def previous(self, message):
isLive, item = self.decode_message(message)
if isLive: if isLive:
self.liveHandler.previous() self.liveHandler.previous()
else: else:
self.previewHandler.previous() self.previewHandler.previous()
def shutdown(self, isLive): def shutdown(self, message):
isLive, item = self.decode_message(message)
if isLive: if isLive:
Receiver.send_message(u'maindisplay_show')
self.liveHandler.shutdown() self.liveHandler.shutdown()
Receiver.send_message(u'live_slide_show')
else: else:
self.previewHandler.shutdown() self.previewHandler.shutdown()
def blank(self): def blank(self, message):
self.liveHandler.blank() isLive, item = self.decode_message(message)
if isLive:
def unblank(self): self.liveHandler.blank()
self.liveHandler.unblank()
def splitMessage(self, message):
"""
Splits the selection messages
into it's component parts
``message``
Message containing Presentaion handler name and file to be presented.
"""
bits = message.split(u':')
return bits[0], bits[1]
def decodeMessage(self, message):
"""
Splits the initial message from the SlideController
into it's component parts
``message``
Message containing Presentaion handler name and file to be presented.
"""
file = os.path.join(message[1], message[2])
return message[0], file, message[4], message[5]
def unblank(self, message):
isLive, item = self.decode_message(message)
if isLive:
self.liveHandler.unblank()
def timeout(self): def timeout(self):
self.liveHandler.poll() self.liveHandler.poll()

View File

@ -361,7 +361,7 @@ class PresentationDocument(object):
prefix = u'live' prefix = u'live'
else: else:
prefix = u'preview' prefix = u'preview'
Receiver.send_message(u'%s_slidecontroller_change' % prefix, Receiver.send_message(u'slidecontroller_%s_change' % prefix,
self.slidenumber - 1) self.slidenumber - 1)
def get_slide_text(self, slide_no): def get_slide_text(self, slide_no):

View File

@ -53,13 +53,9 @@ class PresentationPlugin(Plugin):
log.info(u'Presentations Initialising') log.info(u'Presentations Initialising')
Plugin.initialise(self) Plugin.initialise(self)
self.insert_toolbox_item() self.insert_toolbox_item()
presentation_types = []
for controller in self.controllers: for controller in self.controllers:
if self.controllers[controller].enabled: if self.controllers[controller].enabled:
presentation_types.append({u'%s' % controller : self.controllers[controller].supports})
self.controllers[controller].start_process() self.controllers[controller].start_process()
Receiver.send_message(
u'presentation types', presentation_types)
def finalise(self): def finalise(self):
log.info(u'Plugin Finalise') log.info(u'Plugin Finalise')

View File

@ -73,10 +73,12 @@ class RemotesPlugin(Plugin):
pos = datagram.find(u':') pos = datagram.find(u':')
event = unicode(datagram[:pos].lower()) event = unicode(datagram[:pos].lower())
if event == u'alert': if event == u'alert':
Receiver.send_message(u'alert_text', unicode(datagram[pos + 1:])) Receiver.send_message(u'alerts_text', unicode(datagram[pos + 1:]))
if event == u'next_slide': elif event == u'next_slide':
Receiver.send_message(u'live_slide_next') Receiver.send_message(u'slidecontroller_live_next')
else:
Receiver.send_message(event, unicode(datagram[pos + 1:]))
def about(self): def about(self):
about_text = self.trUtf8('<b>Remote Plugin</b><br>This plugin ' about_text = self.trUtf8('<b>Remote Plugin</b><br>This plugin '
'provides the ability to send messages to a running version of ' 'provides the ability to send messages to a running version of '

View File

@ -93,7 +93,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.QObject.connect(self.CCLNumberEdit, QtCore.QObject.connect(self.CCLNumberEdit,
QtCore.SIGNAL(u'lostFocus()'), self.onCCLNumberEditLostFocus) QtCore.SIGNAL(u'lostFocus()'), self.onCCLNumberEditLostFocus)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_themes'), self.loadThemes) QtCore.SIGNAL(u'theme_update_list'), self.loadThemes)
QtCore.QObject.connect(self.CommentsEdit, QtCore.QObject.connect(self.CommentsEdit,
QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus) QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus)
QtCore.QObject.connect(self.VerseOrderEdit, QtCore.QObject.connect(self.VerseOrderEdit,
@ -484,16 +484,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
log.debug(u'onPreview') log.debug(u'onPreview')
if button.text() == unicode(self.trUtf8('Save && Preview')) \ if button.text() == unicode(self.trUtf8('Save && Preview')) \
and self.saveSong(): and self.saveSong():
Receiver.send_message(u'preview_song') Receiver.send_message(u'songs_preview')
def closePressed(self): def closePressed(self):
Receiver.send_message(u'remote_edit_clear') Receiver.send_message(u'songs_edit_clear')
self.close() self.close()
def accept(self): def accept(self):
log.debug(u'accept') log.debug(u'accept')
if self.saveSong(): if self.saveSong():
Receiver.send_message(u'load_song_list') Receiver.send_message(u'songs_load_list')
self.close() self.close()
def saveSong(self): def saveSong(self):

View File

@ -122,15 +122,15 @@ class SongMediaItem(MediaManagerItem):
QtCore.SIGNAL(u'textChanged(const QString&)'), QtCore.SIGNAL(u'textChanged(const QString&)'),
self.onSearchTextEditChanged) self.onSearchTextEditChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'load_song_list'), self.onSearchTextButtonClick) QtCore.SIGNAL(u'songs_load_list'), self.onSearchTextButtonClick)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_updated'), self.configUpdated) QtCore.SIGNAL(u'config_updated'), self.configUpdated)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'preview_song'), self.onPreviewClick) QtCore.SIGNAL(u'songs_preview'), self.onPreviewClick)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_edit' % self.parent.name), self.onRemoteEdit) QtCore.SIGNAL(u'songs_edit'), self.onRemoteEdit)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'remote_edit_clear'), self.onRemoteEditClear) QtCore.SIGNAL(u'songs_edit_clear'), self.onRemoteEditClear)
def configUpdated(self): def configUpdated(self):
self.searchAsYouType = str_to_bool( self.searchAsYouType = str_to_bool(

View File

@ -212,7 +212,7 @@ class SongsPlugin(Plugin):
+ ' included with the Songs of Fellowship Music Editions'), + ' included with the Songs of Fellowship Music Editions'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
Receiver.send_message(u'load_song_list') Receiver.send_message(u'songs_load_list')
def onImportOooItemClick(self): def onImportOooItemClick(self):
filenames = QtGui.QFileDialog.getOpenFileNames( filenames = QtGui.QFileDialog.getOpenFileNames(
@ -220,7 +220,7 @@ class SongsPlugin(Plugin):
u'', u'All Files(*.*)') u'', u'All Files(*.*)')
oooimport = OooImport(self.songmanager) oooimport = OooImport(self.songmanager)
oooimport.import_docs(filenames) oooimport.import_docs(filenames)
Receiver.send_message(u'load_song_list') Receiver.send_message(u'songs_load_list')
def onExportOpenlp1ItemClicked(self): def onExportOpenlp1ItemClicked(self):
self.openlp_export_form.show() self.openlp_export_form.show()

View File

@ -107,7 +107,7 @@ class SongUsagePlugin(Plugin):
log.info(u'SongUsage Initialising') log.info(u'SongUsage Initialising')
Plugin.initialise(self) Plugin.initialise(self)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'songusage_live'), self.onReceiveSongUsage) QtCore.SIGNAL(u'slidecontroller_live_started'), self.onReceiveSongUsage)
self.SongUsageActive = str_to_bool( self.SongUsageActive = str_to_bool(
self.config.get_config(u'active', False)) self.config.get_config(u'active', False))
self.SongUsageStatus.setChecked(self.SongUsageActive) self.SongUsageStatus.setChecked(self.SongUsageActive)
@ -127,21 +127,22 @@ class SongUsagePlugin(Plugin):
self.SongUsageActive = not self.SongUsageActive self.SongUsageActive = not self.SongUsageActive
self.config.set_config(u'active', self.SongUsageActive) self.config.set_config(u'active', self.SongUsageActive)
def onReceiveSongUsage(self, SongUsageData): def onReceiveSongUsage(self, items):
""" """
SongUsage a live song from SlideController SongUsage a live song from SlideController
""" """
if self.SongUsageActive: audit = items[0].audit
SongUsageitem = SongUsageItem() if self.SongUsageActive and audit:
SongUsageitem.usagedate = datetime.today() song_usage_item = SongUsageItem()
SongUsageitem.usagetime = datetime.now().time() song_usage_item.usagedate = datetime.today()
SongUsageitem.title = SongUsageData[0] song_usage_item.usagetime = datetime.now().time()
SongUsageitem.copyright = SongUsageData[2] song_usage_item.title = audit[0]
SongUsageitem.ccl_number = SongUsageData[3] song_usage_item.copyright = audit[2]
SongUsageitem.authors = u'' song_usage_item.ccl_number = audit[3]
for author in SongUsageData[1]: song_usage_item.authors = u''
SongUsageitem.authors += author + u' ' for author in audit[1]:
self.songusagemanager.insert_songusage(SongUsageitem) song_usage_item.authors += author + u' '
self.songusagemanager.insert_songusage(song_usage_item)
def onSongUsageDelete(self): def onSongUsageDelete(self):
self.SongUsagedeleteform.exec_() self.SongUsagedeleteform.exec_()