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

Proposed by Azaziah
Status: Merged
Approved by: Raoul Snyman
Approved revision: 2643
Merged at revision: 2643
Proposed branch: lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting
Merge into: lp:openlp
Diff against target: 402 lines (+130/-78)
6 files modified
openlp/core/common/settings.py (+6/-3)
openlp/core/common/uistrings.py (+1/-0)
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 Approve
Tim Bentley Approve
Review via email: mp+291778@code.launchpad.net

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

Description of the change

In this re-proposal:

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

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

- Merged to trunk on 13.4.16, tests are now passing.

lp:~suutari-olli/openlp/show-no-logo-or-background-when-starting (revision 2642)

[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-01-Pull/1421/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-02-Functional-Tests/1338/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-03-Interface-Tests/1277/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1086/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/677/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-05a-Code_Analysis/744/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-05b-Test_Coverage/612/

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

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

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

- 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 : Posted in a previous version of this proposal

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
Revision history for this message
Tim Bentley (trb143) wrote :

See question below

Revision history for this message
Azaziah (suutari-olli) wrote :

Your question has been answered.

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