Finish signal refactor

This commit is contained in:
Jonathan Corwin 2010-04-22 22:22:09 +01:00
parent 877af7ea2c
commit fa54f94905
7 changed files with 159 additions and 132 deletions

View File

@ -35,17 +35,80 @@ 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.
``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`` ``theme_update_list``
send out message with new themes send out message with new themes
@ -53,18 +116,6 @@ class EventReceiver(QtCore.QObject):
``theme_update_global`` ``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
``remote_edit_clear`` ``bibles_nobook``
Informs all components that remote edit has been aborted. Attempt to find book resulted in no match
``presentation types`` ``bibles_showprogress``
Informs all components of the presentation types supported. Show progress of bible verse import
``blank_check`` ``bibles_hideprogress``
Check to see if th eblank display message is required Hide progress of bible verse import
``version_check`` ``bibles_stop_import``
Version has changed so pop up window. Stops the Bible Import
``mainDisplay_active``
Version has changed so pop up window.
""" """
def __init__(self): def __init__(self):

View File

@ -422,12 +422,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:

View File

@ -138,7 +138,7 @@ class MainDisplay(DisplayWidget):
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'maindisplay_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'slidecontroller_live_mediastart'), self.hideDisplay) QtCore.SIGNAL(u'videodisplay_start'), self.hideDisplay)
def setup(self): def setup(self):
""" """
@ -195,7 +195,7 @@ class MainDisplay(DisplayWidget):
def resetDisplay(self): def resetDisplay(self):
log.debug(u'resetDisplay') log.debug(u'resetDisplay')
Receiver.send_message(u'maindisplay_stop_loop') Receiver.send_message(u'slidecontroller_live_stop_loop')
if self.primary: if self.primary:
self.setVisible(False) self.setVisible(False)
else: else:
@ -325,13 +325,13 @@ 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'mediacontroller_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'mediacontroller_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'mediacontroller_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'mediacontroller_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'config_updated'), self.setup) QtCore.SIGNAL(u'config_updated'), self.setup)
@ -364,40 +364,29 @@ class VideoDisplay(Phonon.VideoWidget):
self.primary = True self.primary = True
def onMediaQueue(self, message): def onMediaQueue(self, message):
if not message[1]:
return
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[0].get_frame_path(), file = os.path.join(message[0].get_frame_path(),
message[0].get_frame_title()) message[0].get_frame_title())
#file = os.path.join(message[1], message[2])
source = self.mediaObject.setCurrentSource(Phonon.MediaSource(file)) source = self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
self.onMediaPlay() self.onMediaPlay()
def onMediaPlay(self): def onMediaPlay(self):
if not message[1]:
return
log.debug(u'VideoDisplay Play the new media, Live ') log.debug(u'VideoDisplay Play the new media, Live ')
self.mediaObject.play() self.mediaObject.play()
self.setVisible(True) self.setVisible(True)
self.showFullScreen() self.showFullScreen()
def onMediaPause(self): def onMediaPause(self):
if not message[1]:
return
log.debug(u'VideoDisplay Media paused by user') log.debug(u'VideoDisplay Media paused by user')
self.mediaObject.pause() self.mediaObject.pause()
self.show() self.show()
def onMediaStop(self): def onMediaStop(self):
if not message[1]:
return
log.debug(u'VideoDisplay Media stopped by user') log.debug(u'VideoDisplay Media stopped by user')
self.mediaObject.stop() self.mediaObject.stop()
self.onMediaFinish() self.onMediaFinish()
def onMediaFinish(self): def onMediaFinish(self):
if not message[1]:
return
log.debug(u'VideoDisplay Reached end of media playlist') log.debug(u'VideoDisplay Reached end of media playlist')
self.mediaObject.clearQueue() self.mediaObject.clearQueue()
self.setVisible(False) self.setVisible(False)

View File

@ -103,8 +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.serviceNoteForm = ServiceNoteForm() self.serviceNoteForm = ServiceNoteForm()
self.serviceItemEditForm = ServiceItemEditForm() self.serviceItemEditForm = ServiceItemEditForm()
#start with the layout #start with the layout

View File

@ -313,7 +313,8 @@ class SlideController(QtGui.QWidget):
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'maindisplay_stop_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'slidecontroller_%s_first' % self.type_prefix), QtCore.SIGNAL(u'slidecontroller_%s_first' % self.type_prefix),
self.onSlideSelectedFirst) self.onSlideSelectedFirst)
@ -480,7 +481,7 @@ class SlideController(QtGui.QWidget):
blanked = self.blankButton.isChecked() blanked = self.blankButton.isChecked()
else: else:
blanked = False blanked = False
Receiver.send_message(u'slidecontroller_start', Receiver.send_message(u'%s_start' % serviceItem.name.lower(),
[serviceItem, self.isLive, blanked, slideno]) [serviceItem, self.isLive, blanked, slideno])
self.slideList = {} self.slideList = {}
width = self.parent.ControlSplitter.sizes()[self.split] width = self.parent.ControlSplitter.sizes()[self.split]
@ -553,6 +554,10 @@ 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))
#Screen event methods #Screen event methods
@ -562,7 +567,7 @@ class SlideController(QtGui.QWidget):
""" """
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'slidecontroller_first', Receiver.send_message(u'%s_first' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive]) [self.serviceItem, self.isLive])
if self.serviceItem.is_command(): if self.serviceItem.is_command():
self.updatePreview() self.updatePreview()
@ -608,10 +613,11 @@ class SlideController(QtGui.QWidget):
""" """
if self.serviceItem is not None: if self.serviceItem is not None:
if blanked: if blanked:
Receiver.send_message(u'slidecontroller_blank', Receiver.send_message(u'%s_blank' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive]) [self.serviceItem, self.isLive])
else: else:
Receiver.send_message(u'slidecontroller_unblank', Receiver.send_message(u'%s_unblank'
% self.serviceItem.name.lower(),
[self.serviceItem, self.isLive]) [self.serviceItem, self.isLive])
self.parent.mainDisplay.blankDisplay(blankType, blanked) self.parent.mainDisplay.blankDisplay(blankType, blanked)
else: else:
@ -625,7 +631,7 @@ 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'slidecontroller_slide', Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive, row]) [self.serviceItem, self.isLive, row])
if self.serviceItem.is_command() and self.isLive: if self.serviceItem.is_command() and self.isLive:
self.updatePreview() self.updatePreview()
@ -679,7 +685,7 @@ class SlideController(QtGui.QWidget):
""" """
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'slidecontroller_next', Receiver.send_message(u'%s_next' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive]) [self.serviceItem, self.isLive])
if self.serviceItem.is_command(): if self.serviceItem.is_command():
self.updatePreview() self.updatePreview()
@ -703,7 +709,7 @@ class SlideController(QtGui.QWidget):
""" """
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'slidecontroller_previous', Receiver.send_message(u'%s_previous' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive]) [self.serviceItem, self.isLive])
if self.serviceItem.is_command(): if self.serviceItem.is_command():
self.updatePreview() self.updatePreview()
@ -723,7 +729,7 @@ class SlideController(QtGui.QWidget):
""" """
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'slidecontroller_last', Receiver.send_message(u'%s_last' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive]) [self.serviceItem, self.isLive])
if self.serviceItem.is_command(): if self.serviceItem.is_command():
self.updatePreview() self.updatePreview()
@ -755,9 +761,8 @@ class SlideController(QtGui.QWidget):
def onEditSong(self): def onEditSong(self):
self.songEdit = True self.songEdit = True
Receiver.send_message(u'%s_edit' % Receiver.send_message(u'%s_edit' % self.serviceItem.name.lower(),
self.serviceItem.name.lower(), u'P:%s' % u'P:%s' % self.serviceItem.editId)
self.serviceItem.editId)
def onGoLive(self): def onGoLive(self):
""" """
@ -770,12 +775,9 @@ class SlideController(QtGui.QWidget):
def onMediaStart(self, item): def onMediaStart(self, item):
if self.isLive: if self.isLive:
blanked = self.blankButton.isChecked() Receiver.send_message(u'videodisplay_start',
[item, self.blankButton.isChecked()])
else: else:
blanked = False
Receiver.send_message(u'mediacontroller_start',
[item, self.isLive, blanked])
if not self.isLive:
self.mediaObject.stop() self.mediaObject.stop()
self.mediaObject.clearQueue() self.mediaObject.clearQueue()
file = os.path.join(item.get_frame_path(), item.get_frame_title()) file = os.path.join(item.get_frame_path(), item.get_frame_title())
@ -785,23 +787,23 @@ class SlideController(QtGui.QWidget):
self.onMediaPlay() self.onMediaPlay()
def onMediaPause(self): def onMediaPause(self):
Receiver.send_message(u'mediacontroller_pause', if self.isLive:
[item, self.isLive]) Receiver.send_message(u'videodisplay_pause')
if not self.isLive: else:
self.mediaObject.pause() self.mediaObject.pause()
def onMediaPlay(self): def onMediaPlay(self):
Receiver.send_message(u'mediacontroller_play', if self.isLive:
[item, self.isLive]) Receiver.send_message(u'videodisplay_play')
if not self.isLive: else:
self.SlidePreview.hide() self.SlidePreview.hide()
self.video.show() self.video.show()
self.mediaObject.play() self.mediaObject.play()
def onMediaStop(self): def onMediaStop(self):
Receiver.send_message(u'mediacontroller_stop', if self.isLive:
[item, self.isLive]) Receiver.send_message(u'videodisplay_stop')
if not self.isLive: else:
self.mediaObject.stop() self.mediaObject.stop()
self.video.hide() self.video.hide()
self.SlidePreview.clear() self.SlidePreview.clear()

View File

@ -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'slidecontroller_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'slidecontroller_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'slidecontroller_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'slidecontroller_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'slidecontroller_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'slidecontroller_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'slidecontroller_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'slidecontroller_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'slidecontroller_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,9 +212,7 @@ 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
""" """
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
log.debug(u'Startup called with message %s' % message) log.debug(u'Startup called with message %s' % message)
isBlank = message[2] isBlank = message[2]
file = os.path.join(item.get_frame_path(), file = os.path.join(item.get_frame_path(),
@ -231,57 +229,45 @@ class MessageListener(object):
controller.addHandler(self.controllers[self.handler], file, isBlank) controller.addHandler(self.controllers[self.handler], file, isBlank)
def decode_message(self, message): def decode_message(self, message):
return message[0].name.lower(), message[1], message[0] return message[1], message[0]
def slide(self, message): def slide(self, message):
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
if isLive: 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, message): def first(self, message):
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
if isLive: if isLive:
self.liveHandler.first() self.liveHandler.first()
else: else:
self.previewHandler.first() self.previewHandler.first()
def last(self, message): def last(self, message):
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
if isLive: if isLive:
self.liveHandler.last() self.liveHandler.last()
else: else:
self.previewHandler.last() self.previewHandler.last()
def next(self, message): def next(self, message):
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
if isLive: if isLive:
self.liveHandler.next() self.liveHandler.next()
else: else:
self.previewHandler.next() self.previewHandler.next()
def previous(self, message): def previous(self, message):
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
if isLive: if isLive:
self.liveHandler.previous() self.liveHandler.previous()
else: else:
self.previewHandler.previous() self.previewHandler.previous()
def shutdown(self, message): def shutdown(self, message):
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
if isLive: if isLive:
Receiver.send_message(u'maindisplay_show') Receiver.send_message(u'maindisplay_show')
self.liveHandler.shutdown() self.liveHandler.shutdown()
@ -289,16 +275,12 @@ class MessageListener(object):
self.previewHandler.shutdown() self.previewHandler.shutdown()
def blank(self, message): def blank(self, message):
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
if isLive: if isLive:
self.liveHandler.blank() self.liveHandler.blank()
def unblank(self, message): def unblank(self, message):
name, isLive, item = self.decode_message(message) isLive, item = self.decode_message(message)
if name != u'presentation':
return
if isLive: if isLive:
self.liveHandler.unblank() self.liveHandler.unblank()

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'slidecontroller_start'), 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)
@ -132,8 +132,7 @@ class SongUsagePlugin(Plugin):
SongUsage a live song from SlideController SongUsage a live song from SlideController
""" """
audit = items[0].audit audit = items[0].audit
live = items[1] if self.SongUsageActive and audit:
if self.SongUsageActive and audit and live:
song_usage_item = SongUsageItem() song_usage_item = SongUsageItem()
song_usage_item.usagedate = datetime.today() song_usage_item.usagedate = datetime.today()
song_usage_item.usagetime = datetime.now().time() song_usage_item.usagetime = datetime.now().time()