Merge lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting into lp:openlp
- show-no-logo-or-background-when-starting
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting |
Merge into: | lp:openlp |
Diff against target: |
378 lines (+126/-76) 5 files modified
openlp/core/common/settings.py (+3/-2) openlp/core/ui/advancedtab.py (+2/-69) openlp/core/ui/generaltab.py (+75/-1) openlp/core/ui/maindisplay.py (+5/-3) tests/functional/openlp_core_ui/test_maindisplay.py (+41/-1) |
To merge this branch: | bzr merge lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Bentley | Needs Fixing | ||
Review via email: mp+290507@code.launchpad.net |
This proposal supersedes a proposal from 2016-03-15.
This proposal has been superseded by a proposal from 2016-04-01.
Commit message
Description of the change
In this re-proposal:
Now using self.setVisible
Renamed the visual text for the setting to: "Don't show Logo"
I think the default image settings should be moved to general tab and renamed to "Logo settings" or something similar.
-------
Added: "Show no logo" as an option for
disabling default image and background.
(By default OpenLP logo and white bg color are shown on primary Live monitor
At the moment it's only possible to change the color/image but not disable them.)
I think this and the other "Default image" settings should be moved to General options tab under Startup options rather than having them separately at advanced tab and the title renamed to something more describing. Should I do this?
Jenkis passes but this does not have a test yet.
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal | # |
Azaziah (suutari-olli) wrote : Posted in a previous version of this proposal | # |
Thank you for your review.
It’s some work but I think I could do it in about 1-3 hours.
This would probably mean that users need to re-set custom values for these.
You mentioned I should use Hiding instead of Transparency, there are however
some requirements that need to be met.
A) Display should not show either background color or the image.
B) Display status should be not be blanked/hidden so sending the first item to Live works regardless of the setting for Unblanking display for this.
C) User should be able to interact with their desktop normally.
Is it possible to achieve this without using Transparency?
This works in Windows, are there issues with this on Linux/Mac?
Maybe there are no issues with this kind of transparency,
display stops being transparent once something is sent to Live.
There were some other transparency related code parts that I left out since I got it working
with those two rows, maybe they could fix this for other platforms if there are problems?
Azaziah (suutari-olli) wrote : Posted in a previous version of this proposal | # |
As asked previously:
This feature is based purely on:
self.setAttribu
self.setStyleSh
I'd imagine transparent themes are not such a simple feature.
I haven't noticed any trouble with this in Windows, are there any in Linux/Mac?
It seems like using the hide feature would at least require importing bunch of
stuff from some other files since Hide functions are not part of maindisplay.py
I think the best solution would be to go with this code if it works and
think for an alternative if this is broken in the next Qt release.
Thank you for your patience
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal | # |
Do not see then need for this and it is very useful to confirm the system is working.
As I said before and will say again stop using transparent for hiding things it is a complexity and unnecessary,
You only need an if statement to display the output not the else.
Unable to test as I only have a single monitor.
Tim Bentley (trb143) wrote : | # |
Minor tweeks but much better.
Needs tests though!
- 2634. By Azaziah
-
Added two tests for this.
The other to check if visibility is changed to "True" for logo, the other for the opposite.
To do:
How to name this new setting? / Old "Default image" settings.
- 2635. By Azaziah
-
In this branch:
- Renamed "Default image" and related settings to "Logo" etc.
- Moved these settings to General tab from Advanced tab
- Re-wired these settings to code functionsTo do:
- Remove these from advanced tab.
- Verify tests still work - 2636. By Azaziah
-
In this branch:
- Removed old "Default image" settings from advanced tab.
- Removed related imports and functions.
- Renamed def on_background_color_changed to on_logo_ background_ color_changed - 2637. By Azaziah
-
Added empty newline to the end of generaltab.py
- 2638. By Azaziah
-
- Changed comments related to "default image" to match "logo".
- Removed one default_ - 2639. By Azaziah
-
This now moves old settings from advanced tab into the new settings.
- 2640. By Azaziah
-
Merge to trunk on 8.4.16
You will need to
manually delete the __pycache__ directory inside openlp_core_utils.
run "bzr resolve openlp_core_utils"
then you will be allowed to commit the changes.also resolved conflict for advancedtab.py
- 2641. By Azaziah
-
Fixed the broken import statements.
- 2642. By Azaziah
-
Merge to trunk on 13.4.16
- 2643. By Azaziah
-
Added: self.Background
ColorColon = translate( 'OpenLP. Ui', 'Background color:')
to uistrings, background color label now uses this.This same string will be used several times in this branch:
https://code.launchpad .net/~suutari- olli/openlp/ ui-messages- part-1/ +merge/ 291628
Unmerged revisions
Preview Diff
1 | === modified file 'openlp/core/common/settings.py' |
2 | --- openlp/core/common/settings.py 2016-03-15 21:34:58 +0000 |
3 | +++ openlp/core/common/settings.py 2016-04-01 01:47:16 +0000 |
4 | @@ -109,8 +109,6 @@ |
5 | 'advanced/alternate rows': not is_win(), |
6 | 'advanced/current media plugin': -1, |
7 | 'advanced/data path': '', |
8 | - 'advanced/default color': '#ffffff', |
9 | - 'advanced/default image': ':/graphics/openlp-splash-screen.png', |
10 | # 7 stands for now, 0 to 6 is Monday to Sunday. |
11 | 'advanced/default service day': 7, |
12 | 'advanced/default service enabled': True, |
13 | @@ -151,6 +149,9 @@ |
14 | 'core/save prompt': False, |
15 | 'core/screen blank': False, |
16 | 'core/show splash': True, |
17 | + 'core/logo background color': '#ffffff', |
18 | + 'core/logo file': ':/graphics/openlp-splash-screen.png', |
19 | + 'core/logo hide on startup': False, |
20 | 'core/songselect password': '', |
21 | 'core/songselect username': '', |
22 | 'core/update check': True, |
23 | |
24 | === modified file 'openlp/core/ui/advancedtab.py' |
25 | --- openlp/core/ui/advancedtab.py 2016-01-19 06:52:23 +0000 |
26 | +++ openlp/core/ui/advancedtab.py 2016-04-01 01:47:16 +0000 |
27 | @@ -30,8 +30,8 @@ |
28 | from PyQt5 import QtCore, QtGui, QtWidgets |
29 | |
30 | from openlp.core.common import AppLocation, Settings, SlideLimits, UiStrings, translate |
31 | -from openlp.core.lib import ColorButton, SettingsTab, build_icon |
32 | -from openlp.core.utils import format_time, get_images_filter |
33 | +from openlp.core.lib import SettingsTab, build_icon |
34 | +from openlp.core.utils import format_time |
35 | |
36 | log = logging.getLogger(__name__) |
37 | |
38 | @@ -45,8 +45,6 @@ |
39 | """ |
40 | Initialise the settings tab |
41 | """ |
42 | - self.default_image = ':/graphics/openlp-splash-screen.png' |
43 | - self.default_color = '#ffffff' |
44 | self.data_exists = False |
45 | self.icon_path = ':/system/system_settings.png' |
46 | advanced_translated = translate('OpenLP.AdvancedTab', 'Advanced') |
47 | @@ -173,33 +171,6 @@ |
48 | self.data_directory_layout.addRow(self.new_data_directory_has_files_label) |
49 | self.left_layout.addWidget(self.data_directory_group_box) |
50 | self.left_layout.addStretch() |
51 | - # Default Image |
52 | - self.default_image_group_box = QtWidgets.QGroupBox(self.right_column) |
53 | - self.default_image_group_box.setObjectName('default_image_group_box') |
54 | - self.default_image_layout = QtWidgets.QFormLayout(self.default_image_group_box) |
55 | - self.default_image_layout.setObjectName('default_image_layout') |
56 | - self.default_color_label = QtWidgets.QLabel(self.default_image_group_box) |
57 | - self.default_color_label.setObjectName('default_color_label') |
58 | - self.default_color_button = ColorButton(self.default_image_group_box) |
59 | - self.default_color_button.setObjectName('default_color_button') |
60 | - self.default_image_layout.addRow(self.default_color_label, self.default_color_button) |
61 | - self.default_file_label = QtWidgets.QLabel(self.default_image_group_box) |
62 | - self.default_file_label.setObjectName('default_file_label') |
63 | - self.default_file_edit = QtWidgets.QLineEdit(self.default_image_group_box) |
64 | - self.default_file_edit.setObjectName('default_file_edit') |
65 | - self.default_browse_button = QtWidgets.QToolButton(self.default_image_group_box) |
66 | - self.default_browse_button.setObjectName('default_browse_button') |
67 | - self.default_browse_button.setIcon(build_icon(':/general/general_open.png')) |
68 | - self.default_revert_button = QtWidgets.QToolButton(self.default_image_group_box) |
69 | - self.default_revert_button.setObjectName('default_revert_button') |
70 | - self.default_revert_button.setIcon(build_icon(':/general/general_revert.png')) |
71 | - self.default_file_layout = QtWidgets.QHBoxLayout() |
72 | - self.default_file_layout.setObjectName('default_file_layout') |
73 | - self.default_file_layout.addWidget(self.default_file_edit) |
74 | - self.default_file_layout.addWidget(self.default_browse_button) |
75 | - self.default_file_layout.addWidget(self.default_revert_button) |
76 | - self.default_image_layout.addRow(self.default_file_label, self.default_file_layout) |
77 | - self.right_layout.addWidget(self.default_image_group_box) |
78 | # Hide mouse |
79 | self.hide_mouse_group_box = QtWidgets.QGroupBox(self.right_column) |
80 | self.hide_mouse_group_box.setObjectName('hide_mouse_group_box') |
81 | @@ -246,9 +217,6 @@ |
82 | self.service_name_time.timeChanged.connect(self.update_service_name_example) |
83 | self.service_name_edit.textChanged.connect(self.update_service_name_example) |
84 | self.service_name_revert_button.clicked.connect(self.on_service_name_revert_button_clicked) |
85 | - self.default_color_button.colorChanged.connect(self.on_background_color_changed) |
86 | - self.default_browse_button.clicked.connect(self.on_default_browse_button_clicked) |
87 | - self.default_revert_button.clicked.connect(self.on_default_revert_button_clicked) |
88 | self.alternate_rows_check_box.toggled.connect(self.on_alternate_rows_check_box_toggled) |
89 | self.data_directory_browse_button.clicked.connect(self.on_data_directory_browse_button_clicked) |
90 | self.data_directory_default_button.clicked.connect(self.on_data_directory_default_button_clicked) |
91 | @@ -299,11 +267,6 @@ |
92 | self.service_name_example_label.setText(translate('OpenLP.AdvancedTab', 'Example:')) |
93 | self.hide_mouse_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor')) |
94 | self.hide_mouse_check_box.setText(translate('OpenLP.AdvancedTab', 'Hide mouse cursor when over display window')) |
95 | - self.default_image_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Default Image')) |
96 | - self.default_color_label.setText(translate('OpenLP.AdvancedTab', 'Background color:')) |
97 | - self.default_file_label.setText(translate('OpenLP.AdvancedTab', 'Image file:')) |
98 | - self.default_browse_button.setToolTip(translate('OpenLP.AdvancedTab', 'Browse for an image file to display.')) |
99 | - self.default_revert_button.setToolTip(translate('OpenLP.AdvancedTab', 'Revert to the default OpenLP logo.')) |
100 | self.data_directory_current_label.setText(translate('OpenLP.AdvancedTab', 'Current path:')) |
101 | self.data_directory_new_label.setText(translate('OpenLP.AdvancedTab', 'Custom path:')) |
102 | self.data_directory_browse_button.setToolTip(translate('OpenLP.AdvancedTab', |
103 | @@ -357,8 +320,6 @@ |
104 | self.service_name_check_box.setChecked(default_service_enabled) |
105 | self.service_name_check_box_toggled(default_service_enabled) |
106 | self.x11_bypass_check_box.setChecked(settings.value('x11 bypass wm')) |
107 | - self.default_color = settings.value('default color') |
108 | - self.default_file_edit.setText(settings.value('default image')) |
109 | self.slide_limits = settings.value('slide limits') |
110 | self.is_search_as_you_type_enabled = settings.value('search as type') |
111 | self.search_as_type_check_box.setChecked(self.is_search_as_you_type_enabled) |
112 | @@ -400,7 +361,6 @@ |
113 | self.current_data_path = AppLocation.get_data_path() |
114 | log.warning('User requested data path set to default %s' % self.current_data_path) |
115 | self.data_directory_label.setText(os.path.abspath(self.current_data_path)) |
116 | - self.default_color_button.color = self.default_color |
117 | # Don't allow data directory move if running portable. |
118 | if settings.value('advanced/is portable'): |
119 | self.data_directory_group_box.hide() |
120 | @@ -431,8 +391,6 @@ |
121 | settings.setValue('enable exit confirmation', self.enable_auto_close_check_box.isChecked()) |
122 | settings.setValue('hide mouse', self.hide_mouse_check_box.isChecked()) |
123 | settings.setValue('alternate rows', self.alternate_rows_check_box.isChecked()) |
124 | - settings.setValue('default color', self.default_color) |
125 | - settings.setValue('default image', self.default_file_edit.text()) |
126 | settings.setValue('slide limits', self.slide_limits) |
127 | if self.x11_bypass_check_box.isChecked() != settings.value('x11 bypass wm'): |
128 | settings.setValue('x11 bypass wm', self.x11_bypass_check_box.isChecked()) |
129 | @@ -510,24 +468,6 @@ |
130 | self.service_name_edit.setText(UiStrings().DefaultServiceName) |
131 | self.service_name_edit.setFocus() |
132 | |
133 | - def on_background_color_changed(self, color): |
134 | - """ |
135 | - Select the background colour of the default display screen. |
136 | - """ |
137 | - self.default_color = color |
138 | - |
139 | - def on_default_browse_button_clicked(self): |
140 | - """ |
141 | - Select an image for the default display screen. |
142 | - """ |
143 | - file_filters = '%s;;%s (*.*)' % (get_images_filter(), UiStrings().AllFiles) |
144 | - filename, filter_used = QtWidgets.QFileDialog.getOpenFileName(self, |
145 | - translate('OpenLP.AdvancedTab', 'Open File'), '', |
146 | - file_filters) |
147 | - if filename: |
148 | - self.default_file_edit.setText(filename) |
149 | - self.default_file_edit.setFocus() |
150 | - |
151 | def on_data_directory_browse_button_clicked(self): |
152 | """ |
153 | Browse for a new data directory location. |
154 | @@ -645,13 +585,6 @@ |
155 | self.data_directory_cancel_button.hide() |
156 | self.new_data_directory_has_files_label.hide() |
157 | |
158 | - def on_default_revert_button_clicked(self): |
159 | - """ |
160 | - Revert the default screen back to the default settings. |
161 | - """ |
162 | - self.default_file_edit.setText(':/graphics/openlp-splash-screen.png') |
163 | - self.default_file_edit.setFocus() |
164 | - |
165 | def on_alternate_rows_check_box_toggled(self, checked): |
166 | """ |
167 | Notify user about required restart. |
168 | |
169 | === modified file 'openlp/core/ui/generaltab.py' |
170 | --- openlp/core/ui/generaltab.py 2016-01-16 20:13:41 +0000 |
171 | +++ openlp/core/ui/generaltab.py 2016-04-01 01:47:16 +0000 |
172 | @@ -27,7 +27,8 @@ |
173 | from PyQt5 import QtCore, QtGui, QtWidgets |
174 | |
175 | from openlp.core.common import Registry, Settings, UiStrings, translate |
176 | -from openlp.core.lib import SettingsTab, ScreenList |
177 | +from openlp.core.lib import SettingsTab, ScreenList, ColorButton, build_icon |
178 | +from openlp.core.utils import get_images_filter |
179 | |
180 | log = logging.getLogger(__name__) |
181 | |
182 | @@ -40,6 +41,8 @@ |
183 | """ |
184 | Initialise the general settings tab |
185 | """ |
186 | + self.logo_file = ':/graphics/openlp-splash-screen.png' |
187 | + self.logo_background_color = '#ffffff' |
188 | self.screens = ScreenList() |
189 | self.icon_path = ':/icon/openlp-logo-16x16.png' |
190 | general_translated = translate('OpenLP.GeneralTab', 'General') |
191 | @@ -162,6 +165,39 @@ |
192 | self.check_for_updates_check_box.setVisible(False) |
193 | self.startup_layout.addWidget(self.check_for_updates_check_box) |
194 | self.right_layout.addWidget(self.startup_group_box) |
195 | + # Logo |
196 | + self.logo_group_box = QtWidgets.QGroupBox(self.right_column) |
197 | + self.logo_group_box.setObjectName('logo_group_box') |
198 | + self.logo_layout = QtWidgets.QFormLayout(self.logo_group_box) |
199 | + self.logo_layout.setObjectName('logo_layout') |
200 | + self.logo_file_label = QtWidgets.QLabel(self.logo_group_box) |
201 | + self.logo_file_label.setObjectName('logo_file_label') |
202 | + self.logo_file_edit = QtWidgets.QLineEdit(self.logo_group_box) |
203 | + self.logo_file_edit.setObjectName('logo_file_edit') |
204 | + self.logo_browse_button = QtWidgets.QToolButton(self.logo_group_box) |
205 | + self.logo_browse_button.setObjectName('logo_browse_button') |
206 | + self.logo_browse_button.setIcon(build_icon(':/general/general_open.png')) |
207 | + self.logo_revert_button = QtWidgets.QToolButton(self.logo_group_box) |
208 | + self.logo_revert_button.setObjectName('logo_revert_button') |
209 | + self.logo_revert_button.setIcon(build_icon(':/general/general_revert.png')) |
210 | + self.logo_file_layout = QtWidgets.QHBoxLayout() |
211 | + self.logo_file_layout.setObjectName('logo_file_layout') |
212 | + self.logo_file_layout.addWidget(self.logo_file_edit) |
213 | + self.logo_file_layout.addWidget(self.logo_browse_button) |
214 | + self.logo_file_layout.addWidget(self.logo_revert_button) |
215 | + self.logo_layout.addRow(self.logo_file_label, self.logo_file_layout) |
216 | + self.logo_color_label = QtWidgets.QLabel(self.logo_group_box) |
217 | + self.logo_color_label.setObjectName('logo_color_label') |
218 | + self.logo_color_button = ColorButton(self.logo_group_box) |
219 | + self.logo_color_button.setObjectName('logo_color_button') |
220 | + self.logo_layout.addRow(self.logo_color_label, self.logo_color_button) |
221 | + self.logo_hide_on_startup_check_box = QtWidgets.QCheckBox(self.logo_group_box) |
222 | + self.logo_hide_on_startup_check_box.setObjectName('default_logo_hide_on_startup_check_box') |
223 | + self.logo_layout.addRow(self.logo_hide_on_startup_check_box) |
224 | + self.right_layout.addWidget(self.logo_group_box) |
225 | + self.logo_color_button.colorChanged.connect(self.on_logo_background_color_changed) |
226 | + self.logo_browse_button.clicked.connect(self.on_logo_browse_button_clicked) |
227 | + self.logo_revert_button.clicked.connect(self.on_logo_revert_button_clicked) |
228 | # Application Settings |
229 | self.settings_group_box = QtWidgets.QGroupBox(self.right_column) |
230 | self.settings_group_box.setObjectName('settings_group_box') |
231 | @@ -212,6 +248,12 @@ |
232 | self.warning_check_box.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning')) |
233 | self.auto_open_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically open the last service')) |
234 | self.show_splash_check_box.setText(translate('OpenLP.GeneralTab', 'Show the splash screen')) |
235 | + self.logo_group_box.setTitle(translate('OpenLP.GeneralTab', 'Logo')) |
236 | + self.logo_color_label.setText(translate('OpenLP.GeneralTab', 'Background color:')) |
237 | + self.logo_file_label.setText(translate('OpenLP.GeneralTab', 'Logo file:')) |
238 | + self.logo_browse_button.setToolTip(translate('OpenLP.GeneralTab', 'Browse for an image file to display.')) |
239 | + self.logo_revert_button.setToolTip(translate('OpenLP.GeneralTab', 'Revert to the default OpenLP logo.')) |
240 | + self.logo_hide_on_startup_check_box.setText(translate('OpenLP.GeneralTab', 'Don\'t show logo on startup')) |
241 | self.check_for_updates_check_box.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP')) |
242 | self.settings_group_box.setTitle(translate('OpenLP.GeneralTab', 'Application Settings')) |
243 | self.save_check_service_check_box.setText(translate('OpenLP.GeneralTab', |
244 | @@ -254,6 +296,10 @@ |
245 | self.warning_check_box.setChecked(settings.value('blank warning')) |
246 | self.auto_open_check_box.setChecked(settings.value('auto open')) |
247 | self.show_splash_check_box.setChecked(settings.value('show splash')) |
248 | + self.logo_background_color = settings.value('logo background color') |
249 | + self.logo_file_edit.setText(settings.value('logo file')) |
250 | + self.logo_hide_on_startup_check_box.setChecked(settings.value('logo hide on startup')) |
251 | + self.logo_color_button.color = self.logo_background_color |
252 | self.check_for_updates_check_box.setChecked(settings.value('update check')) |
253 | self.auto_preview_check_box.setChecked(settings.value('auto preview')) |
254 | self.timeout_spin_box.setValue(settings.value('loop delay')) |
255 | @@ -284,6 +330,9 @@ |
256 | settings.setValue('blank warning', self.warning_check_box.isChecked()) |
257 | settings.setValue('auto open', self.auto_open_check_box.isChecked()) |
258 | settings.setValue('show splash', self.show_splash_check_box.isChecked()) |
259 | + settings.setValue('logo background color', self.logo_background_color) |
260 | + settings.setValue('logo file', self.logo_file_edit.text()) |
261 | + settings.setValue('logo hide on startup', self.logo_hide_on_startup_check_box.isChecked()) |
262 | settings.setValue('update check', self.check_for_updates_check_box.isChecked()) |
263 | settings.setValue('save prompt', self.save_check_service_check_box.isChecked()) |
264 | settings.setValue('auto unblank', self.auto_unblank_check_box.isChecked()) |
265 | @@ -346,3 +395,28 @@ |
266 | Called when the width, height, x position or y position has changed. |
267 | """ |
268 | self.display_changed = True |
269 | + |
270 | + def on_logo_browse_button_clicked(self): |
271 | + """ |
272 | + Select an image for the default display screen. |
273 | + """ |
274 | + file_filters = '%s;;%s (*.*)' % (get_images_filter(), UiStrings().AllFiles) |
275 | + filename, filter_used = QtWidgets.QFileDialog.getOpenFileName(self, |
276 | + translate('OpenLP.AdvancedTab', 'Open File'), '', |
277 | + file_filters) |
278 | + if filename: |
279 | + self.logo_file_edit.setText(filename) |
280 | + self.logo_file_edit.setFocus() |
281 | + |
282 | + def on_logo_revert_button_clicked(self): |
283 | + """ |
284 | + Revert the default screen back to the default settings. |
285 | + """ |
286 | + self.logo_file_edit.setText(':/graphics/openlp-splash-screen.png') |
287 | + self.logo_file_edit.setFocus() |
288 | + |
289 | + def on_logo_background_color_changed(self, color): |
290 | + """ |
291 | + Select the background colour of the default display screen. |
292 | + """ |
293 | + self.logo_background_color = color |
294 | |
295 | === modified file 'openlp/core/ui/maindisplay.py' |
296 | --- openlp/core/ui/maindisplay.py 2016-02-20 21:42:31 +0000 |
297 | +++ openlp/core/ui/maindisplay.py 2016-04-01 01:47:16 +0000 |
298 | @@ -254,10 +254,10 @@ |
299 | if self.is_live: |
300 | # Build the initial frame. |
301 | background_color = QtGui.QColor() |
302 | - background_color.setNamedColor(Settings().value('advanced/default color')) |
303 | + background_color.setNamedColor(Settings().value('core/logo background color')) |
304 | if not background_color.isValid(): |
305 | background_color = QtCore.Qt.white |
306 | - image_file = Settings().value('advanced/default image') |
307 | + image_file = Settings().value('core/logo file') |
308 | splash_image = QtGui.QImage(image_file) |
309 | self.initial_fame = QtGui.QImage( |
310 | self.screen['size'].width(), |
311 | @@ -523,7 +523,9 @@ |
312 | if not Settings().value('core/display on monitor'): |
313 | return |
314 | self.frame.evaluateJavaScript('show_blank("show");') |
315 | - if self.isHidden(): |
316 | + # Check if setting for hiding default background image and color is enabled. |
317 | + # If so, display should remain hidden, otherwise default logo is shown. (from def setup) |
318 | + if self.isHidden() and not Settings().value('core/logo hide on startup'): |
319 | self.setVisible(True) |
320 | self.hide_mode = None |
321 | # Trigger actions when display is active again. |
322 | |
323 | === modified file 'tests/functional/openlp_core_ui/test_maindisplay.py' |
324 | --- tests/functional/openlp_core_ui/test_maindisplay.py 2016-01-11 03:27:28 +0000 |
325 | +++ tests/functional/openlp_core_ui/test_maindisplay.py 2016-04-01 01:47:16 +0000 |
326 | @@ -26,7 +26,7 @@ |
327 | |
328 | from PyQt5 import QtCore |
329 | |
330 | -from openlp.core.common import Registry, is_macosx |
331 | +from openlp.core.common import Registry, is_macosx, Settings |
332 | from openlp.core.lib import ScreenList |
333 | from openlp.core.ui import MainDisplay |
334 | from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET |
335 | @@ -183,3 +183,43 @@ |
336 | 'Window level should be NSMainMenuWindowLevel + 2') |
337 | self.assertEqual(pyobjc_nsview.window().collectionBehavior(), NSWindowCollectionBehaviorManaged, |
338 | 'Window collection behavior should be NSWindowCollectionBehaviorManaged') |
339 | + |
340 | + @patch(u'openlp.core.ui.maindisplay.Settings') |
341 | + def show_display_startup_logo_test(self, MockedSettings): |
342 | + # GIVEN: Mocked show_display, setting for logo visibility |
343 | + display = MagicMock() |
344 | + main_display = MainDisplay(display) |
345 | + main_display.frame = MagicMock() |
346 | + main_display.isHidden = MagicMock() |
347 | + main_display.isHidden.return_value = True |
348 | + main_display.setVisible = MagicMock() |
349 | + mocked_settings = MagicMock() |
350 | + mocked_settings.value.return_value = False |
351 | + MockedSettings.return_value = mocked_settings |
352 | + main_display.shake_web_view = MagicMock() |
353 | + |
354 | + # WHEN: show_display is called. |
355 | + main_display.show_display() |
356 | + |
357 | + # THEN: setVisible should had been called with "True" |
358 | + main_display.setVisible.assert_called_once_with(True) |
359 | + |
360 | + @patch(u'openlp.core.ui.maindisplay.Settings') |
361 | + def show_display_hide_startup_logo_test(self, MockedSettings): |
362 | + # GIVEN: Mocked show_display, setting for logo visibility |
363 | + display = MagicMock() |
364 | + main_display = MainDisplay(display) |
365 | + main_display.frame = MagicMock() |
366 | + main_display.isHidden = MagicMock() |
367 | + main_display.isHidden.return_value = False |
368 | + main_display.setVisible = MagicMock() |
369 | + mocked_settings = MagicMock() |
370 | + mocked_settings.value.return_value = False |
371 | + MockedSettings.return_value = mocked_settings |
372 | + main_display.shake_web_view = MagicMock() |
373 | + |
374 | + # WHEN: show_display is called. |
375 | + main_display.show_display() |
376 | + |
377 | + # THEN: setVisible should had not been called |
378 | + main_display.setVisible.assert_not_called() |
Not sure about moving them as it is alot of work moving settings.
We should not be using transparent display for hidden they are different
and we have issues with it. If you want to hide somthing hide it.
On 16 Mar 2016 19:07, "Azaziah" <email address hidden> wrote:
> The proposal to merge /code.launchpad .net/~suutari- olli/openlp/ show-no- logo-or- background- when-starting/ +merge/ 289111 _______ _______ _______ _______ _______ _____ /launchpad. net/~openlp- core /launchpad. net/~openlp- core /help.launchpad .net/ListHelp
> lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting into
> lp:openlp has been updated.
>
> Description changed to:
>
> Added: "Do not show anything on startup" as an option for
> disabling default image and background.
>
> (By default OpenLP logo and white bg color are shown on primary Live
> monitor
> At the moment it's only possible to change the color/image but not disable
> them.)
>
> I think this and the other "Default image" settings should be moved to
> General options tab under Startup options rather than having them
> separately at advanced tab and the title renamed to something more
> describing. Should I do this?
>
> Jenkis passes but this does not have a test yet.
>
> For more details, see:
>
> https:/
> --
> Your team OpenLP Core is requested to review the proposed merge of
> lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting into
> lp:openlp.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>