Fix bug where blank hides the screen on restart.

Presentations unblank the screen and reset the display flags and setting.

Fixes: https://launchpad.net/bugs/660448
This commit is contained in:
Tim Bentley 2010-12-30 09:13:39 +00:00
parent 363ff7c143
commit cd74645379
3 changed files with 27 additions and 6 deletions

View File

@ -58,7 +58,7 @@ class ItemCapabilities(object):
NoLineBreaks = 7
OnLoadUpdate = 8
AddIfNewItem = 9
ProvidesOwnDisplay = 10
class ServiceItem(object):
"""
@ -397,4 +397,4 @@ class ServiceItem(object):
"""
Returns the path of the raw frame
"""
return self._raw_frames[row][u'path']
return self._raw_frames[row][u'path']

View File

@ -393,6 +393,7 @@ class SlideController(QtGui.QWidget):
"""
# We need to make this circuit, because we have to consider the other
# slidecontroller as well.
log.debug(u'paintEvent live = %s' % self.isLive)
self.parent.previewController.previewSizeChanged()
self.parent.liveController.previewSizeChanged()
@ -561,6 +562,8 @@ class SlideController(QtGui.QWidget):
if self.serviceItem.is_media():
self.onMediaClose()
if self.isLive:
if serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay):
self._forceUnblank()
blanked = self.BlankScreen.isChecked()
else:
blanked = False
@ -568,8 +571,6 @@ class SlideController(QtGui.QWidget):
[serviceItem, self.isLive, blanked, slideno])
self.slideList = {}
width = self.parent.ControlSplitter.sizes()[self.split]
# Set pointing cursor when we have something to point at
self.PreviewListWidget.setCursor(QtCore.Qt.PointingHandCursor)
self.serviceItem = serviceItem
self.PreviewListWidget.clear()
self.PreviewListWidget.setRowCount(0)
@ -698,7 +699,7 @@ class SlideController(QtGui.QWidget):
"""
log.debug(u'mainDisplaySetBackground live = %s' % self.isLive)
if not self.display.primary:
self.onHideDisplay(True)
self.onBlankDisplay(True)
def onSlideBlank(self):
"""
@ -1041,3 +1042,22 @@ class SlideController(QtGui.QWidget):
self.video.hide()
self.SlidePreview.clear()
self.SlidePreview.show()
def _forceUnblank(self):
"""
Used by command items which provide their own displays to reset the
screen hide attributes
"""
if self.BlankScreen.isChecked:
self.BlankScreen.setChecked(False)
self.HideMenu.setDefaultAction(self.BlankScreen)
QtCore.QSettings().setValue(
self.parent.generalSettingsSection + u'/screen blank',
QtCore.QVariant(False))
if self.ThemeScreen.isChecked:
self.ThemeScreen.setChecked(False)
self.HideMenu.setDefaultAction(self.ThemeScreen)
if self.DesktopScreen.isChecked:
self.DesktopScreen.setChecked(False)
self.HideMenu.setDefaultAction(self.DesktopScreen)

View File

@ -30,7 +30,7 @@ import os
from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
SettingsManager, translate, check_item_selected, Receiver
SettingsManager, translate, check_item_selected, Receiver, ItemCapabilities
from openlp.plugins.presentations.lib import MessageListener
log = logging.getLogger(__name__)
@ -249,6 +249,7 @@ class PresentationMediaItem(MediaManagerItem):
return False
service_item.title = unicode(self.DisplayTypeComboBox.currentText())
service_item.shortname = unicode(self.DisplayTypeComboBox.currentText())
service_item.add_capability(ItemCapabilities.ProvidesOwnDisplay)
shortname = service_item.shortname
if shortname:
for item in items: