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

Proposed by Jonathan Corwin
Status: Merged
Merged at revision: 1857
Proposed branch: lp:~j-corwin/openlp/bug-907792
Merge into: lp:openlp
Diff against target: 89 lines (+30/-2)
4 files modified
openlp/core/ui/firsttimeform.py (+2/-0)
openlp/core/ui/maindisplay.py (+10/-0)
openlp/core/ui/screen.py (+15/-0)
openlp/core/ui/slidecontroller.py (+3/-2)
To merge this branch: bzr merge lp:~j-corwin/openlp/bug-907792
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Andreas Preikschat Pending
Review via email: mp+86839@code.launchpad.net

This proposal supersedes a proposal from 2011-12-23.

Description of the change

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.)

To post a comment you must log in.
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal

Only minor things:

- Please fix your docstring in line 51+52.

Return the Screen number that the centre of the passed window is in.

    ``window``
        bla bla

- Please remove line 61.

review: Needs Fixing
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/ui/firsttimeform.py'
2--- openlp/core/ui/firsttimeform.py 2011-12-02 21:13:05 +0000
3+++ openlp/core/ui/firsttimeform.py 2011-12-23 22:01:25 +0000
4@@ -421,6 +421,8 @@
5 if self.displayComboBox.currentIndex() != -1:
6 QtCore.QSettings().setValue(u'General/monitor',
7 QtCore.QVariant(self.displayComboBox.currentIndex()))
8+ self.screens.set_current_display(
9+ self.displayComboBox.currentIndex())
10 # Set Global Theme
11 if self.themeComboBox.currentIndex() != -1:
12 QtCore.QSettings().setValue(u'themes/global theme',
13
14=== modified file 'openlp/core/ui/maindisplay.py'
15--- openlp/core/ui/maindisplay.py 2011-12-22 21:36:22 +0000
16+++ openlp/core/ui/maindisplay.py 2011-12-23 22:01:25 +0000
17@@ -416,6 +416,11 @@
18 Store the images so they can be replaced when required
19 """
20 log.debug(u'hideDisplay mode = %d', mode)
21+ if self.screens.display_count == 1:
22+ # Only make visible if setting enabled
23+ if not QtCore.QSettings().value(u'general/display on monitor',
24+ QtCore.QVariant(True)).toBool():
25+ return
26 if mode == HideMode.Screen:
27 self.frame.evaluateJavaScript(u'show_blank("desktop");')
28 self.setVisible(False)
29@@ -436,6 +441,11 @@
30 Make the stored images None to release memory.
31 """
32 log.debug(u'showDisplay')
33+ if self.screens.display_count == 1:
34+ # Only make visible if setting enabled
35+ if not QtCore.QSettings().value(u'general/display on monitor',
36+ QtCore.QVariant(True)).toBool():
37+ return
38 self.frame.evaluateJavaScript('show_blank("show");')
39 if self.isHidden():
40 self.setVisible(True)
41
42=== modified file 'openlp/core/ui/screen.py'
43--- openlp/core/ui/screen.py 2011-06-12 16:02:52 +0000
44+++ openlp/core/ui/screen.py 2011-12-23 22:01:25 +0000
45@@ -222,6 +222,21 @@
46 log.debug(u'reset_current_display')
47 self.set_current_display(self.current[u'number'])
48
49+ def which_screen(self, window):
50+ """
51+ Return the screen number that the centre of the passed window is in.
52+
53+ ``window``
54+ A QWidget we are finding the location of.
55+ """
56+ x = window.x() + (window.width() / 2)
57+ y = window.y() + (window.height() / 2)
58+ for screen in self.screen_list:
59+ size = screen[u'size']
60+ if x >= size.x() and x <= (size.x() + size.width()) \
61+ and y >= size.y() and y <= (size.y() + size.height()):
62+ return screen[u'number']
63+
64 def _load_screen_settings(self):
65 """
66 Loads the screen size and the monitor number from the settings.
67
68=== modified file 'openlp/core/ui/slidecontroller.py'
69--- openlp/core/ui/slidecontroller.py 2011-12-15 18:59:25 +0000
70+++ openlp/core/ui/slidecontroller.py 2011-12-23 22:01:25 +0000
71@@ -956,7 +956,8 @@
72 display_type = QtCore.QSettings().value(
73 self.parent().generalSettingsSection + u'/screen blank',
74 QtCore.QVariant(u'')).toString()
75- if not self.display.primary:
76+ if self.screens.which_screen(self.window()) != \
77+ self.screens.which_screen(self.display):
78 # Order done to handle initial conversion
79 if display_type == u'themed':
80 self.onThemeDisplay(True)
81@@ -967,7 +968,7 @@
82 else:
83 Receiver.send_message(u'live_display_show')
84 else:
85- Receiver.send_message(u'live_display_hide', HideMode.Screen)
86+ self.liveEscape()
87
88 def onSlideBlank(self):
89 """