Merge lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting into lp:openlp

Proposed by Azaziah
Status: Superseded
Proposed branch: lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting
Merge into: lp:openlp
Diff against target: 390 lines (+129/-78)
5 files modified
openlp/core/common/settings.py (+6/-3)
openlp/core/ui/advancedtab.py (+2/-69)
openlp/core/ui/generaltab.py (+75/-2)
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
Reviewer Review Type Date Requested Status
Raoul Snyman Needs Fixing
Tim Bentley Pending
Review via email: mp+290828@code.launchpad.net

This proposal supersedes a proposal from 2016-04-01.

This proposal has been superseded by a proposal from 2016-04-12.

Description of the change

In this re-proposal:

 - Changed comments related to "default image" to match "logo".
- Removed the last remaining default_ from default_logo_xxx code row. (name)

Edit: Wasn't sure if Jenkins was from older revision, updated it.
^^ Sorry for the spam.
lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting
(revision 2638)

[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-01-Pull/1378/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-02-Functional-Tests/1296/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-03-Interface-Tests/1235/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1067/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/658/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-05a-Code_Analysis/725/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-05b-Test_Coverage/593/

---------------------------

- Added tests
- Moved these settings from Advanced tab to General tab
  and renamed "Default image" to "Logo"

--------------------------------------------------------------

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

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

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
> 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://code.launchpad.net/~suutari-olli/openlp/show-no-logo-or-background-when-starting/+merge/289111
> --
> 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://launchpad.net/~openlp-core
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~openlp-core
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
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?

Revision history for this message
Azaziah (suutari-olli) wrote : Posted in a previous version of this proposal

As asked previously:

This feature is based purely on:

self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.setStyleSheet(TRANSPARENT_STYLESHEET)

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

Revision history for this message
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.

review: Needs Fixing
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

Minor tweeks but much better.
Needs tests though!

review: Needs Fixing
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

This is looking good. The only thing I can see is that you're going to have to write some settings migration code for people (like our church) who have customised their logo screens. There's some code elsewhere to do settings migration, but I can't think of where right now.

review: Needs Fixing
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.BackgroundColorColon = 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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/common/settings.py'
2--- openlp/core/common/settings.py 2016-03-20 15:00:15 +0000
3+++ openlp/core/common/settings.py 2016-04-12 21:03:21 +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@@ -152,6 +150,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@@ -207,7 +208,9 @@
24 # ('general/recent files', 'core/recent files', [(recent_files_conv, None)]),
25 ('songs/search as type', 'advanced/search as type', []),
26 ('media/players', 'media/players_temp', [(media_players_conv, None)]), # Convert phonon to system
27- ('media/players_temp', 'media/players', []) # Move temp setting from above to correct setting
28+ ('media/players_temp', 'media/players', []), # Move temp setting from above to correct setting
29+ ('advanced/default color', 'core/logo background color', []), # Default image renamed + moved to general > 2.4.
30+ ('advanced/default image', '/core/logo file', []) # Default image renamed + moved to general after 2.4.
31 ]
32
33 @staticmethod
34
35=== modified file 'openlp/core/ui/advancedtab.py'
36--- openlp/core/ui/advancedtab.py 2016-04-05 17:30:20 +0000
37+++ openlp/core/ui/advancedtab.py 2016-04-12 21:03:21 +0000
38@@ -29,8 +29,8 @@
39
40 from PyQt5 import QtCore, QtGui, QtWidgets
41
42-from openlp.core.common import AppLocation, Settings, SlideLimits, UiStrings, translate, get_images_filter
43-from openlp.core.lib import ColorButton, SettingsTab, build_icon
44+from openlp.core.common import AppLocation, Settings, SlideLimits, UiStrings, translate
45+from openlp.core.lib import SettingsTab, build_icon
46 from openlp.core.common.languagemanager import format_time
47
48 log = logging.getLogger(__name__)
49@@ -45,8 +45,6 @@
50 """
51 Initialise the settings tab
52 """
53- self.default_image = ':/graphics/openlp-splash-screen.png'
54- self.default_color = '#ffffff'
55 self.data_exists = False
56 self.icon_path = ':/system/system_settings.png'
57 advanced_translated = translate('OpenLP.AdvancedTab', 'Advanced')
58@@ -180,33 +178,6 @@
59 self.data_directory_layout.addRow(self.new_data_directory_has_files_label)
60 self.left_layout.addWidget(self.data_directory_group_box)
61 self.left_layout.addStretch()
62- # Default Image
63- self.default_image_group_box = QtWidgets.QGroupBox(self.right_column)
64- self.default_image_group_box.setObjectName('default_image_group_box')
65- self.default_image_layout = QtWidgets.QFormLayout(self.default_image_group_box)
66- self.default_image_layout.setObjectName('default_image_layout')
67- self.default_color_label = QtWidgets.QLabel(self.default_image_group_box)
68- self.default_color_label.setObjectName('default_color_label')
69- self.default_color_button = ColorButton(self.default_image_group_box)
70- self.default_color_button.setObjectName('default_color_button')
71- self.default_image_layout.addRow(self.default_color_label, self.default_color_button)
72- self.default_file_label = QtWidgets.QLabel(self.default_image_group_box)
73- self.default_file_label.setObjectName('default_file_label')
74- self.default_file_edit = QtWidgets.QLineEdit(self.default_image_group_box)
75- self.default_file_edit.setObjectName('default_file_edit')
76- self.default_browse_button = QtWidgets.QToolButton(self.default_image_group_box)
77- self.default_browse_button.setObjectName('default_browse_button')
78- self.default_browse_button.setIcon(build_icon(':/general/general_open.png'))
79- self.default_revert_button = QtWidgets.QToolButton(self.default_image_group_box)
80- self.default_revert_button.setObjectName('default_revert_button')
81- self.default_revert_button.setIcon(build_icon(':/general/general_revert.png'))
82- self.default_file_layout = QtWidgets.QHBoxLayout()
83- self.default_file_layout.setObjectName('default_file_layout')
84- self.default_file_layout.addWidget(self.default_file_edit)
85- self.default_file_layout.addWidget(self.default_browse_button)
86- self.default_file_layout.addWidget(self.default_revert_button)
87- self.default_image_layout.addRow(self.default_file_label, self.default_file_layout)
88- self.right_layout.addWidget(self.default_image_group_box)
89 # Hide mouse
90 self.hide_mouse_group_box = QtWidgets.QGroupBox(self.right_column)
91 self.hide_mouse_group_box.setObjectName('hide_mouse_group_box')
92@@ -253,9 +224,6 @@
93 self.service_name_time.timeChanged.connect(self.update_service_name_example)
94 self.service_name_edit.textChanged.connect(self.update_service_name_example)
95 self.service_name_revert_button.clicked.connect(self.on_service_name_revert_button_clicked)
96- self.default_color_button.colorChanged.connect(self.on_background_color_changed)
97- self.default_browse_button.clicked.connect(self.on_default_browse_button_clicked)
98- self.default_revert_button.clicked.connect(self.on_default_revert_button_clicked)
99 self.alternate_rows_check_box.toggled.connect(self.on_alternate_rows_check_box_toggled)
100 self.data_directory_browse_button.clicked.connect(self.on_data_directory_browse_button_clicked)
101 self.data_directory_default_button.clicked.connect(self.on_data_directory_default_button_clicked)
102@@ -309,11 +277,6 @@
103 self.service_name_example_label.setText(translate('OpenLP.AdvancedTab', 'Example:'))
104 self.hide_mouse_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor'))
105 self.hide_mouse_check_box.setText(translate('OpenLP.AdvancedTab', 'Hide mouse cursor when over display window'))
106- self.default_image_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Default Image'))
107- self.default_color_label.setText(translate('OpenLP.AdvancedTab', 'Background color:'))
108- self.default_file_label.setText(translate('OpenLP.AdvancedTab', 'Image file:'))
109- self.default_browse_button.setToolTip(translate('OpenLP.AdvancedTab', 'Browse for an image file to display.'))
110- self.default_revert_button.setToolTip(translate('OpenLP.AdvancedTab', 'Revert to the default OpenLP logo.'))
111 self.data_directory_current_label.setText(translate('OpenLP.AdvancedTab', 'Current path:'))
112 self.data_directory_new_label.setText(translate('OpenLP.AdvancedTab', 'Custom path:'))
113 self.data_directory_browse_button.setToolTip(translate('OpenLP.AdvancedTab',
114@@ -368,8 +331,6 @@
115 self.service_name_check_box.setChecked(default_service_enabled)
116 self.service_name_check_box_toggled(default_service_enabled)
117 self.x11_bypass_check_box.setChecked(settings.value('x11 bypass wm'))
118- self.default_color = settings.value('default color')
119- self.default_file_edit.setText(settings.value('default image'))
120 self.slide_limits = settings.value('slide limits')
121 self.is_search_as_you_type_enabled = settings.value('search as type')
122 self.search_as_type_check_box.setChecked(self.is_search_as_you_type_enabled)
123@@ -411,7 +372,6 @@
124 self.current_data_path = AppLocation.get_data_path()
125 log.warning('User requested data path set to default %s' % self.current_data_path)
126 self.data_directory_label.setText(os.path.abspath(self.current_data_path))
127- self.default_color_button.color = self.default_color
128 # Don't allow data directory move if running portable.
129 if settings.value('advanced/is portable'):
130 self.data_directory_group_box.hide()
131@@ -443,8 +403,6 @@
132 settings.setValue('enable exit confirmation', self.enable_auto_close_check_box.isChecked())
133 settings.setValue('hide mouse', self.hide_mouse_check_box.isChecked())
134 settings.setValue('alternate rows', self.alternate_rows_check_box.isChecked())
135- settings.setValue('default color', self.default_color)
136- settings.setValue('default image', self.default_file_edit.text())
137 settings.setValue('slide limits', self.slide_limits)
138 if self.x11_bypass_check_box.isChecked() != settings.value('x11 bypass wm'):
139 settings.setValue('x11 bypass wm', self.x11_bypass_check_box.isChecked())
140@@ -522,24 +480,6 @@
141 self.service_name_edit.setText(UiStrings().DefaultServiceName)
142 self.service_name_edit.setFocus()
143
144- def on_background_color_changed(self, color):
145- """
146- Select the background colour of the default display screen.
147- """
148- self.default_color = color
149-
150- def on_default_browse_button_clicked(self):
151- """
152- Select an image for the default display screen.
153- """
154- file_filters = '%s;;%s (*.*)' % (get_images_filter(), UiStrings().AllFiles)
155- filename, filter_used = QtWidgets.QFileDialog.getOpenFileName(self,
156- translate('OpenLP.AdvancedTab', 'Open File'), '',
157- file_filters)
158- if filename:
159- self.default_file_edit.setText(filename)
160- self.default_file_edit.setFocus()
161-
162 def on_data_directory_browse_button_clicked(self):
163 """
164 Browse for a new data directory location.
165@@ -657,13 +597,6 @@
166 self.data_directory_cancel_button.hide()
167 self.new_data_directory_has_files_label.hide()
168
169- def on_default_revert_button_clicked(self):
170- """
171- Revert the default screen back to the default settings.
172- """
173- self.default_file_edit.setText(':/graphics/openlp-splash-screen.png')
174- self.default_file_edit.setFocus()
175-
176 def on_alternate_rows_check_box_toggled(self, checked):
177 """
178 Notify user about required restart.
179
180=== modified file 'openlp/core/ui/generaltab.py'
181--- openlp/core/ui/generaltab.py 2016-01-16 20:13:41 +0000
182+++ openlp/core/ui/generaltab.py 2016-04-12 21:03:21 +0000
183@@ -26,8 +26,8 @@
184
185 from PyQt5 import QtCore, QtGui, QtWidgets
186
187-from openlp.core.common import Registry, Settings, UiStrings, translate
188-from openlp.core.lib import SettingsTab, ScreenList
189+from openlp.core.common import Registry, Settings, UiStrings, translate, get_images_filter
190+from openlp.core.lib import SettingsTab, ScreenList, ColorButton, build_icon
191
192 log = logging.getLogger(__name__)
193
194@@ -40,6 +40,8 @@
195 """
196 Initialise the general settings tab
197 """
198+ self.logo_file = ':/graphics/openlp-splash-screen.png'
199+ self.logo_background_color = '#ffffff'
200 self.screens = ScreenList()
201 self.icon_path = ':/icon/openlp-logo-16x16.png'
202 general_translated = translate('OpenLP.GeneralTab', 'General')
203@@ -162,6 +164,39 @@
204 self.check_for_updates_check_box.setVisible(False)
205 self.startup_layout.addWidget(self.check_for_updates_check_box)
206 self.right_layout.addWidget(self.startup_group_box)
207+ # Logo
208+ self.logo_group_box = QtWidgets.QGroupBox(self.right_column)
209+ self.logo_group_box.setObjectName('logo_group_box')
210+ self.logo_layout = QtWidgets.QFormLayout(self.logo_group_box)
211+ self.logo_layout.setObjectName('logo_layout')
212+ self.logo_file_label = QtWidgets.QLabel(self.logo_group_box)
213+ self.logo_file_label.setObjectName('logo_file_label')
214+ self.logo_file_edit = QtWidgets.QLineEdit(self.logo_group_box)
215+ self.logo_file_edit.setObjectName('logo_file_edit')
216+ self.logo_browse_button = QtWidgets.QToolButton(self.logo_group_box)
217+ self.logo_browse_button.setObjectName('logo_browse_button')
218+ self.logo_browse_button.setIcon(build_icon(':/general/general_open.png'))
219+ self.logo_revert_button = QtWidgets.QToolButton(self.logo_group_box)
220+ self.logo_revert_button.setObjectName('logo_revert_button')
221+ self.logo_revert_button.setIcon(build_icon(':/general/general_revert.png'))
222+ self.logo_file_layout = QtWidgets.QHBoxLayout()
223+ self.logo_file_layout.setObjectName('logo_file_layout')
224+ self.logo_file_layout.addWidget(self.logo_file_edit)
225+ self.logo_file_layout.addWidget(self.logo_browse_button)
226+ self.logo_file_layout.addWidget(self.logo_revert_button)
227+ self.logo_layout.addRow(self.logo_file_label, self.logo_file_layout)
228+ self.logo_color_label = QtWidgets.QLabel(self.logo_group_box)
229+ self.logo_color_label.setObjectName('logo_color_label')
230+ self.logo_color_button = ColorButton(self.logo_group_box)
231+ self.logo_color_button.setObjectName('logo_color_button')
232+ self.logo_layout.addRow(self.logo_color_label, self.logo_color_button)
233+ self.logo_hide_on_startup_check_box = QtWidgets.QCheckBox(self.logo_group_box)
234+ self.logo_hide_on_startup_check_box.setObjectName('logo_hide_on_startup_check_box')
235+ self.logo_layout.addRow(self.logo_hide_on_startup_check_box)
236+ self.right_layout.addWidget(self.logo_group_box)
237+ self.logo_color_button.colorChanged.connect(self.on_logo_background_color_changed)
238+ self.logo_browse_button.clicked.connect(self.on_logo_browse_button_clicked)
239+ self.logo_revert_button.clicked.connect(self.on_logo_revert_button_clicked)
240 # Application Settings
241 self.settings_group_box = QtWidgets.QGroupBox(self.right_column)
242 self.settings_group_box.setObjectName('settings_group_box')
243@@ -212,6 +247,12 @@
244 self.warning_check_box.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning'))
245 self.auto_open_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically open the last service'))
246 self.show_splash_check_box.setText(translate('OpenLP.GeneralTab', 'Show the splash screen'))
247+ self.logo_group_box.setTitle(translate('OpenLP.GeneralTab', 'Logo'))
248+ self.logo_color_label.setText(translate('OpenLP.GeneralTab', 'Background color:'))
249+ self.logo_file_label.setText(translate('OpenLP.GeneralTab', 'Logo file:'))
250+ self.logo_browse_button.setToolTip(translate('OpenLP.GeneralTab', 'Browse for an image file to display.'))
251+ self.logo_revert_button.setToolTip(translate('OpenLP.GeneralTab', 'Revert to the default OpenLP logo.'))
252+ self.logo_hide_on_startup_check_box.setText(translate('OpenLP.GeneralTab', 'Don\'t show logo on startup'))
253 self.check_for_updates_check_box.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
254 self.settings_group_box.setTitle(translate('OpenLP.GeneralTab', 'Application Settings'))
255 self.save_check_service_check_box.setText(translate('OpenLP.GeneralTab',
256@@ -254,6 +295,10 @@
257 self.warning_check_box.setChecked(settings.value('blank warning'))
258 self.auto_open_check_box.setChecked(settings.value('auto open'))
259 self.show_splash_check_box.setChecked(settings.value('show splash'))
260+ self.logo_background_color = settings.value('logo background color')
261+ self.logo_file_edit.setText(settings.value('logo file'))
262+ self.logo_hide_on_startup_check_box.setChecked(settings.value('logo hide on startup'))
263+ self.logo_color_button.color = self.logo_background_color
264 self.check_for_updates_check_box.setChecked(settings.value('update check'))
265 self.auto_preview_check_box.setChecked(settings.value('auto preview'))
266 self.timeout_spin_box.setValue(settings.value('loop delay'))
267@@ -284,6 +329,9 @@
268 settings.setValue('blank warning', self.warning_check_box.isChecked())
269 settings.setValue('auto open', self.auto_open_check_box.isChecked())
270 settings.setValue('show splash', self.show_splash_check_box.isChecked())
271+ settings.setValue('logo background color', self.logo_background_color)
272+ settings.setValue('logo file', self.logo_file_edit.text())
273+ settings.setValue('logo hide on startup', self.logo_hide_on_startup_check_box.isChecked())
274 settings.setValue('update check', self.check_for_updates_check_box.isChecked())
275 settings.setValue('save prompt', self.save_check_service_check_box.isChecked())
276 settings.setValue('auto unblank', self.auto_unblank_check_box.isChecked())
277@@ -346,3 +394,28 @@
278 Called when the width, height, x position or y position has changed.
279 """
280 self.display_changed = True
281+
282+ def on_logo_browse_button_clicked(self):
283+ """
284+ Select the logo file
285+ """
286+ file_filters = '%s;;%s (*.*)' % (get_images_filter(), UiStrings().AllFiles)
287+ filename, filter_used = QtWidgets.QFileDialog.getOpenFileName(self,
288+ translate('OpenLP.AdvancedTab', 'Open File'), '',
289+ file_filters)
290+ if filename:
291+ self.logo_file_edit.setText(filename)
292+ self.logo_file_edit.setFocus()
293+
294+ def on_logo_revert_button_clicked(self):
295+ """
296+ Revert the logo file back to the default setting.
297+ """
298+ self.logo_file_edit.setText(':/graphics/openlp-splash-screen.png')
299+ self.logo_file_edit.setFocus()
300+
301+ def on_logo_background_color_changed(self, color):
302+ """
303+ Select the background color for logo.
304+ """
305+ self.logo_background_color = color
306
307=== modified file 'openlp/core/ui/maindisplay.py'
308--- openlp/core/ui/maindisplay.py 2016-02-20 21:42:31 +0000
309+++ openlp/core/ui/maindisplay.py 2016-04-12 21:03:21 +0000
310@@ -254,10 +254,10 @@
311 if self.is_live:
312 # Build the initial frame.
313 background_color = QtGui.QColor()
314- background_color.setNamedColor(Settings().value('advanced/default color'))
315+ background_color.setNamedColor(Settings().value('core/logo background color'))
316 if not background_color.isValid():
317 background_color = QtCore.Qt.white
318- image_file = Settings().value('advanced/default image')
319+ image_file = Settings().value('core/logo file')
320 splash_image = QtGui.QImage(image_file)
321 self.initial_fame = QtGui.QImage(
322 self.screen['size'].width(),
323@@ -523,7 +523,9 @@
324 if not Settings().value('core/display on monitor'):
325 return
326 self.frame.evaluateJavaScript('show_blank("show");')
327- if self.isHidden():
328+ # Check if setting for hiding logo on startup is enabled.
329+ # If it is, display should remain hidden, otherwise logo is shown. (from def setup)
330+ if self.isHidden() and not Settings().value('core/logo hide on startup'):
331 self.setVisible(True)
332 self.hide_mode = None
333 # Trigger actions when display is active again.
334
335=== modified file 'tests/functional/openlp_core_ui/test_maindisplay.py'
336--- tests/functional/openlp_core_ui/test_maindisplay.py 2016-01-11 03:27:28 +0000
337+++ tests/functional/openlp_core_ui/test_maindisplay.py 2016-04-12 21:03:21 +0000
338@@ -26,7 +26,7 @@
339
340 from PyQt5 import QtCore
341
342-from openlp.core.common import Registry, is_macosx
343+from openlp.core.common import Registry, is_macosx, Settings
344 from openlp.core.lib import ScreenList
345 from openlp.core.ui import MainDisplay
346 from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET
347@@ -183,3 +183,43 @@
348 'Window level should be NSMainMenuWindowLevel + 2')
349 self.assertEqual(pyobjc_nsview.window().collectionBehavior(), NSWindowCollectionBehaviorManaged,
350 'Window collection behavior should be NSWindowCollectionBehaviorManaged')
351+
352+ @patch(u'openlp.core.ui.maindisplay.Settings')
353+ def show_display_startup_logo_test(self, MockedSettings):
354+ # GIVEN: Mocked show_display, setting for logo visibility
355+ display = MagicMock()
356+ main_display = MainDisplay(display)
357+ main_display.frame = MagicMock()
358+ main_display.isHidden = MagicMock()
359+ main_display.isHidden.return_value = True
360+ main_display.setVisible = MagicMock()
361+ mocked_settings = MagicMock()
362+ mocked_settings.value.return_value = False
363+ MockedSettings.return_value = mocked_settings
364+ main_display.shake_web_view = MagicMock()
365+
366+ # WHEN: show_display is called.
367+ main_display.show_display()
368+
369+ # THEN: setVisible should had been called with "True"
370+ main_display.setVisible.assert_called_once_with(True)
371+
372+ @patch(u'openlp.core.ui.maindisplay.Settings')
373+ def show_display_hide_startup_logo_test(self, MockedSettings):
374+ # GIVEN: Mocked show_display, setting for logo visibility
375+ display = MagicMock()
376+ main_display = MainDisplay(display)
377+ main_display.frame = MagicMock()
378+ main_display.isHidden = MagicMock()
379+ main_display.isHidden.return_value = False
380+ main_display.setVisible = MagicMock()
381+ mocked_settings = MagicMock()
382+ mocked_settings.value.return_value = False
383+ MockedSettings.return_value = mocked_settings
384+ main_display.shake_web_view = MagicMock()
385+
386+ # WHEN: show_display is called.
387+ main_display.show_display()
388+
389+ # THEN: setVisible should had not been called
390+ main_display.setVisible.assert_not_called()