diff --git a/openlp.pyw b/openlp.pyw index 85de9fe79..61dd75d36 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -112,7 +112,7 @@ class OpenLP(QtGui.QApplication): fversion.close() #provide a listener for widgets to reqest a screen update. QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'process_events'), self.processEvents) + QtCore.SIGNAL(u'openlp_process_events'), self.processEvents) self.setOrganizationName(u'OpenLP') self.setOrganizationDomain(u'openlp.org') self.setApplicationName(u'OpenLP') @@ -196,4 +196,4 @@ if __name__ == u'__main__': """ Instantiate and run the application. """ - main() + main() \ No newline at end of file diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 2e1cf9d39..6443a4795 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -35,36 +35,87 @@ class EventReceiver(QtCore.QObject): system. This is a private class and should not be used directly but rather via the Receiver class. - ``stop_import`` - Stops the Bible Import - - ``pre_load_bibles`` - Triggers the plugin to relaod the bible lists - - ``process_events`` + ``openlp_process_events`` Requests the Application to flush the events queue - ``{plugin}_add_service_item`` - ask the plugin to push the selected items to the service item + ``openlp_version_check`` + 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 - ``update_global_theme`` + ``theme_update_global`` 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`` Requests a plugin to start a external program Path and file provided in message @@ -81,42 +132,47 @@ class EventReceiver(QtCore.QObject): ``{plugin}_last`` Requests a plugin to handle a last event + ``{plugin}_slide`` + Requests a plugin to handle a go to specific slide event + ``{plugin}_stop`` 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`` Requests a plugin edit a database item with the key as the payload - ``songusage_live`` - Sends live song audit requests to the audit component + ``{plugin}_edit_clear`` + Editing has been completed - ``audit_changed`` - Audit information may have changed + ``{plugin}_load_list`` + Tells the the plugin to reload the media manager list - ``config_updated`` - Informs components the config has changed + ``{plugin}_preview`` + Tells the plugin it's item can be previewed - ``preview_song`` - Tells the song plugin the edit has finished and the song can be previewed - Only available if the edit was triggered by the Preview button. + ``{plugin}_add_service_item`` + Ask the plugin to push the selected items to the service item - ``slidecontroller_change`` - Informs the slidecontroller that a slide change has occurred + ``alerts_text`` + Displays an alert message + + ``bibles_nobook`` + Attempt to find book resulted in no match - ``remote_edit_clear`` - Informs all components that remote edit has been aborted. + ``bibles_showprogress`` + Show progress of bible verse import - ``presentation types`` - Informs all components of the presentation types supported. + ``bibles_hideprogress`` + Hide progress of bible verse import - ``blank_check`` - Check to see if th eblank display message is required - - ``version_check`` - Version has changed so pop up window. - - ``mainDisplay_active`` - Version has changed so pop up window. + ``bibles_stop_import`` + Stops the Bible Import """ def __init__(self): @@ -173,4 +229,3 @@ class Receiver(): Get the global ``eventreceiver`` instance. """ return Receiver.eventreceiver - diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 7ac2a6f0a..86b8e608c 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -357,11 +357,14 @@ class MediaManagerItem(QtGui.QWidget): Validates to see if the file still exists or thumbnail is up to date """ - filedate = os.stat(file).st_mtime - thumbdate = os.stat(thumb).st_mtime - #if file updated rebuild icon - if filedate > thumbdate: - self.IconFromFile(file, thumb) + if os.path.exists(file): + filedate = os.stat(file).st_mtime + thumbdate = os.stat(thumb).st_mtime + #if file updated rebuild icon + if filedate > thumbdate: + self.IconFromFile(file, thumb) + return True + return False def IconFromFile(self, file, thumb): icon = build_icon(unicode(file)) @@ -422,12 +425,13 @@ class MediaManagerItem(QtGui.QWidget): else: #Is it posssible to process multiple list items to generate multiple #service items? - if self.singleServiceItem: + if self.singleServiceItem or self.remoteTriggered: log.debug(self.PluginNameShort + u' Add requested') service_item = self.buildServiceItem() if service_item: service_item.from_plugin = False - self.parent.service_manager.addServiceItem(service_item) + self.parent.service_manager.addServiceItem(service_item, + replace=self.remoteTriggered) else: items = self.ListView.selectedIndexes() for item in items: @@ -450,10 +454,10 @@ class MediaManagerItem(QtGui.QWidget): self.trUtf8('You must select a existing service item to add to.')) elif self.title.lower() == service_item.name.lower(): self.generateSlideData(service_item) - self.parent.service_manager.addServiceItem(service_item) + self.parent.service_manager.addServiceItem(service_item, + replace=True) else: #Turn off the remote edit update message indicator - self.parent.service_manager.remoteEditTriggered = False QtGui.QMessageBox.information(self, self.trUtf8('Invalid Service Item'), self.trUtf8(unicode('You must select a %s service item.' % self.title))) @@ -471,4 +475,4 @@ class MediaManagerItem(QtGui.QWidget): if self.generateSlideData(service_item, item): return service_item else: - return None \ No newline at end of file + return None diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 8601e818e..3f3eedf5d 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -336,6 +336,3 @@ class ServiceItem(object): """ return self._raw_frames[row][u'path'] - def request_audit(self): - if self.audit: - Receiver.send_message(u'songusage_live', self.audit) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index ec20650cf..f7e87e879 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -258,4 +258,5 @@ class GeneralTab(SettingsTab): if self.screens.monitor_number != self.MonitorNumber: self.screens.monitor_number = 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') diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 15fc29650..5e7071449 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -66,26 +66,27 @@ class DisplayWidget(QtGui.QWidget): def __init__(self, parent=None, name=None): QtGui.QWidget.__init__(self, None) self.parent = parent - self.hotkey_map = {QtCore.Qt.Key_Return: 'servicemanager_next_item', - QtCore.Qt.Key_Space: 'live_slidecontroller_next_noloop', - QtCore.Qt.Key_Enter: 'live_slidecontroller_next_noloop', - QtCore.Qt.Key_0: 'servicemanager_next_item', - QtCore.Qt.Key_Backspace: 'live_slidecontroller_previous_noloop'} + self.hotkey_map = { + QtCore.Qt.Key_Return: 'servicemanager_next_item', + QtCore.Qt.Key_Space: 'slidecontroller_live_next_noloop', + QtCore.Qt.Key_Enter: 'slidecontroller_live_next_noloop', + QtCore.Qt.Key_0: 'servicemanager_next_item', + QtCore.Qt.Key_Backspace: 'slidecontroller_live_previous_noloop'} def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent: #here accept the event and do something if event.key() == QtCore.Qt.Key_Up: - Receiver.send_message(u'live_slidecontroller_previous') + Receiver.send_message(u'slidecontroller_live_previous') event.accept() elif event.key() == QtCore.Qt.Key_Down: - Receiver.send_message(u'live_slidecontroller_next') + Receiver.send_message(u'slidecontroller_live_next') event.accept() elif event.key() == QtCore.Qt.Key_PageUp: - Receiver.send_message(u'live_slidecontroller_first') + Receiver.send_message(u'slidecontroller_live_first') event.accept() elif event.key() == QtCore.Qt.Key_PageDown: - Receiver.send_message(u'live_slidecontroller_last') + Receiver.send_message(u'slidecontroller_live_last') event.accept() elif event.key() in self.hotkey_map: Receiver.send_message(self.hotkey_map[event.key()]) @@ -113,7 +114,7 @@ class MainDisplay(DisplayWidget): ``screens`` The list of screens. """ - log.debug(u'Initilisation started') + log.debug(u'Initialisation started') DisplayWidget.__init__(self, parent) self.parent = parent self.setWindowTitle(u'OpenLP Display') @@ -133,11 +134,11 @@ class MainDisplay(DisplayWidget): self.hasTransition = False self.mediaBackground = False 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.SIGNAL(u'live_slide_show'), self.showDisplay) + QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'media_start'), self.hideDisplay) + QtCore.SIGNAL(u'videodisplay_start'), self.hideDisplay) def setup(self): """ @@ -194,7 +195,7 @@ class MainDisplay(DisplayWidget): def resetDisplay(self): log.debug(u'resetDisplay') - Receiver.send_message(u'stop_display_loop') + Receiver.send_message(u'slidecontroller_live_stop_loop') if self.primary: self.setVisible(False) else: @@ -218,7 +219,7 @@ class MainDisplay(DisplayWidget): if not self.primary: self.setVisible(True) self.showFullScreen() - Receiver.send_message(u'flush_alert') + Receiver.send_message(u'maindisplay_active') def addImageWithText(self, frame): log.debug(u'addImageWithText') @@ -296,7 +297,6 @@ class MainDisplay(DisplayWidget): elif self.display_frame: self.frameView(self.display_frame) - class VideoDisplay(Phonon.VideoWidget): """ This is the form that is used to display videos on the projector. @@ -314,7 +314,7 @@ class VideoDisplay(Phonon.VideoWidget): ``screens`` The list of screens. """ - log.debug(u'VideoDisplay Initilisation started') + log.debug(u'VideoDisplay Initialisation started') Phonon.VideoWidget.__init__(self) self.setWindowTitle(u'OpenLP Video Display') self.parent = parent @@ -325,15 +325,15 @@ class VideoDisplay(Phonon.VideoWidget): Phonon.createPath(self.mediaObject, self) Phonon.createPath(self.mediaObject, self.audioObject) 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.SIGNAL(u'media_play'), self.onMediaPlay) + QtCore.SIGNAL(u'videodisplay_play'), self.onMediaPlay) 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.SIGNAL(u'media_stop'), self.onMediaStop) + QtCore.SIGNAL(u'videodisplay_stop'), self.onMediaStop) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'update_config'), self.setup) + QtCore.SIGNAL(u'config_updated'), self.setup) def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent: @@ -350,7 +350,7 @@ class VideoDisplay(Phonon.VideoWidget): Sets up the screen on a particular screen. """ log.debug(u'VideoDisplay Setup %s for %s ' %(self.screens, - self.screens.monitor_number)) + self.screens.monitor_number)) self.setVisible(False) self.screen = self.screens.current #Sort out screen locations and sizes @@ -365,7 +365,8 @@ class VideoDisplay(Phonon.VideoWidget): def onMediaQueue(self, 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)) self.onMediaPlay() diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 99a246d69..442943ce2 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -67,11 +67,11 @@ class VersionThread(QtCore.QThread): Run the thread. """ 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) #new version has arrived 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): def setupUi(self, MainWindow): @@ -480,15 +480,15 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.QObject.connect(self.OptionsSettingsItem, QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked) 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.SIGNAL(u'version_check'), self.versionCheck) + QtCore.SIGNAL(u'openlp_version_check'), self.versionCheck) 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.SIGNAL(u'screen_changed'), self.screenChanged) + QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged) 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.SIGNAL(u'triggered()'), self.ServiceManagerContents.onNewService) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 2e1d1c872..e76415db5 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -103,9 +103,6 @@ class ServiceManager(QtGui.QWidget): self.droppos = 0 #is a new service and has not been saved 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.serviceItemEditForm = ServiceItemEditForm() #start with the layout @@ -186,11 +183,7 @@ class ServiceManager(QtGui.QWidget): QtCore.QObject.connect(self.ServiceManagerList, QtCore.SIGNAL(u'itemExpanded(QTreeWidgetItem*)'), self.expanded) QtCore.QObject.connect(Receiver.get_receiver(), - 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) + QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'servicemanager_next_item'), self.nextItem) QtCore.QObject.connect(Receiver.get_receiver(), @@ -257,9 +250,6 @@ class ServiceManager(QtGui.QWidget): if action == self.liveAction: self.makeLive() - def onPresentationTypes(self, presentation_types): - self.presentation_types = presentation_types - def onServiceItemNoteForm(self): item, count = self.findServiceItem() self.serviceNoteForm.textEdit.setPlainText( @@ -666,7 +656,7 @@ class ServiceManager(QtGui.QWidget): #does not impact the saved song so True may also be valid 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 @@ -676,10 +666,9 @@ class ServiceManager(QtGui.QWidget): """ sitem, count = self.findServiceItem() item.render() - if self.remoteEditTriggered: + if replace: item.merge(self.serviceItems[sitem][u'service_item']) self.serviceItems[sitem][u'service_item'] = item - self.remoteEditTriggered = False self.repaintServiceList(sitem + 1, 0) self.parent.LiveController.replaceServiceManagerItem(item) else: @@ -722,8 +711,6 @@ class ServiceManager(QtGui.QWidget): if item == -1: return False else: - #Switch on remote edit update functionality. - self.remoteEditTriggered = True return self.serviceItems[item][u'service_item'] def makeLive(self): @@ -748,14 +735,10 @@ class ServiceManager(QtGui.QWidget): item, count = self.findServiceItem() if self.serviceItems[item][u'service_item']\ .is_capable(ItemCapabilities.AllowsEdit): - self.remoteEditTriggered = True 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 ) - def onRemoteEditClear(self): - self.remoteEditTriggered = False - def findServiceItem(self): """ Finds a ServiceItem in the list diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index aae646f52..2b34a7c0d 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -54,11 +54,12 @@ class SlideList(QtGui.QTableWidget): def __init__(self, parent=None, name=None): QtGui.QTableWidget.__init__(self, parent.Controller) self.parent = parent - self.hotkey_map = {QtCore.Qt.Key_Return: 'servicemanager_next_item', - QtCore.Qt.Key_Space: 'live_slidecontroller_next_noloop', - QtCore.Qt.Key_Enter: 'live_slidecontroller_next_noloop', - QtCore.Qt.Key_0: 'servicemanager_next_item', - QtCore.Qt.Key_Backspace: 'live_slidecontroller_previous_noloop'} + self.hotkey_map = { + QtCore.Qt.Key_Return: 'servicemanager_next_item', + QtCore.Qt.Key_Space: 'slidecontroller_live_next_noloop', + QtCore.Qt.Key_Enter: 'slidecontroller_live_next_noloop', + QtCore.Qt.Key_0: 'servicemanager_next_item', + QtCore.Qt.Key_Backspace: 'slidecontroller_live_previous_noloop'} def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent: @@ -124,11 +125,11 @@ class SlideController(QtGui.QWidget): if self.isLive: self.TypeLabel.setText(self.trUtf8('Live')) self.split = 1 - prefix = u'live_slidecontroller' + self.type_prefix = u'live' else: self.TypeLabel.setText(self.trUtf8('Preview')) self.split = 0 - prefix = u'preview_slidecontroller' + self.type_prefix = u'preview' self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter) self.PanelLayout.addWidget(self.TypeLabel) @@ -196,7 +197,7 @@ class SlideController(QtGui.QWidget): u'Hide screen', u':/slides/slide_desktop.png', self.trUtf8('Hide Screen'), self.onHideDisplay, True) 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: self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( @@ -251,13 +252,15 @@ class SlideController(QtGui.QWidget): self.SongMenu.setText(self.trUtf8('Go to Verse')) self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup) 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']) # Screen preview area self.PreviewFrame = QtGui.QFrame(self.Splitter) self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225)) 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.setFrameShadow(QtGui.QFrame.Sunken) self.PreviewFrame.setObjectName(u'PreviewFrame') @@ -302,30 +305,38 @@ class SlideController(QtGui.QWidget): QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected) if isLive: QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay) - Receiver.send_message(u'request_spin_delay') + QtCore.SIGNAL(u'slidecontroller_live_spin_delay'), + self.receiveSpinDelay) if isLive: self.Toolbar.makeWidgetsInvisible(self.loop_list) else: self.Toolbar.makeWidgetsInvisible(self.song_edit_list) self.Mediabar.setVisible(False) 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.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.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.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.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.SIGNAL(u'%s_previous_noloop' % prefix), + QtCore.SIGNAL(u'slidecontroller_%s_previous_noloop' % + self.type_prefix), self.onSlideSelectedPreviousNoloop) 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.SIGNAL(u'%s_change' % prefix), self.onSlideChange) + QtCore.SIGNAL(u'slidecontroller_%s_change' % self.type_prefix), + self.onSlideChange) QtCore.QObject.connect(self.Splitter, QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter) QtCore.QObject.connect(Receiver.get_receiver(), @@ -460,20 +471,18 @@ class SlideController(QtGui.QWidget): Loads a ServiceItem into the system from ServiceManager Display the slide number passed """ - log.debug(u'processsManagerItem') + log.debug(u'processManagerItem') #If old item was a command tell it to stop if self.serviceItem and self.serviceItem.is_command(): self.onMediaStop() if serviceItem.is_media(): self.onMediaStart(serviceItem) - elif serviceItem.is_command(): - if self.isLive: - blanked = self.blankButton.isChecked() - else: - blanked = False - Receiver.send_message(u'%s_start' % serviceItem.name.lower(), \ - [serviceItem.title, serviceItem.get_frame_path(), - serviceItem.get_frame_title(), slideno, self.isLive, blanked]) + if self.isLive: + blanked = self.blankButton.isChecked() + else: + blanked = False + Receiver.send_message(u'%s_start' % serviceItem.name.lower(), + [serviceItem, self.isLive, blanked, slideno]) self.slideList = {} width = self.parent.ControlSplitter.sizes()[self.split] #Set pointing cursor when we have somthing to point at @@ -537,7 +546,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.resizeRowsToContents() self.PreviewListWidget.setColumnWidth(0, self.labelWidth) self.PreviewListWidget.setColumnWidth(1, - self.PreviewListWidget.viewport().size().width() - self.labelWidth ) + self.PreviewListWidget.viewport().size().width() - self.labelWidth) if slideno > self.PreviewListWidget.rowCount(): self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) else: @@ -545,9 +554,11 @@ class SlideController(QtGui.QWidget): self.enableToolBar(serviceItem) self.onSlideSelected() 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)) - if self.isLive: - self.serviceItem.request_audit() #Screen event methods def onSlideSelectedFirst(self): @@ -556,9 +567,9 @@ class SlideController(QtGui.QWidget): """ if not self.serviceItem: return + Receiver.send_message(u'%s_first' % self.serviceItem.name.lower(), + [self.serviceItem, self.isLive]) if self.serviceItem.is_command(): - Receiver.send_message(u'%s_first'% \ - self.serviceItem.name.lower(), self.isLive) self.updatePreview() else: self.PreviewListWidget.selectRow(0) @@ -573,7 +584,7 @@ class SlideController(QtGui.QWidget): self.blankButton.setChecked(True) self.blankScreen(HideMode.Blank, self.blankButton.isChecked()) self.parent.generalConfig.set_config(u'screen blank', - self.blankButton.isChecked()) + self.blankButton.isChecked()) def onThemeDisplay(self, force=False): """ @@ -601,13 +612,14 @@ class SlideController(QtGui.QWidget): Blank the display screen. """ if self.serviceItem is not None: - if self.serviceItem.is_command(): - if blanked: - Receiver.send_message(u'%s_blank'% self.serviceItem.name.lower()) - else: - Receiver.send_message(u'%s_unblank'% self.serviceItem.name.lower()) + if blanked: + Receiver.send_message(u'%s_blank' % self.serviceItem.name.lower(), + [self.serviceItem, self.isLive]) 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: self.parent.mainDisplay.blankDisplay(blankType, blanked) @@ -619,9 +631,9 @@ class SlideController(QtGui.QWidget): row = self.PreviewListWidget.currentRow() self.selectedRow = 0 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: - Receiver.send_message(u'%s_slide'% \ - self.serviceItem.name.lower(), u'%s:%s' % (row, self.isLive)) self.updatePreview() else: before = time.time() @@ -673,9 +685,9 @@ class SlideController(QtGui.QWidget): """ if not self.serviceItem: return + Receiver.send_message(u'%s_next' % self.serviceItem.name.lower(), + [self.serviceItem, self.isLive]) if self.serviceItem.is_command(): - Receiver.send_message(u'%s_next' % \ - self.serviceItem.name.lower(), self.isLive) self.updatePreview() else: row = self.PreviewListWidget.currentRow() + 1 @@ -697,9 +709,9 @@ class SlideController(QtGui.QWidget): """ if not self.serviceItem: return + Receiver.send_message(u'%s_previous' % self.serviceItem.name.lower(), + [self.serviceItem, self.isLive]) if self.serviceItem.is_command(): - Receiver.send_message( - u'%s_previous'% self.serviceItem.name.lower(), self.isLive) self.updatePreview() else: row = self.PreviewListWidget.currentRow() - 1 @@ -717,9 +729,9 @@ class SlideController(QtGui.QWidget): """ if not self.serviceItem: return + Receiver.send_message(u'%s_last' % self.serviceItem.name.lower(), + [self.serviceItem, self.isLive]) if self.serviceItem.is_command(): - Receiver.send_message(u'%s_last' % \ - self.serviceItem.name.lower(), self.isLive) self.updatePreview() else: self.PreviewListWidget.selectRow( @@ -749,8 +761,8 @@ class SlideController(QtGui.QWidget): def onEditSong(self): self.songEdit = True - Receiver.send_message(u'%s_edit' % self.serviceItem.name, u'P:%s' % - self.serviceItem.editId ) + Receiver.send_message(u'%s_edit' % self.serviceItem.name.lower(), + u'P:%s' % self.serviceItem.editId) def onGoLive(self): """ @@ -763,9 +775,8 @@ class SlideController(QtGui.QWidget): def onMediaStart(self, item): if self.isLive: - Receiver.send_message(u'%s_start' % item.name.lower(), \ - [item.title, item.get_frame_path(), - item.get_frame_title(), self.isLive, self.blankButton.isChecked()]) + Receiver.send_message(u'videodisplay_start', + [item, self.blankButton.isChecked()]) else: self.mediaObject.stop() self.mediaObject.clearQueue() @@ -777,13 +788,13 @@ class SlideController(QtGui.QWidget): def onMediaPause(self): if self.isLive: - Receiver.send_message(u'%s_pause'% self.serviceItem.name.lower()) + Receiver.send_message(u'videodisplay_pause') else: self.mediaObject.pause() def onMediaPlay(self): if self.isLive: - Receiver.send_message(u'%s_play'% self.serviceItem.name.lower(), self.isLive) + Receiver.send_message(u'videodisplay_play') else: self.SlidePreview.hide() self.video.show() @@ -791,7 +802,7 @@ class SlideController(QtGui.QWidget): def onMediaStop(self): if self.isLive: - Receiver.send_message(u'%s_stop'% self.serviceItem.name.lower(), self.isLive) + Receiver.send_message(u'videodisplay_stop') else: self.mediaObject.stop() self.video.hide() diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index e35afa9a7..a651c6211 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -102,7 +102,7 @@ class ThemeManager(QtGui.QWidget): QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.changeGlobalFromScreen) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'update_global_theme'), self.changeGlobalFromTab) + QtCore.SIGNAL(u'theme_update_global'), self.changeGlobalFromTab) #Variables self.themelist = [] 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')) self.ThemeListWidget.item(count).setText(name) 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.pushThemes() def onAddTheme(self): @@ -291,7 +290,7 @@ class ThemeManager(QtGui.QWidget): self.pushThemes() def pushThemes(self): - Receiver.send_message(u'update_themes', self.getThemes() ) + Receiver.send_message(u'theme_update_list', self.getThemes() ) def getThemes(self): return self.themelist diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 0deca94e9..7bca99bf0 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -103,7 +103,7 @@ class ThemesTab(SettingsTab): QtCore.QObject.connect(self.DefaultComboBox, QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'update_themes'), self.updateThemeList) + QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) def retranslateUi(self): self.GlobalGroupBox.setTitle(self.trUtf8('Global theme')) @@ -136,12 +136,12 @@ class ThemesTab(SettingsTab): def save(self): self.config.set_config(u'theme level', self.theme_level) 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.global_theme, self.theme_level) 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): self.theme_level = ThemeLevel.Song @@ -188,4 +188,4 @@ class ThemesTab(SettingsTab): if not preview.isNull(): preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) - self.DefaultListView.setPixmap(preview) + self.DefaultListView.setPixmap(preview) \ No newline at end of file diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index aeba0ab41..975192da3 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -88,7 +88,6 @@ class alertsPlugin(Plugin): def onAlertsTrigger(self): self.alertForm.loadList() self.alertForm.exec_() - Receiver.send_message(u'text_onTop') def about(self): about_text = self.trUtf8('Alerts Plugin
This plugin ' diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 804975ff1..00203f1f2 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -1,82 +1,92 @@ # -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -# Form implementation generated from reading ui file 'alertdialog.ui' -# -# Created: Sat Apr 17 08:07:40 2010 -# by: PyQt4 UI code generator 4.7 -# -# WARNING! All changes made in this file will be lost! +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2010 Raoul Snyman # +# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin # +# Thompson, Jon Tibble, Carsten Tinggaard # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### from PyQt4 import QtCore, QtGui class Ui_AlertDialog(object): def setupUi(self, AlertDialog): - AlertDialog.setObjectName("AlertDialog") + AlertDialog.setObjectName(u'AlertDialog') AlertDialog.resize(567, 440) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon.addPixmap(QtGui.QPixmap(u':/icon/openlp.org-icon-32.bmp'), QtGui.QIcon.Normal, QtGui.QIcon.Off) AlertDialog.setWindowIcon(icon) self.AlertFormLayout = QtGui.QVBoxLayout(AlertDialog) self.AlertFormLayout.setSpacing(8) self.AlertFormLayout.setMargin(8) - self.AlertFormLayout.setObjectName("AlertFormLayout") + self.AlertFormLayout.setObjectName(u'AlertFormLayout') self.AlertTextLayout = QtGui.QFormLayout() self.AlertTextLayout.setContentsMargins(0, 0, -1, -1) self.AlertTextLayout.setSpacing(8) - self.AlertTextLayout.setObjectName("AlertTextLayout") + self.AlertTextLayout.setObjectName(u'AlertTextLayout') self.AlertEntryLabel = QtGui.QLabel(AlertDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.AlertEntryLabel.sizePolicy().hasHeightForWidth()) self.AlertEntryLabel.setSizePolicy(sizePolicy) - self.AlertEntryLabel.setObjectName("AlertEntryLabel") + self.AlertEntryLabel.setObjectName(u'AlertEntryLabel') self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.AlertEntryLabel) self.AlertParameter = QtGui.QLabel(AlertDialog) - self.AlertParameter.setObjectName("AlertParameter") + self.AlertParameter.setObjectName(u'AlertParameter') self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.AlertParameter) self.ParameterEdit = QtGui.QLineEdit(AlertDialog) - self.ParameterEdit.setObjectName("ParameterEdit") + self.ParameterEdit.setObjectName(u'ParameterEdit') self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ParameterEdit) self.AlertTextEdit = QtGui.QLineEdit(AlertDialog) - self.AlertTextEdit.setObjectName("AlertTextEdit") + self.AlertTextEdit.setObjectName(u'AlertTextEdit') self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.AlertTextEdit) self.AlertFormLayout.addLayout(self.AlertTextLayout) self.ManagementLayout = QtGui.QHBoxLayout() self.ManagementLayout.setSpacing(8) self.ManagementLayout.setContentsMargins(-1, -1, -1, 0) - self.ManagementLayout.setObjectName("ManagementLayout") + self.ManagementLayout.setObjectName(u'ManagementLayout') self.AlertListWidget = QtGui.QListWidget(AlertDialog) self.AlertListWidget.setAlternatingRowColors(True) - self.AlertListWidget.setObjectName("AlertListWidget") + self.AlertListWidget.setObjectName(u'AlertListWidget') self.ManagementLayout.addWidget(self.AlertListWidget) self.ManageButtonLayout = QtGui.QVBoxLayout() self.ManageButtonLayout.setSpacing(8) - self.ManageButtonLayout.setObjectName("ManageButtonLayout") + self.ManageButtonLayout.setObjectName(u'ManageButtonLayout') self.NewButton = QtGui.QPushButton(AlertDialog) icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(":/general/general_new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon1.addPixmap(QtGui.QPixmap(u':/general/general_new.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.NewButton.setIcon(icon1) - self.NewButton.setObjectName("NewButton") + self.NewButton.setObjectName(u'NewButton') self.ManageButtonLayout.addWidget(self.NewButton) self.SaveButton = QtGui.QPushButton(AlertDialog) self.SaveButton.setEnabled(False) icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(":/general/general_save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon2.addPixmap(QtGui.QPixmap(u':/general/general_save.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.SaveButton.setIcon(icon2) - self.SaveButton.setObjectName("SaveButton") + self.SaveButton.setObjectName(u'SaveButton') self.ManageButtonLayout.addWidget(self.SaveButton) - self.EditButton = QtGui.QPushButton(AlertDialog) - icon3 = QtGui.QIcon() - icon3.addPixmap(QtGui.QPixmap(":/general/general_edit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.EditButton.setIcon(icon3) - self.EditButton.setObjectName("EditButton") - self.ManageButtonLayout.addWidget(self.EditButton) self.DeleteButton = QtGui.QPushButton(AlertDialog) - icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap(":/general/general_delete.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.DeleteButton.setIcon(icon4) - self.DeleteButton.setObjectName("DeleteButton") + icon3 = QtGui.QIcon() + icon3.addPixmap(QtGui.QPixmap(u':/general/general_delete.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.DeleteButton.setIcon(icon3) + self.DeleteButton.setObjectName(u'DeleteButton') self.ManageButtonLayout.addWidget(self.DeleteButton) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.ManageButtonLayout.addItem(spacerItem) @@ -84,51 +94,52 @@ class Ui_AlertDialog(object): self.AlertFormLayout.addLayout(self.ManagementLayout) self.AlertButtonLayout = QtGui.QHBoxLayout() self.AlertButtonLayout.setSpacing(8) - self.AlertButtonLayout.setObjectName("AlertButtonLayout") - spacerItem1 = QtGui.QSpacerItem(181, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.AlertButtonLayout.setObjectName(u'AlertButtonLayout') + spacerItem1 = QtGui.QSpacerItem(181, 0, QtGui.QSizePolicy.Expanding, + QtGui.QSizePolicy.Minimum) self.AlertButtonLayout.addItem(spacerItem1) self.DisplayButton = QtGui.QPushButton(AlertDialog) - icon5 = QtGui.QIcon() - icon5.addPixmap(QtGui.QPixmap(":/general/general_live.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.DisplayButton.setIcon(icon5) - self.DisplayButton.setObjectName("DisplayButton") + icon4 = QtGui.QIcon() + icon4.addPixmap(QtGui.QPixmap(u':/general/general_live.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.DisplayButton.setIcon(icon4) + self.DisplayButton.setObjectName(u'DisplayButton') self.AlertButtonLayout.addWidget(self.DisplayButton) self.DisplayCloseButton = QtGui.QPushButton(AlertDialog) - self.DisplayCloseButton.setIcon(icon5) - self.DisplayCloseButton.setObjectName("DisplayCloseButton") + self.DisplayCloseButton.setIcon(icon4) + self.DisplayCloseButton.setObjectName(u'DisplayCloseButton') self.AlertButtonLayout.addWidget(self.DisplayCloseButton) self.CloseButton = QtGui.QPushButton(AlertDialog) - icon6 = QtGui.QIcon() - icon6.addPixmap(QtGui.QPixmap(":/system/system_close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.CloseButton.setIcon(icon6) - self.CloseButton.setObjectName("CloseButton") + icon5 = QtGui.QIcon() + icon5.addPixmap(QtGui.QPixmap(u':/system/system_close.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.CloseButton.setIcon(icon5) + self.CloseButton.setObjectName(u'CloseButton') self.AlertButtonLayout.addWidget(self.CloseButton) self.AlertFormLayout.addLayout(self.AlertButtonLayout) self.AlertEntryLabel.setBuddy(self.AlertTextEdit) self.AlertParameter.setBuddy(self.ParameterEdit) self.retranslateUi(AlertDialog) - QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL("clicked()"), AlertDialog.close) + QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL(u'clicked()'), AlertDialog.close) QtCore.QMetaObject.connectSlotsByName(AlertDialog) AlertDialog.setTabOrder(self.AlertTextEdit, self.ParameterEdit) AlertDialog.setTabOrder(self.ParameterEdit, self.AlertListWidget) AlertDialog.setTabOrder(self.AlertListWidget, self.NewButton) AlertDialog.setTabOrder(self.NewButton, self.SaveButton) - AlertDialog.setTabOrder(self.SaveButton, self.EditButton) - AlertDialog.setTabOrder(self.EditButton, self.DeleteButton) + AlertDialog.setTabOrder(self.SaveButton, self.DeleteButton) AlertDialog.setTabOrder(self.DeleteButton, self.DisplayButton) AlertDialog.setTabOrder(self.DisplayButton, self.DisplayCloseButton) AlertDialog.setTabOrder(self.DisplayCloseButton, self.CloseButton) def retranslateUi(self, AlertDialog): - AlertDialog.setWindowTitle(QtGui.QApplication.translate("AlertDialog", "Alert Message", None, QtGui.QApplication.UnicodeUTF8)) - self.AlertEntryLabel.setText(QtGui.QApplication.translate("AlertDialog", "Alert &text:", None, QtGui.QApplication.UnicodeUTF8)) - self.AlertParameter.setText(QtGui.QApplication.translate("AlertDialog", "&Parameter(s):", None, QtGui.QApplication.UnicodeUTF8)) - self.NewButton.setText(QtGui.QApplication.translate("AlertDialog", "&New", None, QtGui.QApplication.UnicodeUTF8)) - self.SaveButton.setText(QtGui.QApplication.translate("AlertDialog", "&Save", None, QtGui.QApplication.UnicodeUTF8)) - self.EditButton.setText(QtGui.QApplication.translate("AlertDialog", "&Edit", None, QtGui.QApplication.UnicodeUTF8)) - self.DeleteButton.setText(QtGui.QApplication.translate("AlertDialog", "&Delete", None, QtGui.QApplication.UnicodeUTF8)) - self.DisplayButton.setText(QtGui.QApplication.translate("AlertDialog", "Displ&ay", None, QtGui.QApplication.UnicodeUTF8)) - self.DisplayCloseButton.setText(QtGui.QApplication.translate("AlertDialog", "Display && Cl&ose", None, QtGui.QApplication.UnicodeUTF8)) - self.CloseButton.setText(QtGui.QApplication.translate("AlertDialog", "&Close", None, QtGui.QApplication.UnicodeUTF8)) + AlertDialog.setWindowTitle(self.trUtf8('Alert Message')) + self.AlertEntryLabel.setText(self.trUtf8('Alert &text:')) + self.AlertParameter.setText(self.trUtf8('&Parameter(s):')) + self.NewButton.setText(self.trUtf8('&New')) + self.SaveButton.setText(self.trUtf8('&Save')) + self.DeleteButton.setText(self.trUtf8('&Delete')) + self.DisplayButton.setText(self.trUtf8('Displ&ay')) + self.DisplayCloseButton.setText(self.trUtf8('Display && Cl&ose')) + self.CloseButton.setText(self.trUtf8('&Close')) diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 08e5f5e02..9656dea42 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -39,7 +39,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): """ self.manager = manager self.parent = parent - self.history_required = True + self.item_id = None QtGui.QDialog.__init__(self, None) self.setupUi(self) QtCore.QObject.connect(self.DisplayButton, @@ -57,9 +57,6 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): QtCore.QObject.connect(self.DeleteButton, QtCore.SIGNAL(u'clicked()'), self.onDeleteClick) - QtCore.QObject.connect(self.EditButton, - QtCore.SIGNAL(u'clicked()'), - self.onEditClick) QtCore.QObject.connect(self.SaveButton, QtCore.SIGNAL(u'clicked()'), self.onSaveClick) @@ -79,12 +76,10 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): QtCore.Qt.UserRole, QtCore.QVariant(alert.id)) self.AlertListWidget.addItem(item_name) self.SaveButton.setEnabled(False) - self.EditButton.setEnabled(False) self.DeleteButton.setEnabled(False) def onDisplayClicked(self): if self.triggerAlert(unicode(self.AlertTextEdit.text())): - self.history_required = False self.loadList() def onDisplayCloseClicked(self): @@ -103,15 +98,6 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): self.DeleteButton.setEnabled(False) self.EditButton.setEnabled(False) - def onEditClick(self): - item = self.AlertListWidget.currentItem() - if item: - self.item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] - self.AlertTextEdit.setText(unicode(item.text())) - self.SaveButton.setEnabled(True) - self.DeleteButton.setEnabled(True) - self.EditButton.setEnabled(False) - def onNewClick(self): if len(self.AlertTextEdit.text()) == 0: QtGui.QMessageBox.information(self, @@ -121,19 +107,22 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): alert = AlertItem() alert.text = unicode(self.AlertTextEdit.text()) self.manager.save_alert(alert) - self.onClearClick() + self.AlertTextEdit.setText(u'') self.loadList() def onSaveClick(self): - alert = self.manager.get_alert(self.item_id) - alert.text = unicode(self.AlertTextEdit.text()) - self.manager.save_alert(alert) - self.onClearClick() - self.loadList() + if self.item_id: + alert = self.manager.get_alert(self.item_id) + alert.text = unicode(self.AlertTextEdit.text()) + self.manager.save_alert(alert) + self.item_id = None + self.loadList() + else: + self.onNewClick() def onTextChanged(self): #Data has changed by editing it so potential storage required - self.history_required = True + self.SaveButton.setEnabled(True) def onDoubleClick(self): """ @@ -143,7 +132,10 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): for item in items: bitem = self.AlertListWidget.item(item.row()) self.triggerAlert(bitem.text()) - self.history_required = False + self.AlertTextEdit.setText(bitem.text()) + self.item_id = (bitem.data(QtCore.Qt.UserRole)).toInt()[0] + self.SaveButton.setEnabled(False) + self.DeleteButton.setEnabled(True) def onSingleClick(self): """ @@ -154,16 +146,13 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): for item in items: bitem = self.AlertListWidget.item(item.row()) self.AlertTextEdit.setText(bitem.text()) - self.history_required = False - self.EditButton.setEnabled(True) + self.item_id = (bitem.data(QtCore.Qt.UserRole)).toInt()[0] + self.SaveButton.setEnabled(False) self.DeleteButton.setEnabled(True) def triggerAlert(self, text): if text: + text = text.replace(u'<>', unicode(self.ParameterEdit.text())) self.parent.alertsmanager.displayAlert(text) - if self.parent.alertsTab.save_history and self.history_required: - alert = AlertItem() - alert.text = unicode(self.AlertTextEdit.text()) - self.manager.save_alert(alert) return True return False diff --git a/openlp/plugins/alerts/forms/alertstab.py b/openlp/plugins/alerts/forms/alertstab.py index b8efe9bdb..65c1d7f33 100644 --- a/openlp/plugins/alerts/forms/alertstab.py +++ b/openlp/plugins/alerts/forms/alertstab.py @@ -34,7 +34,6 @@ class AlertsTab(SettingsTab): def __init__(self, parent, section=None): self.parent = parent self.manager = parent.manager - self.alertsmanager = parent.alertsmanager SettingsTab.__init__(self, parent.name, section) def setupUi(self): @@ -135,22 +134,6 @@ class AlertsTab(SettingsTab): QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.LocationLayout.addItem(self.LocationSpacer) self.FontLayout.addWidget(self.LocationWidget) - self.HistoryWidget = QtGui.QWidget(self.FontGroupBox) - self.HistoryWidget.setObjectName(u'HistoryWidget') - self.HistoryLayout = QtGui.QHBoxLayout(self.HistoryWidget) - self.HistoryLayout.setSpacing(8) - self.HistoryLayout.setMargin(0) - self.HistoryLayout.setObjectName(u'HistoryLayout') - self.HistoryLabel = QtGui.QLabel(self.HistoryWidget) - self.HistoryLabel.setObjectName(u'HistoryLabel') - self.HistoryLayout.addWidget(self.HistoryLabel) - self.HistoryCheckBox = QtGui.QCheckBox(self.HistoryWidget) - self.HistoryCheckBox.setObjectName(u'HistoryCheckBox') - self.HistoryLayout.addWidget(self.HistoryCheckBox) - self.HistorySpacer = QtGui.QSpacerItem(147, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.HistoryLayout.addItem(self.HistorySpacer) - self.FontLayout.addWidget(self.HistoryWidget) self.SlideLeftLayout.addWidget(self.FontGroupBox) self.SlideLeftSpacer = QtGui.QSpacerItem(20, 94, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) @@ -189,9 +172,6 @@ class AlertsTab(SettingsTab): self.SlideRightLayout.addItem(self.SlideRightSpacer) self.AlertsLayout.addWidget(self.AlertRightColumn) # Signals and slots - QtCore.QObject.connect(self.HistoryCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), - self.onHistoryCheckBoxChanged) QtCore.QObject.connect(self.BackgroundColorButton, QtCore.SIGNAL(u'pressed()'), self.onBackgroundColorButtonClicked) QtCore.QObject.connect(self.FontColorButton, @@ -215,7 +195,6 @@ class AlertsTab(SettingsTab): self.TimeoutLabel.setText(self.trUtf8('Alert timeout:')) self.TimeoutSpinBox.setSuffix(self.trUtf8('s')) self.LocationLabel.setText(self.trUtf8('Location:')) - self.HistoryLabel.setText(self.trUtf8('Keep History:')) self.PreviewGroupBox.setTitle(self.trUtf8('Preview')) self.FontPreview.setText(self.trUtf8('openlp.org')) self.LocationComboBox.setItemText(0, self.trUtf8('Top')) @@ -234,12 +213,6 @@ class AlertsTab(SettingsTab): def onLocationComboBoxClicked(self, location): self.location = location - def onHistoryCheckBoxChanged(self, check_state): - self.save_history = False - # we have a set value convert to True/False - if check_state == QtCore.Qt.Checked: - self.save_history = True - def onFontColorButtonClicked(self): self.font_color = QtGui.QColorDialog.getColor( QtGui.QColor(self.font_color), self).name() @@ -264,8 +237,6 @@ class AlertsTab(SettingsTab): self.font_face = unicode( self.config.get_config(u'font face', QtGui.QFont().family())) self.location = int(self.config.get_config(u'location', 0)) - self.save_history = str_to_bool( - self.config.get_config(u'save history', u'False')) self.FontSizeSpinBox.setValue(self.font_size) self.TimeoutSpinBox.setValue(self.timeout) self.FontColorButton.setStyleSheet( @@ -273,7 +244,6 @@ class AlertsTab(SettingsTab): self.BackgroundColorButton.setStyleSheet( u'background-color: %s' % self.bg_color) self.LocationComboBox.setCurrentIndex(self.location) - self.HistoryCheckBox.setChecked(self.save_history) font = QtGui.QFont() font.setFamily(self.font_face) self.FontComboBox.setCurrentFont(font) @@ -292,7 +262,6 @@ class AlertsTab(SettingsTab): self.config.set_config(u'timeout', unicode(self.timeout)) self.config.set_config(u'location', unicode(self.LocationComboBox.currentIndex())) - self.config.set_config(u'save history', unicode(self.save_history)) def updateDisplay(self): font = QtGui.QFont() diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index 2243b5bef..a933d49fd 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -44,13 +44,11 @@ class AlertsManager(QtCore.QObject): self.timer_id = 0 self.alertList = [] 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.SIGNAL(u'alert_text'), self.displayAlert) + QtCore.SIGNAL(u'alerts_text'), self.displayAlert) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'screen_changed'), self.screenChanged) - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'config_updated'), self.screenChanged) + QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged) def screenChanged(self): log.debug(u'screen changed') @@ -84,10 +82,10 @@ class AlertsManager(QtCore.QObject): self.screenChanged() self.alertList.append(text) 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')) return - Receiver.send_message(u'status_message', u'') + Receiver.send_message(u'maindisplay_status_text', u'') self.generateAlert() def generateAlert(self): diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index a717a4f44..46bff5bb9 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -240,7 +240,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): """ log.debug('Cancel button pressed!') if self.currentId() == 3: - Receiver.send_message(u'openlpstopimport') + Receiver.send_message(u'bibles_stop_import') def onCurrentIdChanged(self, id): if id == 3: @@ -354,7 +354,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): log.debug(u'IncrementBar %s', status_text) self.ImportProgressLabel.setText(status_text) self.ImportProgressBar.setValue(self.ImportProgressBar.value() + 1) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') def preImport(self): self.finishButton.setVisible(False) @@ -362,7 +362,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setValue(0) self.ImportProgressLabel.setText(self.trUtf8('Starting import...')) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') def performImport(self): 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.finishButton.setVisible(True) self.cancelButton.setVisible(False) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 4c205b920..103187615 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -146,7 +146,7 @@ class BiblesTab(SettingsTab): self.BibleDualCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onBibleDualCheckBox) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'update_themes'), self.updateThemeList) + QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) def retranslateUi(self): self.VerseDisplayGroupBox.setTitle(self.trUtf8('Verse Display')) @@ -225,4 +225,4 @@ class BiblesTab(SettingsTab): # Not Found id = 0 self.bible_theme = u'' - self.BibleThemeComboBox.setCurrentIndex(id) + self.BibleThemeComboBox.setCurrentIndex(id) \ No newline at end of file diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 2f40e4b96..5b49852e5 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -52,7 +52,7 @@ class CSVBible(BibleDB): raise KeyError(u'You have to supply a file to import verses from.') self.versesfile = kwargs[u'versesfile'] 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): """ @@ -77,7 +77,7 @@ class CSVBible(BibleDB): details = chardet.detect(line[1]) self.create_book(unicode(line[1], details['encoding']), line[2], int(line[0])) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') except: log.exception(u'Loading books from file failed') success = False @@ -105,7 +105,7 @@ class CSVBible(BibleDB): self.commit() self.create_verse(book.id, line[1], line[2], unicode(line[3], details['encoding'])) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') self.commit() except: log.exception(u'Loading verses from file failed') @@ -118,4 +118,3 @@ class CSVBible(BibleDB): return False else: return success - diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index b14f9b3a2..37d42f833 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -203,9 +203,9 @@ class BGExtract(BibleCommon): # Let's get the page, and then open it in BeautifulSoup, so as to # attempt to make "easy" work of bad HTML. page = urllib2.urlopen(urlstring) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') 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') verse_number = 0 verse_list = {0: u''} @@ -213,7 +213,7 @@ class BGExtract(BibleCommon): # This is a PERFECT example of opening the Cthulu tag! # O Bible Gateway, why doth ye such horrific HTML produce? 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': break 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 if isinstance(verse, Tag) and (verse.name == u'p' or verse.name == u'font') and 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'): continue 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 if isinstance(item, Tag) and item.name == u'font': 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': continue if isinstance(subitem, Tag) and subitem.name == u'p' and not subitem.contents: @@ -294,37 +294,37 @@ class CWExtract(BibleCommon): (version, urlbookname.lower(), chapter) log.debug(u'URL: %s', chapter_url) page = urllib2.urlopen(chapter_url) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') if not page: return None soup = BeautifulSoup(page) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') htmlverses = soup.findAll(u'span', u'versetext') verses = {} reduce_spaces = re.compile(r'[ ]{2,}') fix_punctuation = re.compile(r'[ ]+([.,;])') for verse in htmlverses: - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') versenumber = int(verse.contents[0].contents[0]) versetext = u'' for part in verse.contents: - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') if isinstance(part, NavigableString): versetext = versetext + part elif part and part.attrMap and \ (part.attrMap[u'class'] == u'WordsOfChrist' or \ part.attrMap[u'class'] == u'strongs'): for subpart in part.contents: - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') if isinstance(subpart, NavigableString): versetext = versetext + subpart elif subpart and subpart.attrMap and \ subpart.attrMap[u'class'] == u'strongs': for subsub in subpart.contents: - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') if isinstance(subsub, NavigableString): 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 # between text and , and . versetext = versetext.strip(u'\n\r\t ') @@ -415,14 +415,14 @@ class HTTPBible(BibleDB): if not db_book: book_details = self.lookup_book(book) if not book_details: - Receiver.send_message(u'bible_nobook') + Receiver.send_message(u'bibles_nobook') return [] db_book = self.create_book(book_details[u'name'], book_details[u'abbreviation'], book_details[u'testament_id']) book = db_book.name if BibleDB.get_verse_count(self, book, reference[1]) == 0: - Receiver.send_message(u'bible_showprogress') - Receiver.send_message(u'process_events') + Receiver.send_message(u'bibles_showprogress') + Receiver.send_message(u'openlp_process_events') search_results = self.get_chapter(self.name, book, reference[1]) if search_results and search_results.has_verselist(): ## 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 ## to request ac and get Acts back. 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 db_book = self.get_book(bookname) self.create_chapter(db_book.id, search_results.get_chapter(), search_results.get_verselist()) - Receiver.send_message(u'process_events') - Receiver.send_message(u'bible_hideprogress') - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') + Receiver.send_message(u'bibles_hideprogress') + Receiver.send_message(u'openlp_process_events') return BibleDB.get_verses(self, reference_list) def get_chapter(self, version, book, chapter): @@ -496,4 +496,3 @@ class HTTPBible(BibleDB): The hostname or IP address of the proxy server. """ self.proxy_server = server - diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 764399fab..66d27e4d3 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -63,7 +63,7 @@ class BibleMediaItem(MediaManagerItem): # place to store the search results self.search_results = {} 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): obj = listobj[QtCore.QString(key)] @@ -257,11 +257,11 @@ class BibleMediaItem(MediaManagerItem): QtCore.QObject.connect(self.QuickSearchEdit, QtCore.SIGNAL(u'returnPressed()'), self.onQuickSearchButton) 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.SIGNAL(u'bible_hideprogress'), self.onSearchProgressHide) + QtCore.SIGNAL(u'bibles_hideprogress'), self.onSearchProgressHide) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'bible_nobook'), self.onNoBookFound) + QtCore.SIGNAL(u'bibles_nobook'), self.onNoBookFound) def addListViewToToolBar(self): MediaManagerItem.addListViewToToolBar(self) @@ -322,7 +322,7 @@ class BibleMediaItem(MediaManagerItem): def setQuickMessage(self, text): self.QuickMessage.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 time.sleep(0.1) @@ -353,7 +353,7 @@ class BibleMediaItem(MediaManagerItem): def onSearchProgressShow(self): self.SearchProgress.setVisible(True) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') #self.SearchProgress.setMinimum(0) #self.SearchProgress.setMaximum(2) #self.SearchProgress.setValue(1) diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 2f7e3e451..ea8bd3538 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -49,7 +49,7 @@ class OpenSongBible(BibleDB): raise KeyError(u'You have to supply a file name to import from.') self.filename = kwargs['filename'] 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): """ @@ -92,7 +92,7 @@ class OpenSongBible(BibleDB): int(verse.attrib[u'n']), unicode(verse.text) ) - Receiver.send_message(u'process_events') + Receiver.send_message(u'openlp_process_events') self.wizard.incrementProgressBar( QtCore.QString('%s %s %s' % (self.trUtf8('Importing'),\ db_book.name, chapter.attrib[u'n']))) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 4416bb2c6..7c532e313 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -84,7 +84,7 @@ class OSISBible(BibleDB): if fbibles: fbibles.close() 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): """ @@ -167,7 +167,7 @@ class OSISBible(BibleDB): .replace(u'', u'').replace(u'', u'') verse_text = self.spaces_regex.sub(u' ', 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.wizard.incrementProgressBar(u'Finishing import...') if match_count == 0: diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index cbbb023aa..eff6bc835 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -77,7 +77,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), self.onVerseListViewPressed) 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 self.custommanager = custommanager self.initialise() @@ -86,7 +86,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): log.debug(u'onPreview') if button.text() == unicode(self.trUtf8('Save && Preview')) \ and self.saveCustom(): - Receiver.send_message(u'preview_custom') + Receiver.send_message(u'custom_preview') def initialise(self): self.editAll = False @@ -135,13 +135,13 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.previewButton.setVisible(True) def closePressed(self): - Receiver.send_message(u'remote_edit_clear') + Receiver.send_message(u'custom_edit_clear') self.close() def accept(self): log.debug(u'accept') if self.saveCustom(): - Receiver.send_message(u'load_custom_list') + Receiver.send_message(u'custom_load_list') self.close() def saveCustom(self): diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 3d55db719..c79452c20 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -58,13 +58,13 @@ class CustomMediaItem(MediaManagerItem): def addEndHeaderBar(self): 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.SIGNAL(u'remote_edit_clear' ), self.onRemoteEditClear) + QtCore.SIGNAL(u'custom_edit_clear' ), self.onRemoteEditClear) 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.SIGNAL(u'preview_custom'), self.onPreviewClick) + QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick) def initPluginNameVisible(self): self.PluginNameVisible = self.trUtf8('Custom') diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 203b36842..9283dbdf3 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -76,7 +76,9 @@ class ImageTab(SettingsTab): def save(self): 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): - Receiver.send_message(u'update_spin_delay', self.loop_delay) + Receiver.send_message(u'slidecontroller_live_spin_delay', + self.loop_delay) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 6fbf66022..914a6ce20 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -124,8 +124,10 @@ class ImageMediaItem(MediaManagerItem): (path, filename) = os.path.split(unicode(file)) thumb = os.path.join(self.servicePath, filename) if os.path.exists(thumb): - self.validate(file, thumb) - icon = build_icon(thumb) + if self.validate(file, thumb): + icon = build_icon(thumb) + else: + icon = build_icon(u':/general/general_delete.png') else: icon = self.IconFromFile(file, thumb) item_name = QtGui.QListWidgetItem(filename) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 79c8600f0..701efc086 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -28,7 +28,7 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, BaseListWithDnD +from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon from openlp.plugins.presentations.lib import MessageListener log = logging.getLogger(__name__) @@ -103,6 +103,10 @@ class PresentationMediaItem(MediaManagerItem): self.PageLayout.addWidget(self.PresentationWidget) def initialise(self): + self.servicePath = os.path.join( + self.parent.config.get_data_path(), u'thumbnails') + if not os.path.exists(self.servicePath): + os.mkdir(self.servicePath) list = self.parent.config.load_list(u'presentations') self.loadList(list) for item in self.controllers: @@ -128,8 +132,27 @@ class PresentationMediaItem(MediaManagerItem): 'A presentation with that filename already exists.'), QtGui.QMessageBox.Ok) else: + icon = None + for controller in self.controllers: + thumbPath = os.path.join(self.parent.config.get_data_path(), \ + u'thumbnails', controller, filename) + thumb = os.path.join(thumbPath, u'slide1.png') + preview = os.path.join(self.parent.config.get_data_path(), \ + controller, u'thumbnails', filename, u'slide1.png') + if os.path.exists(preview): + if os.path.exists(thumb): + if self.validate(preview, thumb): + icon = build_icon(thumb) + else: + icon = build_icon(u':/general/general_delete.png') + else: + os.makedirs(thumbPath) + icon = self.IconFromFile(preview, thumb) + if not icon: + icon = build_icon(u':/general/general_delete.png') item_name = QtGui.QListWidgetItem(filename) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) + item_name.setIcon(icon) self.ListView.addItem(item_name) def onDeleteClick(self): diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 39717d42d..3a97cedaf 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -55,7 +55,7 @@ class Controller(object): self.doc.start_presentation() if isBlank: self.blank() - Receiver.send_message(u'live_slide_hide') + Receiver.send_message(u'maindisplay_hide') self.doc.slidenumber = 0 def activate(self): @@ -144,7 +144,7 @@ class Controller(object): """ log.debug(u'Live = %s, shutdown' % self.isLive) if self.isLive: - Receiver.send_message(u'live_slide_show') + Receiver.send_message(u'maindisplay_show') self.doc.close_presentation() self.doc = None #self.doc.slidenumber = 0 @@ -186,23 +186,23 @@ class MessageListener(object): self.liveHandler = Controller(True) # messages are sent from core.ui.slidecontroller 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.SIGNAL(u'presentations_stop'), self.shutdown) + QtCore.SIGNAL(u'presentation_stop'), self.shutdown) 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.SIGNAL(u'presentations_previous'), self.previous) + QtCore.SIGNAL(u'presentation_previous'), self.previous) 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.SIGNAL(u'presentations_last'), self.last) + QtCore.SIGNAL(u'presentation_last'), self.last) 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.SIGNAL(u'presentations_blank'), self.blank) + QtCore.SIGNAL(u'presentation_blank'), self.blank) 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.setInterval(500) QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.timeout) @@ -212,84 +212,78 @@ class MessageListener(object): Start of new presentation Save the handler as any new presentations start here """ + isLive, item = self.decode_message(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: self.handler = self.mediaitem.findControllerByType(file) if not self.handler: return - if isLive: controller = self.liveHandler else: controller = self.previewHandler controller.addHandler(self.controllers[self.handler], file, isBlank) + def decode_message(self, message): + return message[1], message[0] + def slide(self, message): - slide, live = self.splitMessage(message) - if live: + isLive, item = self.decode_message(message) + if isLive: self.liveHandler.slide(slide, live) else: self.previewHandler.slide(slide, live) - def first(self, isLive): + def first(self, message): + isLive, item = self.decode_message(message) if isLive: self.liveHandler.first() else: self.previewHandler.first() - def last(self, isLive): + def last(self, message): + isLive, item = self.decode_message(message) if isLive: self.liveHandler.last() else: self.previewHandler.last() - def next(self, isLive): + def next(self, message): + isLive, item = self.decode_message(message) if isLive: self.liveHandler.next() else: self.previewHandler.next() - def previous(self, isLive): + def previous(self, message): + isLive, item = self.decode_message(message) if isLive: self.liveHandler.previous() else: self.previewHandler.previous() - def shutdown(self, isLive): + def shutdown(self, message): + isLive, item = self.decode_message(message) if isLive: + Receiver.send_message(u'maindisplay_show') self.liveHandler.shutdown() - Receiver.send_message(u'live_slide_show') else: self.previewHandler.shutdown() - def blank(self): - self.liveHandler.blank() - - def unblank(self): - 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 blank(self, message): + isLive, item = self.decode_message(message) + if isLive: + self.liveHandler.blank() + def unblank(self, message): + isLive, item = self.decode_message(message) + if isLive: + self.liveHandler.unblank() + def timeout(self): self.liveHandler.poll() + diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 389744b0b..760e861f8 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -361,7 +361,7 @@ class PresentationDocument(object): prefix = u'live' else: prefix = u'preview' - Receiver.send_message(u'%s_slidecontroller_change' % prefix, + Receiver.send_message(u'slidecontroller_%s_change' % prefix, self.slidenumber - 1) def get_slide_text(self, slide_no): diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 00a83fe4b..ddf096b07 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -53,15 +53,10 @@ 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}) self.controllers[controller].start_process() - Receiver.send_message( - u'presentation types', presentation_types) - def finalise(self): log.info(u'Plugin Finalise') #Ask each controller to tidy up diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 4e01e43ee..eff9496ba 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -73,10 +73,12 @@ class RemotesPlugin(Plugin): pos = datagram.find(u':') event = unicode(datagram[:pos].lower()) if event == u'alert': - Receiver.send_message(u'alert_text', unicode(datagram[pos + 1:])) - if event == u'next_slide': - Receiver.send_message(u'live_slide_next') - + Receiver.send_message(u'alerts_text', unicode(datagram[pos + 1:])) + elif event == u'next_slide': + Receiver.send_message(u'slidecontroller_live_next') + else: + Receiver.send_message(event, unicode(datagram[pos + 1:])) + def about(self): about_text = self.trUtf8('Remote Plugin
This plugin ' 'provides the ability to send messages to a running version of ' diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 2c03d13f6..8e8e873a6 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -93,7 +93,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.QObject.connect(self.CCLNumberEdit, QtCore.SIGNAL(u'lostFocus()'), self.onCCLNumberEditLostFocus) 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.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus) QtCore.QObject.connect(self.VerseOrderEdit, @@ -484,16 +484,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): log.debug(u'onPreview') if button.text() == unicode(self.trUtf8('Save && Preview')) \ and self.saveSong(): - Receiver.send_message(u'preview_song') + Receiver.send_message(u'songs_preview') def closePressed(self): - Receiver.send_message(u'remote_edit_clear') + Receiver.send_message(u'songs_edit_clear') self.close() def accept(self): log.debug(u'accept') if self.saveSong(): - Receiver.send_message(u'load_song_list') + Receiver.send_message(u'songs_load_list') self.close() def saveSong(self): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 9b81540e6..fb3f9c3e0 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -122,15 +122,15 @@ class SongMediaItem(MediaManagerItem): QtCore.SIGNAL(u'textChanged(const QString&)'), self.onSearchTextEditChanged) 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.SIGNAL(u'config_updated'), self.configUpdated) 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.SIGNAL(u'%s_edit' % self.parent.name), self.onRemoteEdit) + QtCore.SIGNAL(u'songs_edit'), self.onRemoteEdit) 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): self.searchAsYouType = str_to_bool( diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index cd3470e86..54ea6a352 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -212,7 +212,7 @@ class SongsPlugin(Plugin): + ' included with the Songs of Fellowship Music Editions'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) - Receiver.send_message(u'load_song_list') + Receiver.send_message(u'songs_load_list') def onImportOooItemClick(self): filenames = QtGui.QFileDialog.getOpenFileNames( @@ -220,7 +220,7 @@ class SongsPlugin(Plugin): u'', u'All Files(*.*)') oooimport = OooImport(self.songmanager) oooimport.import_docs(filenames) - Receiver.send_message(u'load_song_list') + Receiver.send_message(u'songs_load_list') def onExportOpenlp1ItemClicked(self): self.openlp_export_form.show() diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 0763e0675..3d7f9ad45 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -107,7 +107,7 @@ class SongUsagePlugin(Plugin): log.info(u'SongUsage Initialising') Plugin.initialise(self) 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.config.get_config(u'active', False)) self.SongUsageStatus.setChecked(self.SongUsageActive) @@ -127,21 +127,22 @@ class SongUsagePlugin(Plugin): self.SongUsageActive = not self.SongUsageActive self.config.set_config(u'active', self.SongUsageActive) - def onReceiveSongUsage(self, SongUsageData): + def onReceiveSongUsage(self, items): """ SongUsage a live song from SlideController """ - if self.SongUsageActive: - SongUsageitem = SongUsageItem() - SongUsageitem.usagedate = datetime.today() - SongUsageitem.usagetime = datetime.now().time() - SongUsageitem.title = SongUsageData[0] - SongUsageitem.copyright = SongUsageData[2] - SongUsageitem.ccl_number = SongUsageData[3] - SongUsageitem.authors = u'' - for author in SongUsageData[1]: - SongUsageitem.authors += author + u' ' - self.songusagemanager.insert_songusage(SongUsageitem) + audit = items[0].audit + if self.SongUsageActive and audit: + song_usage_item = SongUsageItem() + song_usage_item.usagedate = datetime.today() + song_usage_item.usagetime = datetime.now().time() + song_usage_item.title = audit[0] + song_usage_item.copyright = audit[2] + song_usage_item.ccl_number = audit[3] + song_usage_item.authors = u'' + for author in audit[1]: + song_usage_item.authors += author + u' ' + self.songusagemanager.insert_songusage(song_usage_item) def onSongUsageDelete(self): self.SongUsagedeleteform.exec_() diff --git a/resources/forms/alertdialog.ui b/resources/forms/alertdialog.ui index fd4cee5fc..725fb7c4e 100644 --- a/resources/forms/alertdialog.ui +++ b/resources/forms/alertdialog.ui @@ -98,7 +98,7 @@ &New - + :/general/general_new.png:/general/general_new.png @@ -112,29 +112,18 @@ &Save - + :/general/general_save.png:/general/general_save.png - - - - &Edit - - - - :/general/general_edit.png:/general/general_edit.png - - - &Delete - + :/general/general_delete.png:/general/general_delete.png @@ -180,7 +169,7 @@ Displ&ay - + :/general/general_live.png:/general/general_live.png @@ -191,7 +180,7 @@ Display && Cl&ose - + :/general/general_live.png:/general/general_live.png @@ -202,7 +191,7 @@ &Close - + :/system/system_close.png:/system/system_close.png @@ -217,15 +206,12 @@ AlertListWidget NewButton SaveButton - EditButton DeleteButton DisplayButton DisplayCloseButton CloseButton - - - + CloseButton