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

View File

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

View File

@ -49,7 +49,7 @@ class Controller(object):
self.doc = None
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
slidecontroller combination. If the slidecontroller has a display
@ -66,9 +66,17 @@ class Controller(object):
return
if self.is_live:
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()
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
def activate(self):
@ -261,7 +269,7 @@ class MessageListener(object):
is_live = message[1]
item = message[0]
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(),
item.get_frame_title())
self.handler = item.title
@ -273,7 +281,7 @@ class MessageListener(object):
controller = self.live_handler
else:
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):
"""