← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/working into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/working into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Fix screen blanking and clean up unused code.
-- 
https://code.launchpad.net/~trb143/openlp/working/+merge/27452
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/working into lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2010-06-09 17:09:32 +0000
+++ openlp/core/ui/maindisplay.py	2010-06-13 19:50:39 +0000
@@ -133,7 +133,6 @@
         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 @@
             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 @@
                 self.setVisible(True)
                 self.showFullScreen()
         else:
-            self.waitingFrame = frame
-            self.waitingFrameTrans = transition
+            self.storeText = QtGui.QPixmap.fromImage(frame[u'main'])
 
 class VideoDisplay(Phonon.VideoWidget):
     """

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2010-06-06 22:30:11 +0000
+++ openlp/core/ui/mainwindow.py	2010-06-13 19:50:39 +0000
@@ -356,7 +356,7 @@
         """
         MainWindow.mainTitle = translate(u'MainWindow', u'OpenLP 2.0')
         MainWindow.language = translate(u'MainWindow', u'English')
-        MainWindow.defaultThemeText = translate(u'MainWindow', 
+        MainWindow.defaultThemeText = translate(u'MainWindow',
             u'Default Theme: ')
         MainWindow.setWindowTitle(MainWindow.mainTitle)
         self.FileMenu.setTitle(translate(u'MainWindow', u'&File'))
@@ -456,7 +456,7 @@
                 u'Set the interface language to %1').arg(item.objectName()))
         self.ToolsAddToolItem.setText(translate(u'MainWindow', u'Add &Tool...'))
         self.ToolsAddToolItem.setStatusTip(
-            translate(u'MainWindow', 
+            translate(u'MainWindow',
                 u'Add an application to the list of tools'))
         self.action_Preview_Panel.setText(
             translate(u'MainWindow', u'&Preview Pane'))
@@ -652,15 +652,13 @@
         """
         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):

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2010-06-09 17:09:32 +0000
+++ openlp/core/ui/slidecontroller.py	2010-06-13 19:50:39 +0000
@@ -120,6 +120,7 @@
         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 @@
             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 @@
         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 @@
         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 @@
         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 @@
 
     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 @@
                 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)


Follow ups