Merge lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc into lp:openlp

Proposed by Azaziah
Status: Merged
Merged at revision: 2699
Proposed branch: lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc
Merge into: lp:openlp
Diff against target: 438 lines (+89/-102)
12 files modified
openlp/core/common/settings.py (+6/-4)
openlp/core/ui/exceptiondialog.py (+1/-1)
openlp/core/ui/exceptionform.py (+1/-1)
openlp/core/ui/mainwindow.py (+16/-32)
openlp/core/ui/shortcutlistform.py (+3/-3)
openlp/core/ui/slidecontroller.py (+35/-30)
openlp/plugins/custom/lib/mediaitem.py (+1/-1)
openlp/plugins/songs/forms/editsongform.py (+1/-1)
resources/images/openlp-2.qrc (+0/-1)
tests/functional/openlp_core_ui/test_slidecontroller.py (+2/-25)
tests/functional/openlp_plugins/bibles/test_mediaitem.py (+21/-0)
tests/functional/openlp_plugins/bibles/test_swordimport.py (+2/-3)
To merge this branch: bzr merge lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc
Reviewer Review Type Date Requested Status
Tomas Groth Approve
Tim Bentley Approve
Review via email: mp+308660@code.launchpad.net

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

Description of the change

- Replaced Escape item with "Show desktop"
  (Same as blank to desktop, but does not unblank).
- Combined Offline & Online help buttons into "User Manual" button,
  which launches the appropriate help based on OS. (Offline for Win/Mac)
- Improved blank to modes shortcut descriptions.
- Setting migration for old help/escape help keys.

- Fixed bugs:
https://bugs.launchpad.net/openlp/+bug/805082
https://bugs.launchpad.net/openlp/+bug/1612187
https://bugs.launchpad.net/openlp/+bug/1616441
https://bugs.launchpad.net/openlp/+bug/1497637
https://bugs.launchpad.net/openlp/+bug/1294111

--------------------------------
lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc (revision 2716)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1799/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1710/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1648/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1404/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/994/
[SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1062/
[SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/930/
[SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/91/

To post a comment you must log in.
Revision history for this message
Azaziah (suutari-olli) wrote : Posted in a previous version of this proposal

See the comment for the right place.

"This used to be in self.main_window.warning_message, where it was causing traceback.

Does it still work?
I'm not exactly sure of what it's supposed to do to be honest.

Is there a reason why this could not be an a separate line?"

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

See below and tests would be nice.

review: Needs Fixing
Revision history for this message
Tomas Groth (tomasgroth) wrote : Posted in a previous version of this proposal

Looks good to me!
The only thing that nags me is that pressing Esc will also unblank. In my perception of the world Esc should only exit something - not bring it back!
If Tim and Raoul thinks it fine as it is, feel free to ignore me...

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

> Looks good to me!
> The only thing that nags me is that pressing Esc will also unblank. In my
> perception of the world Esc should only exit something - not bring it back!
> If Tim and Raoul thinks it fine as it is, feel free to ignore me...

Good point which I hadn't thought of before.
Perhaps we should create a new shortkey which would
only Blank to desktop but not unblank?

Revision history for this message
Tomas Groth (tomasgroth) wrote : Posted in a previous version of this proposal

A new blank-only shortcut sounds great to me :-)

Revision history for this message
Phill (phill-ridout) wrote : Posted in a previous version of this proposal

Looks good, just one question (see my in line comment).

Also don't forget to regenerate the resource file and submit it in a separate merge request (after this one has gone in)

Revision history for this message
Phill (phill-ridout) wrote : Posted in a previous version of this proposal

Should note that I've not tested this

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

> Looks good, just one question (see my in line comment).
>
> Also don't forget to regenerate the resource file and submit it in a separate
> merge request (after this one has gone in)

I've answered the question.

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

> Should note that I've not tested this

This should probably be tested on Linux just to make sure the Window manager
handles Blank to Desktop in single screen scenarios.

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

Ended up being unsaved comment, however:

"The automatic wrap puts all of text expect the last word to the same line,
it does not look good at all. I believe manual newline is better in this case.

See the image for reference:

https://drive.google.com/file/d/0B9y8rZiYItltamFQM0hOU0Nhd2s/view?usp=sharing "

Revision history for this message
Phill (phill-ridout) wrote : Posted in a previous version of this proposal

I've spoke to superfly, and he's happy with you adding the \n so looks good to me!

Revision history for this message
Tomas Groth (tomasgroth) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Tim Bentley (trb143) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

Sorry conflicts with trunk.

review: Needs Fixing
Revision history for this message
Tim Bentley (trb143) :
review: Approve
Revision history for this message
Tomas Groth (tomasgroth) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py 2016-07-31 11:58:54 +0000
+++ openlp/core/common/settings.py 2016-10-17 18:10:16 +0000
@@ -214,7 +214,10 @@
214 ('media/players', 'media/players_temp', [(media_players_conv, None)]), # Convert phonon to system214 ('media/players', 'media/players_temp', [(media_players_conv, None)]), # Convert phonon to system
215 ('media/players_temp', 'media/players', []), # Move temp setting from above to correct setting215 ('media/players_temp', 'media/players', []), # Move temp setting from above to correct setting
216 ('advanced/default color', 'core/logo background color', []), # Default image renamed + moved to general > 2.4.216 ('advanced/default color', 'core/logo background color', []), # Default image renamed + moved to general > 2.4.
217 ('advanced/default image', '/core/logo file', []) # Default image renamed + moved to general after 2.4.217 ('advanced/default image', 'core/logo file', []), # Default image renamed + moved to general after 2.4.
218 ('shortcuts/escapeItem', 'shortcuts/desktopScreenEnable', []), # Escape item was removed in 2.6.
219 ('shortcuts/offlineHelpItem', 'shortcuts/HelpItem', []), # Online and Offline help were combined in 2.6.
220 ('shortcuts/onlineHelpItem', 'shortcuts/HelpItem', []) # Online and Offline help were combined in 2.6.
218 ]221 ]
219222
220 @staticmethod223 @staticmethod
@@ -261,10 +264,10 @@
261 'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)],264 'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)],
262 'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)],265 'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)],
263 'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)],266 'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)],
267 'shortcuts/desktopScreenEnable': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)],
264 'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],268 'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],
265 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)],269 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)],
266 'shortcuts/editSong': [],270 'shortcuts/editSong': [],
267 'shortcuts/escapeItem': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)],
268 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)],271 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)],
269 'shortcuts/exportThemeItem': [],272 'shortcuts/exportThemeItem': [],
270 'shortcuts/fileNewItem': [QtGui.QKeySequence(QtGui.QKeySequence.New)],273 'shortcuts/fileNewItem': [QtGui.QKeySequence(QtGui.QKeySequence.New)],
@@ -273,6 +276,7 @@
273 'shortcuts/fileSaveItem': [QtGui.QKeySequence(QtGui.QKeySequence.Save)],276 'shortcuts/fileSaveItem': [QtGui.QKeySequence(QtGui.QKeySequence.Save)],
274 'shortcuts/fileOpenItem': [QtGui.QKeySequence(QtGui.QKeySequence.Open)],277 'shortcuts/fileOpenItem': [QtGui.QKeySequence(QtGui.QKeySequence.Open)],
275 'shortcuts/goLive': [],278 'shortcuts/goLive': [],
279 'shortcuts/HelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
276 'shortcuts/importThemeItem': [],280 'shortcuts/importThemeItem': [],
277 'shortcuts/importBibleItem': [],281 'shortcuts/importBibleItem': [],
278 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],282 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],
@@ -333,8 +337,6 @@
333 QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],337 QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
334 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],338 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
335 'shortcuts/newService': [],339 'shortcuts/newService': [],
336 'shortcuts/offlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
337 'shortcuts/onlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
338 'shortcuts/openService': [],340 'shortcuts/openService': [],
339 'shortcuts/saveService': [],341 'shortcuts/saveService': [],
340 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up),342 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up),
341343
=== modified file 'openlp/core/ui/exceptiondialog.py'
--- openlp/core/ui/exceptiondialog.py 2016-09-09 07:57:11 +0000
+++ openlp/core/ui/exceptiondialog.py 2016-10-17 18:10:16 +0000
@@ -107,7 +107,7 @@
107 '<strong>No email app? </strong> You can <strong>save</strong> this '107 '<strong>No email app? </strong> You can <strong>save</strong> this '
108 'information to a <strong>file</strong> and<br>'108 'information to a <strong>file</strong> and<br>'
109 'send it from your <strong>mail on browser</strong> via an <strong>attachment.</strong><br><br>'109 'send it from your <strong>mail on browser</strong> via an <strong>attachment.</strong><br><br>'
110 '<strong>Thank you<strong> for being part of making OpenLP better!<br>'110 '<strong>Thank you</strong> for being part of making OpenLP better!<br>'
111 ).format(first_part=exception_part1))111 ).format(first_part=exception_part1))
112 self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail'))112 self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail'))
113 self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File'))113 self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File'))
114114
=== modified file 'openlp/core/ui/exceptionform.py'
--- openlp/core/ui/exceptionform.py 2016-08-11 22:12:50 +0000
+++ openlp/core/ui/exceptionform.py 2016-10-17 18:10:16 +0000
@@ -208,7 +208,7 @@
208 self.__button_state(False)208 self.__button_state(False)
209 self.description_word_count.setText(209 self.description_word_count.setText(
210 translate('OpenLP.ExceptionDialog', '<strong>Please enter a more detailed description of the situation'210 translate('OpenLP.ExceptionDialog', '<strong>Please enter a more detailed description of the situation'
211 ))211 '</strong>'))
212212
213 def on_attach_file_button_clicked(self):213 def on_attach_file_button_clicked(self):
214 """214 """
215215
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2016-08-11 22:12:50 +0000
+++ openlp/core/ui/mainwindow.py 2016-10-17 18:10:16 +0000
@@ -309,21 +309,13 @@
309 self.about_item.setMenuRole(QtWidgets.QAction.AboutRole)309 self.about_item.setMenuRole(QtWidgets.QAction.AboutRole)
310 if is_win():310 if is_win():
311 self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm')311 self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm')
312 self.offline_help_item = create_action(main_window, 'offlineHelpItem',
313 icon=':/system/system_help_contents.png',
314 can_shortcuts=True,
315 category=UiStrings().Help, triggers=self.on_offline_help_clicked)
316 elif is_macosx():312 elif is_macosx():
317 self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir),313 self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir),
318 '..', 'Resources', 'OpenLP.help')314 '..', 'Resources', 'OpenLP.help')
319 self.offline_help_item = create_action(main_window, 'offlineHelpItem',315 self.on_help_item = create_action(main_window, 'HelpItem',
320 icon=':/system/system_help_contents.png',316 icon=':/system/system_help_contents.png',
321 can_shortcuts=True,317 can_shortcuts=True,
322 category=UiStrings().Help, triggers=self.on_offline_help_clicked)318 category=UiStrings().Help, triggers=self.on_help_clicked)
323 self.on_line_help_item = create_action(main_window, 'onlineHelpItem',
324 icon=':/system/system_online_help.png',
325 can_shortcuts=True,
326 category=UiStrings().Help, triggers=self.on_online_help_clicked)
327 self.web_site_item = create_action(main_window, 'webSiteItem', can_shortcuts=True, category=UiStrings().Help)319 self.web_site_item = create_action(main_window, 'webSiteItem', can_shortcuts=True, category=UiStrings().Help)
328 # Shortcuts not connected to buttons or menu entries.320 # Shortcuts not connected to buttons or menu entries.
329 self.search_shortcut_action = create_action(main_window,321 self.search_shortcut_action = create_action(main_window,
@@ -362,11 +354,7 @@
362 add_actions(self.tools_menu, (self.tools_open_data_folder, None))354 add_actions(self.tools_menu, (self.tools_open_data_folder, None))
363 add_actions(self.tools_menu, (self.tools_first_time_wizard, None))355 add_actions(self.tools_menu, (self.tools_first_time_wizard, None))
364 add_actions(self.tools_menu, [self.update_theme_images])356 add_actions(self.tools_menu, [self.update_theme_images])
365 if (is_win() or is_macosx()) and (hasattr(sys, 'frozen') and sys.frozen == 1):357 add_actions(self.help_menu, (self.on_help_item, None, self.web_site_item, self.about_item))
366 add_actions(self.help_menu, (self.offline_help_item, self.on_line_help_item, None, self.web_site_item,
367 self.about_item))
368 else:
369 add_actions(self.help_menu, (self.on_line_help_item, None, self.web_site_item, self.about_item))
370 add_actions(self.menu_bar, (self.file_menu.menuAction(), self.view_menu.menuAction(),358 add_actions(self.menu_bar, (self.file_menu.menuAction(), self.view_menu.menuAction(),
371 self.tools_menu.menuAction(), self.settings_menu.menuAction(), self.help_menu.menuAction()))359 self.tools_menu.menuAction(), self.settings_menu.menuAction(), self.help_menu.menuAction()))
372 add_actions(self, [self.search_shortcut_action])360 add_actions(self, [self.search_shortcut_action])
@@ -462,9 +450,7 @@
462 'from here.'))450 'from here.'))
463 self.about_item.setText(translate('OpenLP.MainWindow', '&About'))451 self.about_item.setText(translate('OpenLP.MainWindow', '&About'))
464 self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP.'))452 self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP.'))
465 if is_win() or is_macosx():453 self.on_help_item.setText(translate('OpenLP.MainWindow', '&User Manual'))
466 self.offline_help_item.setText(translate('OpenLP.MainWindow', '&User Guide'))
467 self.on_line_help_item.setText(translate('OpenLP.MainWindow', '&Online Help'))
468 self.search_shortcut_action.setText(UiStrings().Search)454 self.search_shortcut_action.setText(UiStrings().Search)
469 self.search_shortcut_action.setToolTip(455 self.search_shortcut_action.setToolTip(
470 translate('OpenLP.MainWindow', 'Jump to the search box of the current active plugin.'))456 translate('OpenLP.MainWindow', 'Jump to the search box of the current active plugin.'))
@@ -778,18 +764,16 @@
778 import webbrowser764 import webbrowser
779 webbrowser.open_new('http://openlp.org/')765 webbrowser.open_new('http://openlp.org/')
780766
781 def on_offline_help_clicked(self):767 def on_help_clicked(self):
782 """768 """
783 Load the local OpenLP help file769 If is_macosx or is_win, open the local OpenLP help file.
784 """770 Use the Online manual in other cases. (Linux)
785 QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))771 """
786772 if is_macosx() or is_win():
787 def on_online_help_clicked(self):773 QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))
788 """774 else:
789 Load the online OpenLP manual775 import webbrowser
790 """776 webbrowser.open_new('http://manual.openlp.org/')
791 import webbrowser
792 webbrowser.open_new('http://manual.openlp.org/')
793777
794 def on_about_item_clicked(self):778 def on_about_item_clicked(self):
795 """779 """
796780
=== modified file 'openlp/core/ui/shortcutlistform.py'
--- openlp/core/ui/shortcutlistform.py 2016-05-20 16:22:06 +0000
+++ openlp/core/ui/shortcutlistform.py 2016-10-17 18:10:16 +0000
@@ -426,11 +426,11 @@
426 is_valid = False426 is_valid = False
427 if not is_valid:427 if not is_valid:
428 text = translate('OpenLP.ShortcutListDialog',428 text = translate('OpenLP.ShortcutListDialog',
429 'The shortcut "{key}" is already assigned to another action, please'429 'The shortcut "{key}" is already assigned to another action,\n'
430 ' use a different shortcut.'430 'please use a different shortcut.'
431 ).format(key=self.get_shortcut_string(key_sequence))431 ).format(key=self.get_shortcut_string(key_sequence))
432 self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),432 self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
433 text, for_display=True)433 text)
434 self.dialog_was_shown = True434 self.dialog_was_shown = True
435 return is_valid435 return is_valid
436436
437437
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2016-08-10 18:50:40 +0000
+++ openlp/core/ui/slidecontroller.py 2016-10-17 18:10:16 +0000
@@ -234,25 +234,32 @@
234 self.hide_menu.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup)234 self.hide_menu.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup)
235 self.hide_menu.setMenu(QtWidgets.QMenu(translate('OpenLP.SlideController', 'Hide'), self.toolbar))235 self.hide_menu.setMenu(QtWidgets.QMenu(translate('OpenLP.SlideController', 'Hide'), self.toolbar))
236 self.toolbar.add_toolbar_widget(self.hide_menu)236 self.toolbar.add_toolbar_widget(self.hide_menu)
237 self.blank_screen = create_action(self, 'blankScreen',237 # The order of the blank to modes in Shortcuts list comes from here.
238 text=translate('OpenLP.SlideController', 'Blank Screen'),238 self.desktop_screen_enable = create_action(self, 'desktopScreenEnable',
239 icon=':/slides/slide_blank.png',239 text=translate('OpenLP.SlideController', 'Show Desktop'),
240 checked=False, can_shortcuts=True, category=self.category,240 icon=':/slides/slide_desktop.png', can_shortcuts=True,
241 triggers=self.on_blank_display)241 context=QtCore.Qt.WidgetWithChildrenShortcut,
242 self.theme_screen = create_action(self, 'themeScreen',242 category=self.category, triggers=self.on_hide_display_enable)
243 text=translate('OpenLP.SlideController', 'Blank to Theme'),
244 icon=':/slides/slide_theme.png',
245 checked=False, can_shortcuts=True, category=self.category,
246 triggers=self.on_theme_display)
247 self.desktop_screen = create_action(self, 'desktopScreen',243 self.desktop_screen = create_action(self, 'desktopScreen',
248 text=translate('OpenLP.SlideController', 'Show Desktop'),244 text=translate('OpenLP.SlideController', 'Toggle Desktop'),
249 icon=':/slides/slide_desktop.png',245 icon=':/slides/slide_desktop.png',
250 checked=False, can_shortcuts=True, category=self.category,246 checked=False, can_shortcuts=True, category=self.category,
251 triggers=self.on_hide_display)247 triggers=self.on_hide_display)
248 self.theme_screen = create_action(self, 'themeScreen',
249 text=translate('OpenLP.SlideController', 'Toggle Blank to Theme'),
250 icon=':/slides/slide_theme.png',
251 checked=False, can_shortcuts=True, category=self.category,
252 triggers=self.on_theme_display)
253 self.blank_screen = create_action(self, 'blankScreen',
254 text=translate('OpenLP.SlideController', 'Toggle Blank Screen'),
255 icon=':/slides/slide_blank.png',
256 checked=False, can_shortcuts=True, category=self.category,
257 triggers=self.on_blank_display)
252 self.hide_menu.setDefaultAction(self.blank_screen)258 self.hide_menu.setDefaultAction(self.blank_screen)
253 self.hide_menu.menu().addAction(self.blank_screen)259 self.hide_menu.menu().addAction(self.blank_screen)
254 self.hide_menu.menu().addAction(self.theme_screen)260 self.hide_menu.menu().addAction(self.theme_screen)
255 self.hide_menu.menu().addAction(self.desktop_screen)261 self.hide_menu.menu().addAction(self.desktop_screen)
262 self.hide_menu.menu().addAction(self.desktop_screen_enable)
256 # Wide menu of display control buttons.263 # Wide menu of display control buttons.
257 self.blank_screen_button = QtWidgets.QToolButton(self.toolbar)264 self.blank_screen_button = QtWidgets.QToolButton(self.toolbar)
258 self.blank_screen_button.setObjectName('blank_screen_button')265 self.blank_screen_button.setObjectName('blank_screen_button')
@@ -512,23 +519,6 @@
512 can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut,519 can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut,
513 category=self.category,520 category=self.category,
514 triggers=self.service_next)521 triggers=self.service_next)
515 self.escape_item = create_action(parent, 'escapeItem',
516 text=translate('OpenLP.SlideController', 'Escape Item'),
517 can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut,
518 category=self.category,
519 triggers=self.live_escape)
520
521 def live_escape(self, field=None):
522 """
523 If you press ESC on the live screen it should close the display temporarily.
524 """
525 self.display.setVisible(False)
526 self.media_controller.media_stop(self)
527 # Stop looping if active
528 if self.play_slides_loop.isChecked():
529 self.on_play_slides_loop(False)
530 elif self.play_slides_once.isChecked():
531 self.on_play_slides_once(False)
532522
533 def toggle_display(self, action):523 def toggle_display(self, action):
534 """524 """
@@ -622,7 +612,7 @@
622 widget.addActions([612 widget.addActions([
623 self.previous_item, self.next_item,613 self.previous_item, self.next_item,
624 self.previous_service, self.next_service,614 self.previous_service, self.next_service,
625 self.escape_item,615 self.desktop_screen_enable,
626 self.desktop_screen,616 self.desktop_screen,
627 self.theme_screen,617 self.theme_screen,
628 self.blank_screen])618 self.blank_screen])
@@ -965,7 +955,7 @@
965 else:955 else:
966 Registry().execute('live_display_show')956 Registry().execute('live_display_show')
967 else:957 else:
968 self.live_escape()958 self.on_hide_display_enable()
969959
970 def on_slide_blank(self):960 def on_slide_blank(self):
971 """961 """
@@ -1025,6 +1015,7 @@
1025 def on_hide_display(self, checked=None):1015 def on_hide_display(self, checked=None):
1026 """1016 """
1027 Handle the Hide screen button1017 Handle the Hide screen button
1018 This toggles the desktop screen.
10281019
1029 :param checked: the new state of the of the widget1020 :param checked: the new state of the of the widget
1030 """1021 """
@@ -1043,6 +1034,20 @@
1043 self.update_preview()1034 self.update_preview()
1044 self.on_toggle_loop()1035 self.on_toggle_loop()
10451036
1037 def on_hide_display_enable(self, checked=None):
1038 """
1039 Handle the on_hide_display_enable
1040 This only enables the desktop screen.
1041
1042 :param checked: the new state of the of the widget
1043 """
1044 self.blank_screen.setChecked(False)
1045 self.theme_screen.setChecked(False)
1046 Registry().execute('live_display_hide', HideMode.Screen)
1047 self.desktop_screen.setChecked(True)
1048 self.update_preview()
1049 self.on_toggle_loop()
1050
1046 def blank_plugin(self):1051 def blank_plugin(self):
1047 """1052 """
1048 Blank/Hide the display screen within a plugin if required.1053 Blank/Hide the display screen within a plugin if required.
10491054
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2016-05-21 18:19:18 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2016-10-17 18:10:16 +0000
@@ -350,7 +350,7 @@
350 :param string: The search string350 :param string: The search string
351 :param show_error: The error string to be show.351 :param show_error: The error string to be show.
352 """352 """
353 search = '%{search}%'.forma(search=string.lower())353 search = '%{search}%'.format(search=string.lower())
354 search_results = self.plugin.db_manager.get_all_objects(CustomSlide,354 search_results = self.plugin.db_manager.get_all_objects(CustomSlide,
355 or_(func.lower(CustomSlide.title).like(search),355 or_(func.lower(CustomSlide.title).like(search),
356 func.lower(CustomSlide.text).like(search)),356 func.lower(CustomSlide.text).like(search)),
357357
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2016-05-27 08:13:14 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2016-10-17 18:10:16 +0000
@@ -317,7 +317,7 @@
317 self.song.verse_order = re.sub('([' + verse.upper() + verse.lower() + '])(\W|$)',317 self.song.verse_order = re.sub('([' + verse.upper() + verse.lower() + '])(\W|$)',
318 r'\g<1>1\2', self.song.verse_order)318 r'\g<1>1\2', self.song.verse_order)
319 except:319 except:
320 log.exception('Problem processing song Lyrics \n{xml}'.forma(xml=sxml.dump_xml()))320 log.exception('Problem processing song Lyrics \n{xml}'.format(xml=sxml.dump_xml()))
321 raise321 raise
322322
323 def keyPressEvent(self, event):323 def keyPressEvent(self, event):
324324
=== modified file 'resources/images/openlp-2.qrc'
--- resources/images/openlp-2.qrc 2016-06-14 21:49:29 +0000
+++ resources/images/openlp-2.qrc 2016-10-17 18:10:16 +0000
@@ -130,7 +130,6 @@
130 <file>clear_shortcut.png</file>130 <file>clear_shortcut.png</file>
131 <file>system_about.png</file>131 <file>system_about.png</file>
132 <file>system_help_contents.png</file>132 <file>system_help_contents.png</file>
133 <file>system_online_help.png</file>
134 <file>system_mediamanager.png</file>133 <file>system_mediamanager.png</file>
135 <file>system_volunteer.png</file>134 <file>system_volunteer.png</file>
136 <file>system_servicemanager.png</file>135 <file>system_servicemanager.png</file>
137136
=== removed file 'resources/images/system_online_help.png'
138Binary files resources/images/system_online_help.png 2011-05-25 06:56:33 +0000 and resources/images/system_online_help.png 1970-01-01 00:00:00 +0000 differ137Binary files resources/images/system_online_help.png 2011-05-25 06:56:33 +0000 and resources/images/system_online_help.png 1970-01-01 00:00:00 +0000 differ
=== modified file 'tests/functional/openlp_core_ui/test_slidecontroller.py'
--- tests/functional/openlp_core_ui/test_slidecontroller.py 2016-08-13 14:29:12 +0000
+++ tests/functional/openlp_core_ui/test_slidecontroller.py 2016-10-17 18:10:16 +0000
@@ -208,29 +208,6 @@
208 mocked_on_theme_display.assert_called_once_with(False)208 mocked_on_theme_display.assert_called_once_with(False)
209 mocked_on_hide_display.assert_called_once_with(False)209 mocked_on_hide_display.assert_called_once_with(False)
210210
211 def test_live_escape(self):
212 """
213 Test that when the live_escape() method is called, the display is set to invisible and any media is stopped
214 """
215 # GIVEN: A new SlideController instance and mocked out display and media_controller
216 mocked_display = MagicMock()
217 mocked_media_controller = MagicMock()
218 Registry.create()
219 Registry().register('media_controller', mocked_media_controller)
220 slide_controller = SlideController(None)
221 slide_controller.display = mocked_display
222 play_slides = MagicMock()
223 play_slides.isChecked.return_value = False
224 slide_controller.play_slides_loop = play_slides
225 slide_controller.play_slides_once = play_slides
226
227 # WHEN: live_escape() is called
228 slide_controller.live_escape()
229
230 # THEN: the display should be set to invisible and the media controller stopped
231 mocked_display.setVisible.assert_called_once_with(False)
232 mocked_media_controller.media_stop.assert_called_once_with(slide_controller)
233
234 def test_on_go_live_live_controller(self):211 def test_on_go_live_live_controller(self):
235 """212 """
236 Test that when the on_go_live() method is called the message is sent to the live controller and focus is213 Test that when the on_go_live() method is called the message is sent to the live controller and focus is
@@ -697,7 +674,7 @@
697 slide_controller.next_item = MagicMock()674 slide_controller.next_item = MagicMock()
698 slide_controller.previous_service = MagicMock()675 slide_controller.previous_service = MagicMock()
699 slide_controller.next_service = MagicMock()676 slide_controller.next_service = MagicMock()
700 slide_controller.escape_item = MagicMock()677 slide_controller.desktop_screen_enable = MagicMock()
701 slide_controller.desktop_screen = MagicMock()678 slide_controller.desktop_screen = MagicMock()
702 slide_controller.blank_screen = MagicMock()679 slide_controller.blank_screen = MagicMock()
703 slide_controller.theme_screen = MagicMock()680 slide_controller.theme_screen = MagicMock()
@@ -709,7 +686,7 @@
709 mocked_widget.addActions.assert_called_with([686 mocked_widget.addActions.assert_called_with([
710 slide_controller.previous_item, slide_controller.next_item,687 slide_controller.previous_item, slide_controller.next_item,
711 slide_controller.previous_service, slide_controller.next_service,688 slide_controller.previous_service, slide_controller.next_service,
712 slide_controller.escape_item, slide_controller.desktop_screen,689 slide_controller.desktop_screen_enable, slide_controller.desktop_screen,
713 slide_controller.theme_screen, slide_controller.blank_screen690 slide_controller.theme_screen, slide_controller.blank_screen
714 ])691 ])
715692
716693
=== modified file 'tests/functional/openlp_plugins/bibles/test_mediaitem.py'
--- tests/functional/openlp_plugins/bibles/test_mediaitem.py 2016-09-17 23:07:24 +0000
+++ tests/functional/openlp_plugins/bibles/test_mediaitem.py 2016-10-17 18:10:16 +0000
@@ -114,6 +114,27 @@
114 self.assertEqual(self.media_item.search_results, {})114 self.assertEqual(self.media_item.search_results, {})
115 self.assertEqual(self.media_item.second_search_results, {})115 self.assertEqual(self.media_item.second_search_results, {})
116116
117 def test_required_icons(self):
118 """
119 Test that all the required icons are set properly.
120 """
121 # GIVEN: Mocked icons that need to be called.
122 self.media_item.has_import_icon = MagicMock()
123 self.media_item.has_new_icon = MagicMock()
124 self.media_item.has_edit_icon = MagicMock()
125 self.media_item.has_delete_icon = MagicMock()
126 self.media_item.add_to_service_item = MagicMock()
127
128 # WHEN: self.media_item.required_icons is called
129 self.media_item.required_icons()
130
131 # THEN: On windows it should return True, on other platforms False
132 self.assertTrue(self.media_item.has_import_icon, 'Check that the icon is as True.')
133 self.assertFalse(self.media_item.has_new_icon, 'Check that the icon is called as False.')
134 self.assertTrue(self.media_item.has_edit_icon, 'Check that the icon is called as True.')
135 self.assertTrue(self.media_item.has_delete_icon, 'Check that the icon is called as True.')
136 self.assertFalse(self.media_item.add_to_service_item, 'Check that the icon is called as False')
137
117 def test_on_quick_search_button_general(self):138 def test_on_quick_search_button_general(self):
118 """139 """
119 Test that general things, which should be called on all Quick searches are called.140 Test that general things, which should be called on all Quick searches are called.
120141
=== modified file 'tests/functional/openlp_plugins/bibles/test_swordimport.py'
--- tests/functional/openlp_plugins/bibles/test_swordimport.py 2016-09-04 21:16:43 +0000
+++ tests/functional/openlp_plugins/bibles/test_swordimport.py 2016-10-17 18:10:16 +0000
@@ -70,8 +70,7 @@
7070
71 @patch('openlp.plugins.bibles.lib.importers.sword.SwordBible.application')71 @patch('openlp.plugins.bibles.lib.importers.sword.SwordBible.application')
72 @patch('openlp.plugins.bibles.lib.importers.sword.modules')72 @patch('openlp.plugins.bibles.lib.importers.sword.modules')
73 @patch('openlp.core.common.languages')73 def test_simple_import(self, mocked_pysword_modules, mocked_application):
74 def test_simple_import(self, mocked_languages, mocked_pysword_modules, mocked_application):
75 """74 """
76 Test that a simple SWORD import works75 Test that a simple SWORD import works
77 """76 """
@@ -88,7 +87,7 @@
88 importer.create_verse = MagicMock()87 importer.create_verse = MagicMock()
89 importer.create_book = MagicMock()88 importer.create_book = MagicMock()
90 importer.session = MagicMock()89 importer.session = MagicMock()
91 mocked_languages.get_language.return_value = 'Danish'90 importer.get_language = MagicMock(return_value='Danish')
92 mocked_bible = MagicMock()91 mocked_bible = MagicMock()
93 mocked_genesis = MagicMock()92 mocked_genesis = MagicMock()
94 mocked_genesis.name = 'Genesis'93 mocked_genesis.name = 'Genesis'