forked from openlp/openlp
Fix problems with screen blanking
bzr-revno: 843
This commit is contained in:
commit
b8293a247c
@ -133,7 +133,6 @@ class MainDisplay(DisplayWidget):
|
||||
self.display_alert = QtGui.QLabel(self)
|
||||
self.display_alert.setScaledContents(True)
|
||||
self.primary = True
|
||||
self.displayBlank = False
|
||||
self.blankFrame = None
|
||||
self.frame = None
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
@ -280,15 +279,15 @@ class MainDisplay(DisplayWidget):
|
||||
self.display_alert.setPixmap(frame)
|
||||
self.moveToTop()
|
||||
|
||||
def frameView(self, frame, transition=False):
|
||||
def frameView(self, frame, transition=False, display=True):
|
||||
"""
|
||||
Called from a slide controller to display a frame
|
||||
if the alert is in progress the alert is added on top
|
||||
``frame``
|
||||
Image frame to be rendered
|
||||
"""
|
||||
log.debug(u'frameView %d' % (self.displayBlank))
|
||||
if not self.displayBlank:
|
||||
log.debug(u'frameView %d' % (display))
|
||||
if display:
|
||||
if transition:
|
||||
if self.frame is not None:
|
||||
self.display_text.setPixmap(
|
||||
@ -314,8 +313,7 @@ class MainDisplay(DisplayWidget):
|
||||
self.setVisible(True)
|
||||
self.showFullScreen()
|
||||
else:
|
||||
self.waitingFrame = frame
|
||||
self.waitingFrameTrans = transition
|
||||
self.storeText = QtGui.QPixmap.fromImage(frame[u'main'])
|
||||
|
||||
class VideoDisplay(Phonon.VideoWidget):
|
||||
"""
|
||||
|
@ -652,15 +652,13 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
"""
|
||||
settings = QtCore.QSettings()
|
||||
settings.beginGroup(self.generalSettingsSection)
|
||||
if settings.value(u'screen blank', QtCore.QVariant(False)).toBool() \
|
||||
and settings.value(u'blank warning', QtCore.QVariant(False)).toBool():
|
||||
self.LiveController.onBlankDisplay(True)
|
||||
QtGui.QMessageBox.question(self,
|
||||
translate(u'MainWindow', u'OpenLP Main Display Blanked'),
|
||||
translate(u'MainWindow',
|
||||
u'The Main Display has been blanked out'),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
|
||||
QtGui.QMessageBox.Ok)
|
||||
if settings.value(u'screen blank', QtCore.QVariant(False)).toBool():
|
||||
self.LiveController.mainDisplaySetBackground()
|
||||
if settings.value(u'blank warning', QtCore.QVariant(False)).toBool():
|
||||
QtGui.QMessageBox.question(self,
|
||||
translate(u'MainWindow', u'OpenLP Main Display Blanked'),
|
||||
translate(u'MainWindow',
|
||||
u'The Main Display has been blanked out'))
|
||||
settings.endGroup()
|
||||
|
||||
def versionThread(self):
|
||||
|
@ -120,6 +120,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.serviceItem = None
|
||||
self.Panel = QtGui.QWidget(parent.ControlSplitter)
|
||||
self.slideList = {}
|
||||
self.canDisplay = True
|
||||
# Layout for holding panel
|
||||
self.PanelLayout = QtGui.QVBoxLayout(self.Panel)
|
||||
self.PanelLayout.setSpacing(0)
|
||||
@ -651,6 +652,12 @@ class SlideController(QtGui.QWidget):
|
||||
self.PreviewListWidget.selectRow(index)
|
||||
self.onSlideSelected()
|
||||
|
||||
def mainDisplaySetBackground(self):
|
||||
"""
|
||||
Allow the main display to blank the main display at startup time
|
||||
"""
|
||||
self.blankButton.setChecked(True)
|
||||
|
||||
def onSlideBlank(self):
|
||||
"""
|
||||
Handle the slidecontroller blank event
|
||||
@ -670,6 +677,7 @@ class SlideController(QtGui.QWidget):
|
||||
log.debug(u'onBlankDisplay %d' % checked)
|
||||
self.hideButton.setChecked(False)
|
||||
self.themeButton.setChecked(False)
|
||||
self.canDisplay = not checked
|
||||
QtCore.QSettings().setValue(
|
||||
self.parent.generalSettingsSection + u'/screen blank',
|
||||
QtCore.QVariant(checked))
|
||||
@ -687,6 +695,7 @@ class SlideController(QtGui.QWidget):
|
||||
log.debug(u'onThemeDisplay %d' % checked)
|
||||
self.blankButton.setChecked(False)
|
||||
self.hideButton.setChecked(False)
|
||||
self.canDisplay = False
|
||||
if checked:
|
||||
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
||||
self.blankPlugin(True)
|
||||
@ -701,6 +710,7 @@ class SlideController(QtGui.QWidget):
|
||||
log.debug(u'onHideDisplay %d' % checked)
|
||||
self.blankButton.setChecked(False)
|
||||
self.themeButton.setChecked(False)
|
||||
self.canDisplay = False
|
||||
if checked:
|
||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||
self.hidePlugin(True)
|
||||
@ -710,7 +720,7 @@ class SlideController(QtGui.QWidget):
|
||||
|
||||
def blankPlugin(self, blank):
|
||||
"""
|
||||
Blank the display screen.
|
||||
Blank the display screen within a plugin if required.
|
||||
"""
|
||||
if self.serviceItem is not None:
|
||||
if blank:
|
||||
@ -770,7 +780,7 @@ class SlideController(QtGui.QWidget):
|
||||
log.log(
|
||||
15, u'Slide Rendering took %4s' % (time.time() - before))
|
||||
if self.isLive:
|
||||
self.mainDisplay.frameView(frame, True)
|
||||
self.mainDisplay.frameView(frame, True, self.canDisplay)
|
||||
self.selectedRow = row
|
||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||
row)
|
||||
|
Loading…
Reference in New Issue
Block a user