Fixes: https://launchpad.net/bugs/749296
This commit is contained in:
Andreas Preikschat 2011-04-03 19:51:10 +02:00
parent 4d8a241eca
commit 1c35810fa5
3 changed files with 23 additions and 25 deletions

View File

@ -567,19 +567,36 @@ class SlideController(QtGui.QWidget):
""" """
log.debug(u'processManagerItem live = %s' % self.isLive) log.debug(u'processManagerItem live = %s' % self.isLive)
self.onStopLoop() self.onStopLoop()
# If old item was a command tell it to stop
if self.serviceItem: if self.serviceItem:
# If old item was a command tell it to stop.
if self.serviceItem.is_command(): if self.serviceItem.is_command():
Receiver.send_message(u'%s_stop' % Receiver.send_message(u'%s_stop' %
self.serviceItem.name.lower(), [serviceItem, self.isLive]) self.serviceItem.name.lower(), [serviceItem, self.isLive])
# If the old item had its own display, we have to restore the menu.
if self.isLive and self.serviceItem.is_capable(
ItemCapabilities.ProvidesOwnDisplay):
self.toolbar.actions[u'Hide Menu'].setVisible(True)
action = self.hideMenu.defaultAction()
# Re check the current blank mode, so that the current item will
# not ignore it.
if self.blankScreen == action:
self.onBlankDisplay(action.isChecked())
elif self.themeScreen == action:
self.onThemeDisplay(action.isChecked())
elif self.desktopScreen == action:
self.onHideDisplay(action.isChecked())
if self.serviceItem.is_media(): if self.serviceItem.is_media():
self.onMediaClose() self.onMediaClose()
blanked = False
if self.isLive: if self.isLive:
if serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay): if serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay):
self._forceUnblank() # Hide the menu and the screen. Note, that we do not want to use
blanked = self.blankScreen.isChecked() # onHideDisplay, as we want to be able to restore the current
else: # hide mode.
blanked = False self.toolbar.actions[u'Hide Menu'].setVisible(False)
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
else:
blanked = self.blankScreen.isChecked()
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, blanked, slideno])
self.slideList = {} self.slideList = {}
@ -1094,21 +1111,3 @@ class SlideController(QtGui.QWidget):
self.video.hide() self.video.hide()
self.slidePreview.clear() self.slidePreview.clear()
self.slidePreview.show() self.slidePreview.show()
def _forceUnblank(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')

View File

@ -333,7 +333,6 @@ class MessageListener(object):
""" """
is_live = message[1] is_live = message[1]
if is_live: if is_live:
Receiver.send_message(u'maindisplay_show')
self.live_handler.shutdown() self.live_handler.shutdown()
else: else:
self.preview_handler.shutdown() self.preview_handler.shutdown()

View File

@ -105,7 +105,7 @@ class PresentationDocument(object):
Loads the presentation and starts it Loads the presentation and starts it
``presentation`` ``presentation``
The file name of the presentations to the run. The file name of the presentations to the run.
Returns False if the file could not be opened Returns False if the file could not be opened
""" """