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

Proposed by Jonathan Corwin
Status: Merged
Merged at revision: 1867
Proposed branch: lp:~j-corwin/openlp/bug-908362
Merge into: lp:openlp
Diff against target: 140 lines (+41/-3)
3 files modified
openlp/core/ui/advancedtab.py (+32/-1)
openlp/core/ui/maindisplay.py (+2/-1)
openlp/plugins/presentations/lib/presentationtab.py (+7/-1)
To merge this branch: bzr merge lp:~j-corwin/openlp/bug-908362
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Tim Bentley Approve
Review via email: mp+87850@code.launchpad.net

Description of the change

Given that attempting to detect whether we should be bypassing the X11 display manager appears to be an inexact science, it's probably best to add a setting and let the user choose which works best for them.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :

Ronseal varnish

review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) :
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/advancedtab.py'
2--- openlp/core/ui/advancedtab.py 2011-12-27 10:33:55 +0000
3+++ openlp/core/ui/advancedtab.py 2012-01-07 12:16:26 +0000
4@@ -29,7 +29,7 @@
5 """
6 from PyQt4 import QtCore, QtGui
7
8-from openlp.core.lib import SettingsTab, translate, build_icon
9+from openlp.core.lib import SettingsTab, translate, build_icon, Receiver
10 from openlp.core.lib.ui import UiStrings
11 from openlp.core.utils import get_images_filter
12
13@@ -42,6 +42,7 @@
14 """
15 Initialise the settings tab
16 """
17+ self.display_changed = False
18 advancedTranslated = translate('OpenLP.AdvancedTab', 'Advanced')
19 self.default_image = u':/graphics/openlp-splash-screen.png'
20 self.default_color = u'#ffffff'
21@@ -122,6 +123,14 @@
22 self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
23 self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
24 self.rightLayout.addWidget(self.hideMouseGroupBox)
25+ self.x11GroupBox = QtGui.QGroupBox(self.leftColumn)
26+ self.x11GroupBox.setObjectName(u'x11GroupBox')
27+ self.x11Layout = QtGui.QVBoxLayout(self.x11GroupBox)
28+ self.x11Layout.setObjectName(u'x11Layout')
29+ self.x11BypassCheckBox = QtGui.QCheckBox(self.x11GroupBox)
30+ self.x11BypassCheckBox.setObjectName(u'x11BypassCheckBox')
31+ self.x11Layout.addWidget(self.x11BypassCheckBox)
32+ self.rightLayout.addWidget(self.x11GroupBox)
33 self.rightLayout.addStretch()
34
35 QtCore.QObject.connect(self.defaultColorButton,
36@@ -130,6 +139,8 @@
37 QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
38 QtCore.QObject.connect(self.defaultRevertButton,
39 QtCore.SIGNAL(u'pressed()'), self.onDefaultRevertButtonPressed)
40+ QtCore.QObject.connect(self.x11BypassCheckBox,
41+ QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled)
42
43 def retranslateUi(self):
44 """
45@@ -167,6 +178,10 @@
46 'Browse for an image file to display.'))
47 self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab',
48 'Revert to the default OpenLP logo.'))
49+ self.x11GroupBox.setTitle(translate('OpenLP.AdvancedTab',
50+ 'X11'))
51+ self.x11BypassCheckBox.setText(translate('OpenLP.AdvancedTab',
52+ 'Bypass X11 Window Manager'))
53
54 def load(self):
55 """
56@@ -198,6 +213,8 @@
57 QtCore.QVariant(True)).toBool())
58 self.hideMouseCheckBox.setChecked(
59 settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
60+ self.x11BypassCheckBox.setChecked(
61+ settings.value(u'x11 bypass wm', QtCore.QVariant(True)).toBool())
62 self.default_color = settings.value(u'default color',
63 QtCore.QVariant(u'#ffffff')).toString()
64 self.defaultFileEdit.setText(settings.value(u'default image',
65@@ -227,9 +244,14 @@
66 QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
67 settings.setValue(u'hide mouse',
68 QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
69+ settings.setValue(u'x11 bypass wm',
70+ QtCore.QVariant(self.x11BypassCheckBox.isChecked()))
71 settings.setValue(u'default color', self.default_color)
72 settings.setValue(u'default image', self.defaultFileEdit.text())
73 settings.endGroup()
74+ if self.display_changed:
75+ Receiver.send_message(u'config_screen_changed')
76+ self.display_changed = False
77
78 def onDefaultColorButtonPressed(self):
79 new_color = QtGui.QColorDialog.getColor(
80@@ -252,3 +274,12 @@
81 def onDefaultRevertButtonPressed(self):
82 self.defaultFileEdit.setText(u':/graphics/openlp-splash-screen.png')
83 self.defaultFileEdit.setFocus()
84+
85+ def onX11BypassCheckBoxToggled(self, checked):
86+ """
87+ Toggle X11 bypass flag on maindisplay depending on check box state.
88+
89+ ``checked``
90+ The state of the check box (boolean).
91+ """
92+ self.display_changed = True
93
94=== modified file 'openlp/core/ui/maindisplay.py'
95--- openlp/core/ui/maindisplay.py 2012-01-06 18:44:12 +0000
96+++ openlp/core/ui/maindisplay.py 2012-01-07 12:16:26 +0000
97@@ -134,7 +134,8 @@
98 self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
99 windowFlags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | \
100 QtCore.Qt.WindowStaysOnTopHint
101- if os.environ.get(u'XDG_CURRENT_DESKTOP') == u'Unity':
102+ if QtCore.QSettings().value(u'advanced/x11 bypass wm',
103+ QtCore.QVariant(True)).toBool():
104 windowFlags = windowFlags | QtCore.Qt.X11BypassWindowManagerHint
105 # FIXME: QtCore.Qt.SplashScreen is workaround to make display screen
106 # stay always on top on Mac OS X. For details see bug 906926.
107
108=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
109--- openlp/plugins/presentations/lib/presentationtab.py 2011-12-27 10:33:55 +0000
110+++ openlp/plugins/presentations/lib/presentationtab.py 2012-01-07 12:16:26 +0000
111@@ -40,6 +40,7 @@
112 """
113 self.controllers = controllers
114 SettingsTab.__init__(self, parent, title, visible_title, icon_path)
115+ self.activated = False
116
117 def setupUi(self):
118 """
119@@ -110,8 +111,12 @@
120
121 def save(self):
122 """
123- Save the settings.
124+ Save the settings. If the tab hasn't been made visible to the user
125+ then there is nothing to do, so exit. This removes the need to
126+ start presentation applications unnecessarily.
127 """
128+ if not self.activated:
129+ return
130 changed = False
131 for key in self.controllers:
132 controller = self.controllers[key]
133@@ -140,6 +145,7 @@
134 """
135 Tab has just been made visible to the user
136 """
137+ self.activated = True
138 for key in self.controllers:
139 controller = self.controllers[key]
140 checkbox = self.PresenterCheckboxes[controller.name]