Blanking and switching between song and ppt and back

This commit is contained in:
Jonathan Corwin 2011-04-06 23:54:47 +01:00
parent d5adf802eb
commit 9b04385f34
3 changed files with 30 additions and 28 deletions

View File

@ -569,19 +569,18 @@ class SlideController(QtGui.QWidget):
self.onStopLoop() self.onStopLoop()
# If old item was a command tell it to stop # If old item was a command tell it to stop
if self.serviceItem: if self.serviceItem:
if self.serviceItem.is_command(): oldItem = self.serviceItem
self.serviceItem = None
if oldItem.is_command():
Receiver.send_message(u'%s_stop' % Receiver.send_message(u'%s_stop' %
self.serviceItem.name.lower(), [serviceItem, self.isLive]) oldItem.name.lower(), [oldItem, self.isLive])
if self.serviceItem.is_media(): if oldItem.is_media():
self.onMediaClose() self.onMediaClose()
if self.isLive: if self.isLive and oldItem.is_capable(
if serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay): ItemCapabilities.ProvidesOwnDisplay):
self._forceUnblank() self._resetBlank()
blanked = self.blankScreen.isChecked()
else:
blanked = False
Receiver.send_message(u'%s_start' % serviceItem.name.lower(), Receiver.send_message(u'%s_start' % serviceItem.name.lower(),
[serviceItem, self.isLive, blanked, slideno]) [serviceItem, self.isLive, self.display.hideMode, slideno])
self.slideList = {} self.slideList = {}
width = self.parent.controlSplitter.sizes()[self.split] width = self.parent.controlSplitter.sizes()[self.split]
self.serviceItem = serviceItem self.serviceItem = serviceItem
@ -1095,20 +1094,14 @@ class SlideController(QtGui.QWidget):
self.slidePreview.clear() self.slidePreview.clear()
self.slidePreview.show() self.slidePreview.show()
def _forceUnblank(self): def _resetBlank(self):
""" """
Used by command items which provide their own displays to reset the Used by command items which provide their own displays to reset the
screen hide attributes screen hide attributes
""" """
blank = None if self.blankScreen.isChecked():
if self.blankScreen.isChecked: self.onBlankDisplay(True)
blank = self.blankScreen elif self.themeScreen.isChecked():
if self.themeScreen.isChecked: self.onThemeDisplay(True)
blank = self.themeScreen elif self.desktopScreen.isChecked():
if self.desktopScreen.isChecked: self.onHideDisplay(True)
blank = self.desktopScreen
if blank:
blank.setChecked(False)
self.hideMenu.setDefaultAction(blank)
QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank')

View File

@ -58,6 +58,7 @@ class BibleMediaItem(MediaManagerItem):
MediaManagerItem.__init__(self, parent, plugin, icon) MediaManagerItem.__init__(self, parent, plugin, icon)
# Place to store the search results for both bibles. # Place to store the search results for both bibles.
self.settings = self.parent.settings_tab self.settings = self.parent.settings_tab
self.quickPreviewAllowed = True
self.search_results = {} self.search_results = {}
self.second_search_results = {} self.second_search_results = {}
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),

View File

@ -49,7 +49,7 @@ class Controller(object):
self.doc = None self.doc = None
log.info(u'%s controller loaded' % live) log.info(u'%s controller loaded' % live)
def add_handler(self, controller, file, is_blank): def add_handler(self, controller, file, hide_mode):
""" """
Add a handler, which is an instance of a presentation and Add a handler, which is an instance of a presentation and
slidecontroller combination. If the slidecontroller has a display slidecontroller combination. If the slidecontroller has a display
@ -66,9 +66,17 @@ class Controller(object):
return return
if self.is_live: if self.is_live:
self.doc.start_presentation() self.doc.start_presentation()
if is_blank: if hide_mode == HideMode.Screen:
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
self.stop()
elif hide_mode == HideMode.Theme:
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
self.blank() self.blank()
Receiver.send_message(u'maindisplay_hide', HideMode.Screen) elif hide_mode == HideMode.Blank:
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
self.blank()
else:
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
self.doc.slidenumber = 0 self.doc.slidenumber = 0
def activate(self): def activate(self):
@ -261,7 +269,7 @@ class MessageListener(object):
is_live = message[1] is_live = message[1]
item = message[0] item = message[0]
log.debug(u'Startup called with message %s' % message) log.debug(u'Startup called with message %s' % message)
is_blank = message[2] hide_mode = message[2]
file = os.path.join(item.get_frame_path(), file = os.path.join(item.get_frame_path(),
item.get_frame_title()) item.get_frame_title())
self.handler = item.title self.handler = item.title
@ -273,7 +281,7 @@ class MessageListener(object):
controller = self.live_handler controller = self.live_handler
else: else:
controller = self.preview_handler controller = self.preview_handler
controller.add_handler(self.controllers[self.handler], file, is_blank) controller.add_handler(self.controllers[self.handler], file, hide_mode)
def slide(self, message): def slide(self, message):
""" """