← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~j-corwin/openlp/bug-907792 into lp:openlp

 

Jonathan Corwin has proposed merging lp:~j-corwin/openlp/bug-907792 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #907783 in OpenLP: "Ubuntu 11.10 - Display not on second monitor"
  https://bugs.launchpad.net/openlp/+bug/907783
  Bug #907792 in OpenLP: "Main display covering application window at program start"
  https://bugs.launchpad.net/openlp/+bug/907792

For more details, see:
https://code.launchpad.net/~j-corwin/openlp/bug-907792/+merge/86824

1. If the display window is on the same monitor as the application window, the display window will no longer ever display at program start

2. If the "Display if single monitor" setting is set it will consistently show the output when the user goes live on something. If unset the display will no longer show if the user clicks the hide/show screen buttons.

3. Selecting a different monitor to the default in the First Time Wizard will now open the display window on the selected monitor.

(For after 1.9.8 release.)
-- 
https://code.launchpad.net/~j-corwin/openlp/bug-907792/+merge/86824
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/bug-907792 into lp:openlp.
=== modified file 'openlp/core/ui/firsttimeform.py'
--- openlp/core/ui/firsttimeform.py	2011-12-02 21:13:05 +0000
+++ openlp/core/ui/firsttimeform.py	2011-12-23 18:52:25 +0000
@@ -421,6 +421,8 @@
         if self.displayComboBox.currentIndex() != -1:
             QtCore.QSettings().setValue(u'General/monitor',
                 QtCore.QVariant(self.displayComboBox.currentIndex()))
+            self.screens.set_current_display(
+                 self.displayComboBox.currentIndex())
         # Set Global Theme
         if self.themeComboBox.currentIndex() != -1:
             QtCore.QSettings().setValue(u'themes/global theme',

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2011-12-22 21:36:22 +0000
+++ openlp/core/ui/maindisplay.py	2011-12-23 18:52:25 +0000
@@ -416,6 +416,11 @@
         Store the images so they can be replaced when required
         """
         log.debug(u'hideDisplay mode = %d', mode)
+        if self.screens.display_count == 1:
+            # Only make visible if setting enabled
+            if not QtCore.QSettings().value(u'general/display on monitor',
+                QtCore.QVariant(True)).toBool():
+                return
         if mode == HideMode.Screen:
             self.frame.evaluateJavaScript(u'show_blank("desktop");')
             self.setVisible(False)
@@ -436,6 +441,11 @@
         Make the stored images None to release memory.
         """
         log.debug(u'showDisplay')
+        if self.screens.display_count == 1:
+            # Only make visible if setting enabled
+            if not QtCore.QSettings().value(u'general/display on monitor',
+                QtCore.QVariant(True)).toBool():
+                return
         self.frame.evaluateJavaScript('show_blank("show");')
         if self.isHidden():
             self.setVisible(True)

=== modified file 'openlp/core/ui/screen.py'
--- openlp/core/ui/screen.py	2011-06-12 16:02:52 +0000
+++ openlp/core/ui/screen.py	2011-12-23 18:52:25 +0000
@@ -222,6 +222,20 @@
         log.debug(u'reset_current_display')
         self.set_current_display(self.current[u'number'])
 
+    def which_screen(self, window):
+        """
+        Return the Screen number that the centre of the passed window is in
+        Window is a QWidget
+        """
+        x = window.x() + (window.width() / 2)
+        y = window.y() + (window.height() / 2)
+        for screen in self.screen_list:
+            size = screen[u'size']
+            if x >= size.x() and x <= (size.x() + size.width()) \
+                and y >= size.y() and y <= (size.y() + size.height()):
+                return screen[u'number']
+        return None
+
     def _load_screen_settings(self):
         """
         Loads the screen size and the monitor number from the settings.

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2011-12-15 18:59:25 +0000
+++ openlp/core/ui/slidecontroller.py	2011-12-23 18:52:25 +0000
@@ -956,7 +956,8 @@
         display_type = QtCore.QSettings().value(
             self.parent().generalSettingsSection + u'/screen blank',
             QtCore.QVariant(u'')).toString()
-        if not self.display.primary:
+        if self.screens.which_screen(self.window()) != \
+            self.screens.which_screen(self.display):
             # Order done to handle initial conversion
             if display_type == u'themed':
                 self.onThemeDisplay(True)
@@ -967,7 +968,7 @@
             else:
                 Receiver.send_message(u'live_display_show')
         else:
-            Receiver.send_message(u'live_display_hide', HideMode.Screen)
+            self.liveEscape()
 
     def onSlideBlank(self):
         """


Follow ups