Merge lp:~googol-deactivatedaccount/openlp/bug-970436 into lp:openlp

Proposed by Andreas Preikschat
Status: Merged
Approved by: Tim Bentley
Approved revision: 1939
Merged at revision: 1939
Proposed branch: lp:~googol-deactivatedaccount/openlp/bug-970436
Merge into: lp:openlp
Diff against target: 197 lines (+30/-37)
2 files modified
openlp/core/ui/generaltab.py (+12/-15)
openlp/core/ui/maindisplay.py (+18/-22)
To merge this branch: bzr merge lp:~googol-deactivatedaccount/openlp/bug-970436
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Jonathan Corwin (community) Approve
Review via email: mp+101226@code.launchpad.net

This proposal supersedes a proposal from 2012-04-08.

Commit message

bzr merge lp:~googol/openlp/bug-970436 && bzr commit -m "fixed bug 970436 ('Display if a single screen' always in effect) and clean ups" --fixes lp:970436 --author="Andreas Preikschat <email address hidden>"

Description of the change

Hello,
- fixed bug 970436 ('Display if a single screen' always in effect)
- removed not needed attribute
- simplification + comment fixes

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Jonathan Corwin (j-corwin) wrote : Posted in a previous version of this proposal

I was expecting this to be fixed the other way around. Allow the "Display if single screen" to still be selectable when an override monitor is used.

For example I set the override screen dimensions to mirror my church projector (1024x768) on my home computer so my themes are the correct dimensions. However I don't want it to appear so I uncheck the display if single monitor setting.

Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal

> I was expecting this to be fixed the other way around. Allow the "Display if
> single screen" to still be selectable when an override monitor is used.

I was thinking the same thing, but I decided to do it not like this.

> For example I set the override screen dimensions to mirror my church projector
> (1024x768) on my home computer so my themes are the correct dimensions.
> However I don't want it to appear so I uncheck the display if single monitor
> setting.

However, this is a good example and it convinced me. I am going to change this!

Revision history for this message
Jonathan Corwin (j-corwin) :
review: Approve
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/generaltab.py'
2--- openlp/core/ui/generaltab.py 2012-03-12 19:35:29 +0000
3+++ openlp/core/ui/generaltab.py 2012-04-09 10:31:20 +0000
4@@ -65,42 +65,42 @@
5 self.monitorComboBox = QtGui.QComboBox(self.monitorGroupBox)
6 self.monitorComboBox.setObjectName(u'monitorComboBox')
7 self.monitorLayout.addWidget(self.monitorComboBox, 1, 1, 1, 4)
8- self.displayOnMonitorCheck = QtGui.QCheckBox(self.monitorGroupBox)
9- self.displayOnMonitorCheck.setObjectName(u'monitorComboBox')
10- self.monitorLayout.addWidget(self.displayOnMonitorCheck, 2, 1, 1, 4)
11 # Display Position
12 self.overrideRadioButton = QtGui.QRadioButton(self.monitorGroupBox)
13 self.overrideRadioButton.setObjectName(u'overrideRadioButton')
14- self.monitorLayout.addWidget(self.overrideRadioButton, 3, 0, 1, 5)
15+ self.monitorLayout.addWidget(self.overrideRadioButton, 2, 0, 1, 5)
16 # Custom position
17 self.customXLabel = QtGui.QLabel(self.monitorGroupBox)
18 self.customXLabel.setObjectName(u'customXLabel')
19- self.monitorLayout.addWidget(self.customXLabel, 4, 1)
20+ self.monitorLayout.addWidget(self.customXLabel, 3, 1)
21 self.customXValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
22 self.customXValueEdit.setObjectName(u'customXValueEdit')
23 self.customXValueEdit.setRange(-9999, 9999)
24- self.monitorLayout.addWidget(self.customXValueEdit, 5, 1)
25+ self.monitorLayout.addWidget(self.customXValueEdit, 4, 1)
26 self.customYLabel = QtGui.QLabel(self.monitorGroupBox)
27 self.customYLabel.setObjectName(u'customYLabel')
28- self.monitorLayout.addWidget(self.customYLabel, 4, 2)
29+ self.monitorLayout.addWidget(self.customYLabel, 3, 2)
30 self.customYValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
31 self.customYValueEdit.setObjectName(u'customYValueEdit')
32 self.customYValueEdit.setRange(-9999, 9999)
33- self.monitorLayout.addWidget(self.customYValueEdit, 5, 2)
34+ self.monitorLayout.addWidget(self.customYValueEdit, 4, 2)
35 self.customWidthLabel = QtGui.QLabel(self.monitorGroupBox)
36 self.customWidthLabel.setObjectName(u'customWidthLabel')
37- self.monitorLayout.addWidget(self.customWidthLabel, 4, 3)
38+ self.monitorLayout.addWidget(self.customWidthLabel, 3, 3)
39 self.customWidthValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
40 self.customWidthValueEdit.setObjectName(u'customWidthValueEdit')
41 self.customWidthValueEdit.setMaximum(9999)
42- self.monitorLayout.addWidget(self.customWidthValueEdit, 5, 3)
43+ self.monitorLayout.addWidget(self.customWidthValueEdit, 4, 3)
44 self.customHeightLabel = QtGui.QLabel(self.monitorGroupBox)
45 self.customHeightLabel.setObjectName(u'customHeightLabel')
46- self.monitorLayout.addWidget(self.customHeightLabel, 4, 4)
47+ self.monitorLayout.addWidget(self.customHeightLabel, 3, 4)
48 self.customHeightValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
49 self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
50 self.customHeightValueEdit.setMaximum(9999)
51- self.monitorLayout.addWidget(self.customHeightValueEdit, 5, 4)
52+ self.monitorLayout.addWidget(self.customHeightValueEdit, 4, 4)
53+ self.displayOnMonitorCheck = QtGui.QCheckBox(self.monitorGroupBox)
54+ self.displayOnMonitorCheck.setObjectName(u'monitorComboBox')
55+ self.monitorLayout.addWidget(self.displayOnMonitorCheck, 5, 0, 1, 5)
56 # Set up the stretchiness of each column, so that the first column
57 # less stretchy (and therefore smaller) than the others
58 self.monitorLayout.setColumnStretch(0, 1)
59@@ -314,8 +314,6 @@
60 u'audio repeat list', QtCore.QVariant(False)).toBool())
61 settings.endGroup()
62 self.monitorComboBox.setDisabled(self.overrideRadioButton.isChecked())
63- self.displayOnMonitorCheck.setDisabled(
64- self.overrideRadioButton.isChecked())
65 self.customXValueEdit.setEnabled(self.overrideRadioButton.isChecked())
66 self.customYValueEdit.setEnabled(self.overrideRadioButton.isChecked())
67 self.customHeightValueEdit.setEnabled(
68@@ -408,7 +406,6 @@
69 The state of the check box (boolean).
70 """
71 self.monitorComboBox.setDisabled(checked)
72- self.displayOnMonitorCheck.setDisabled(checked)
73 self.customXValueEdit.setEnabled(checked)
74 self.customYValueEdit.setEnabled(checked)
75 self.customHeightValueEdit.setEnabled(checked)
76
77=== modified file 'openlp/core/ui/maindisplay.py'
78--- openlp/core/ui/maindisplay.py 2012-03-06 19:37:27 +0000
79+++ openlp/core/ui/maindisplay.py 2012-04-09 10:31:20 +0000
80@@ -221,11 +221,6 @@
81 self.webView.setHtml(build_html(serviceItem, self.screen,
82 self.isLive, None, plugins=self.plugins))
83 self.__hideMouse()
84- # To display or not to display?
85- if not self.screen[u'primary']:
86- self.primary = False
87- else:
88- self.primary = True
89 log.debug(u'Finished MainDisplay setup')
90
91 def text(self, slide):
92@@ -253,10 +248,10 @@
93 log.debug(u'alert to display')
94 # First we convert <>& marks to html variants, then apply
95 # formattingtags, finally we double all backslashes for JavaScript.
96- text_prepared = expand_tags(cgi.escape(text)) \
97- .replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')
98- if self.height() != self.screen[u'size'].height() or \
99- not self.isVisible():
100+ text_prepared = expand_tags(
101+ cgi.escape(text)).replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')
102+ if self.height() != self.screen[u'size'].height() or not \
103+ self.isVisible():
104 shrink = True
105 js = u'show_alert("%s", "%s")' % (text_prepared, u'top')
106 else:
107@@ -336,7 +331,7 @@
108 """
109 log.debug(u'preview for %s', self.isLive)
110 Receiver.send_message(u'openlp_process_events')
111- # We must have a service item to preview
112+ # We must have a service item to preview.
113 if self.isLive and hasattr(self, u'serviceItem'):
114 # Wait for the fade to finish before geting the preview.
115 # Important otherwise preview will have incorrect text if at all!
116@@ -345,7 +340,7 @@
117 while self.frame.evaluateJavaScript(u'show_text_complete()') \
118 .toString() == u'false':
119 Receiver.send_message(u'openlp_process_events')
120- # Wait for the webview to update before geting the preview.
121+ # Wait for the webview to update before getting the preview.
122 # Important otherwise first preview will miss the background !
123 while not self.webLoaded:
124 Receiver.send_message(u'openlp_process_events')
125@@ -356,7 +351,7 @@
126 else:
127 # Single screen active
128 if self.screens.display_count == 1:
129- # Only make visible if setting enabled
130+ # Only make visible if setting enabled.
131 if QtCore.QSettings().value(u'general/display on monitor',
132 QtCore.QVariant(True)).toBool():
133 self.setVisible(True)
134@@ -374,9 +369,9 @@
135 self.initialFrame = None
136 self.serviceItem = serviceItem
137 background = None
138- # We have an image override so keep the image till the theme changes
139+ # We have an image override so keep the image till the theme changes.
140 if self.override:
141- # We have an video override so allow it to be stopped
142+ # We have an video override so allow it to be stopped.
143 if u'video' in self.override:
144 Receiver.send_message(u'video_background_replaced')
145 self.override = {}
146@@ -429,7 +424,7 @@
147 """
148 log.debug(u'hideDisplay mode = %d', mode)
149 if self.screens.display_count == 1:
150- # Only make visible if setting enabled
151+ # Only make visible if setting enabled.
152 if not QtCore.QSettings().value(u'general/display on monitor',
153 QtCore.QVariant(True)).toBool():
154 return
155@@ -454,7 +449,7 @@
156 """
157 log.debug(u'showDisplay')
158 if self.screens.display_count == 1:
159- # Only make visible if setting enabled
160+ # Only make visible if setting enabled.
161 if not QtCore.QSettings().value(u'general/display on monitor',
162 QtCore.QVariant(True)).toBool():
163 return
164@@ -462,12 +457,14 @@
165 if self.isHidden():
166 self.setVisible(True)
167 self.hideMode = None
168- # Trigger actions when display is active again
169+ # Trigger actions when display is active again.
170 if self.isLive:
171 Receiver.send_message(u'live_display_active')
172
173 def __hideMouse(self):
174- # Hide mouse cursor when moved over display if enabled in settings
175+ """
176+ Hide mouse cursor when moved over display.
177+ """
178 if QtCore.QSettings().value(u'advanced/hide mouse',
179 QtCore.QVariant(False)).toBool():
180 self.setCursor(QtCore.Qt.BlankCursor)
181@@ -569,13 +566,12 @@
182 """
183 Add another file to the playlist.
184
185- ``filename``
186- The file to add to the playlist.
187+ ``filenames``
188+ A list with files to be added to the playlist.
189 """
190 if not isinstance(filenames, list):
191 filenames = [filenames]
192- for filename in filenames:
193- self.playlist.append(Phonon.MediaSource(filename))
194+ self.playlist.extend(map(Phonon.MediaSource, filenames))
195
196 def next(self):
197 if not self.repeat and self.currentIndex + 1 == len(self.playlist):