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

Proposed by Azaziah
Status: Superseded
Proposed branch: lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc
Merge into: lp:openlp
Diff against target: 232 lines (+59/-51)
6 files modified
openlp/core/common/settings.py (+8/-5)
openlp/core/ui/mainwindow.py (+16/-32)
openlp/core/ui/shortcutlistform.py (+3/-3)
openlp/core/ui/slidecontroller.py (+11/-10)
resources/images/openlp-2.qrc (+0/-1)
tests/functional/openlp_plugins/bibles/test_mediaitem.py (+21/-0)
To merge this branch: bzr merge lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc
Reviewer Review Type Date Requested Status
Tim Bentley Needs Fixing
Review via email: mp+302896@code.launchpad.net

This proposal supersedes a proposal from 2016-08-14.

This proposal has been superseded by a proposal from 2016-08-20.

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

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 :

See below and tests would be nice.

review: Needs Fixing
2700. By Azaziah

- Removed for_display=True which was causing traceback since it's apparently no longer used.
- Added manual row split for the duplicated key error message.
  (Looks bad to have 12 words in one row and then one word in the row after that)

2701. By Azaziah

- Added test

2702. By Azaziah

- Removed modifications to test_mainwindow.

2703. By Azaziah

- Added the missing </strong> tag to expection form. (bug 1616441)

2704. By Azaziah

- Merged trunk

2705. By Azaziah

- A working only blank to desktop

2706. By Azaziah

- fixed the "blank only" button visibility

2707. By Azaziah

- The new method now also stops loops.

2708. By Azaziah

- Renamed some code

2709. By Azaziah

- Setting migration for escape item
- Renamed shortcut descriptions for blanks

2710. By Azaziah

- Removed the old "escape item" test.

2711. By Azaziah

Fixed 1 strong tag

2712. By Azaziah

- Fixed some .forma tags to .format

2713. By Azaziah

- Removed one unrequired code line

2714. By Azaziah

- Merged trunk on 4.10.16

2715. By Azaziah

- Added pip's fix for sword test

2716. By Azaziah

- Merged trunk and fixed conflict.

Unmerged revisions

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-08-20 19:19:48 +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/desktopScreen', []), # Default image renamed + moved to general after 2.4.
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
@@ -260,11 +263,12 @@
260 'shortcuts/displayTagItem': [],263 'shortcuts/displayTagItem': [],
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_Escape),
267 QtGui.QKeySequence(QtCore.Qt.Key_D)],
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)],271 'shortcuts/escapeItem': [],
268 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)],272 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)],
269 'shortcuts/exportThemeItem': [],273 'shortcuts/exportThemeItem': [],
270 'shortcuts/fileNewItem': [QtGui.QKeySequence(QtGui.QKeySequence.New)],274 'shortcuts/fileNewItem': [QtGui.QKeySequence(QtGui.QKeySequence.New)],
@@ -273,6 +277,7 @@
273 'shortcuts/fileSaveItem': [QtGui.QKeySequence(QtGui.QKeySequence.Save)],277 'shortcuts/fileSaveItem': [QtGui.QKeySequence(QtGui.QKeySequence.Save)],
274 'shortcuts/fileOpenItem': [QtGui.QKeySequence(QtGui.QKeySequence.Open)],278 'shortcuts/fileOpenItem': [QtGui.QKeySequence(QtGui.QKeySequence.Open)],
275 'shortcuts/goLive': [],279 'shortcuts/goLive': [],
280 'shortcuts/HelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
276 'shortcuts/importThemeItem': [],281 'shortcuts/importThemeItem': [],
277 'shortcuts/importBibleItem': [],282 'shortcuts/importBibleItem': [],
278 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],283 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],
@@ -333,8 +338,6 @@
333 QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],338 QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
334 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],339 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
335 'shortcuts/newService': [],340 'shortcuts/newService': [],
336 'shortcuts/offlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
337 'shortcuts/onlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
338 'shortcuts/openService': [],341 'shortcuts/openService': [],
339 'shortcuts/saveService': [],342 'shortcuts/saveService': [],
340 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up),343 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up),
341344
=== 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-08-20 19:19:48 +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-08-20 19:19:48 +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-08-20 19:19:48 +0000
@@ -234,21 +234,22 @@
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'),
239 icon=':/slides/slide_blank.png',
240 checked=False, can_shortcuts=True, category=self.category,
241 triggers=self.on_blank_display)
242 self.theme_screen = create_action(self, 'themeScreen',
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',238 self.desktop_screen = create_action(self, 'desktopScreen',
248 text=translate('OpenLP.SlideController', 'Show Desktop'),239 text=translate('OpenLP.SlideController', 'Show Desktop'),
249 icon=':/slides/slide_desktop.png',240 icon=':/slides/slide_desktop.png',
250 checked=False, can_shortcuts=True, category=self.category,241 checked=False, can_shortcuts=True, category=self.category,
251 triggers=self.on_hide_display)242 triggers=self.on_hide_display)
243 self.theme_screen = create_action(self, 'themeScreen',
244 text=translate('OpenLP.SlideController', 'Blank to Theme'),
245 icon=':/slides/slide_theme.png',
246 checked=False, can_shortcuts=True, category=self.category,
247 triggers=self.on_theme_display)
248 self.blank_screen = create_action(self, 'blankScreen',
249 text=translate('OpenLP.SlideController', 'Blank Screen'),
250 icon=':/slides/slide_blank.png',
251 checked=False, can_shortcuts=True, category=self.category,
252 triggers=self.on_blank_display)
252 self.hide_menu.setDefaultAction(self.blank_screen)253 self.hide_menu.setDefaultAction(self.blank_screen)
253 self.hide_menu.menu().addAction(self.blank_screen)254 self.hide_menu.menu().addAction(self.blank_screen)
254 self.hide_menu.menu().addAction(self.theme_screen)255 self.hide_menu.menu().addAction(self.theme_screen)
255256
=== 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-08-20 19:19:48 +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_plugins/bibles/test_mediaitem.py'
--- tests/functional/openlp_plugins/bibles/test_mediaitem.py 2016-06-14 21:55:37 +0000
+++ tests/functional/openlp_plugins/bibles/test_mediaitem.py 2016-08-20 19:19:48 +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 on_quick_search_button_general_test(self):138 def on_quick_search_button_general_test(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.