← Back to team overview

openlp-core team mailing list archive

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

 

Azaziah has proposed merging lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc into lp:openlp.

Requested reviews:
  Tim Bentley (trb143)
Related bugs:
  Bug #805082 in OpenLP: "[windows] F1 shortcut does not work"
  https://bugs.launchpad.net/openlp/+bug/805082
  Bug #1612187 in OpenLP: "Changing shortcut to a key that is already used produces traceback"
  https://bugs.launchpad.net/openlp/+bug/1612187
  Bug #1616441 in OpenLP: "Missing </strong> in String"
  https://bugs.launchpad.net/openlp/+bug/1616441

For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc/+merge/303995

- Changed the default shortcuts for Blank to desktop to Esc + D
- Removed default shortcut for "Escape item"
- Combined Offline & Online help buttons into "User Manual" button,
  which launches the appropriate help based on OS. (Offline for Win/Mac)
- Fixed bugs:
https://bugs.launchpad.net/openlp/+bug/805082
https://bugs.launchpad.net/openlp/+bug/1612187
https://bugs.launchpad.net/openlp/+bug/1616441
--------------------------------
lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc (revision 2704)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1761/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1672/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1610/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1366/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/956/
[SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1024/
[SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/892/
[SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/57/
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== 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-25 19:53:47 +0000
@@ -214,7 +214,10 @@
         ('media/players', 'media/players_temp', [(media_players_conv, None)]),  # Convert phonon to system
         ('media/players_temp', 'media/players', []),  # Move temp setting from above to correct setting
         ('advanced/default color', 'core/logo background color', []),  # Default image renamed + moved to general > 2.4.
-        ('advanced/default image', '/core/logo file', [])  # Default image renamed + moved to general after 2.4.
+        ('advanced/default image', 'core/logo file', []),  # Default image renamed + moved to general after 2.4.
+        ('shortcuts/escapeItem', 'shortcuts/desktopScreen', []),  # Default image renamed + moved to general after 2.4.
+        ('shortcuts/offlineHelpItem', 'shortcuts/HelpItem', []),  # Online and Offline help were combined in 2.6.
+        ('shortcuts/onlineHelpItem', 'shortcuts/HelpItem', [])  # Online and Offline help were combined in 2.6.
     ]
 
     @staticmethod
@@ -260,11 +263,12 @@
             'shortcuts/displayTagItem': [],
             'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)],
             'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)],
-            'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)],
+            'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Escape),
+                                        QtGui.QKeySequence(QtCore.Qt.Key_D)],
             'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],
             'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)],
             'shortcuts/editSong': [],
-            'shortcuts/escapeItem': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)],
+            'shortcuts/escapeItem': [],
             'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)],
             'shortcuts/exportThemeItem': [],
             'shortcuts/fileNewItem': [QtGui.QKeySequence(QtGui.QKeySequence.New)],
@@ -273,6 +277,7 @@
             'shortcuts/fileSaveItem': [QtGui.QKeySequence(QtGui.QKeySequence.Save)],
             'shortcuts/fileOpenItem': [QtGui.QKeySequence(QtGui.QKeySequence.Open)],
             'shortcuts/goLive': [],
+            'shortcuts/HelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
             'shortcuts/importThemeItem': [],
             'shortcuts/importBibleItem': [],
             'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],
@@ -333,8 +338,6 @@
                                            QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
             'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
             'shortcuts/newService': [],
-            'shortcuts/offlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
-            'shortcuts/onlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
             'shortcuts/openService': [],
             'shortcuts/saveService': [],
             'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up),

=== 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-08-25 19:53:47 +0000
@@ -208,7 +208,7 @@
             self.__button_state(False)
             self.description_word_count.setText(
                 translate('OpenLP.ExceptionDialog', '<strong>Please enter a more detailed description of the situation'
-                          ))
+                                                    '</strong>'))
 
     def on_attach_file_button_clicked(self):
         """

=== 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-25 19:53:47 +0000
@@ -309,21 +309,13 @@
         self.about_item.setMenuRole(QtWidgets.QAction.AboutRole)
         if is_win():
             self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm')
-            self.offline_help_item = create_action(main_window, 'offlineHelpItem',
-                                                   icon=':/system/system_help_contents.png',
-                                                   can_shortcuts=True,
-                                                   category=UiStrings().Help, triggers=self.on_offline_help_clicked)
         elif is_macosx():
             self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir),
                                                 '..', 'Resources', 'OpenLP.help')
-            self.offline_help_item = create_action(main_window, 'offlineHelpItem',
-                                                   icon=':/system/system_help_contents.png',
-                                                   can_shortcuts=True,
-                                                   category=UiStrings().Help, triggers=self.on_offline_help_clicked)
-        self.on_line_help_item = create_action(main_window, 'onlineHelpItem',
-                                               icon=':/system/system_online_help.png',
-                                               can_shortcuts=True,
-                                               category=UiStrings().Help, triggers=self.on_online_help_clicked)
+        self.on_help_item = create_action(main_window, 'HelpItem',
+                                          icon=':/system/system_help_contents.png',
+                                          can_shortcuts=True,
+                                          category=UiStrings().Help, triggers=self.on_help_clicked)
         self.web_site_item = create_action(main_window, 'webSiteItem', can_shortcuts=True, category=UiStrings().Help)
         # Shortcuts not connected to buttons or menu entries.
         self.search_shortcut_action = create_action(main_window,
@@ -362,11 +354,7 @@
         add_actions(self.tools_menu, (self.tools_open_data_folder, None))
         add_actions(self.tools_menu, (self.tools_first_time_wizard, None))
         add_actions(self.tools_menu, [self.update_theme_images])
-        if (is_win() or is_macosx()) and (hasattr(sys, 'frozen') and sys.frozen == 1):
-            add_actions(self.help_menu, (self.offline_help_item, self.on_line_help_item, None, self.web_site_item,
-                        self.about_item))
-        else:
-            add_actions(self.help_menu, (self.on_line_help_item, None, self.web_site_item, self.about_item))
+        add_actions(self.help_menu, (self.on_help_item, None, self.web_site_item, self.about_item))
         add_actions(self.menu_bar, (self.file_menu.menuAction(), self.view_menu.menuAction(),
                     self.tools_menu.menuAction(), self.settings_menu.menuAction(), self.help_menu.menuAction()))
         add_actions(self, [self.search_shortcut_action])
@@ -462,9 +450,7 @@
                                                                                    'from here.'))
         self.about_item.setText(translate('OpenLP.MainWindow', '&About'))
         self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP.'))
-        if is_win() or is_macosx():
-            self.offline_help_item.setText(translate('OpenLP.MainWindow', '&User Guide'))
-        self.on_line_help_item.setText(translate('OpenLP.MainWindow', '&Online Help'))
+        self.on_help_item.setText(translate('OpenLP.MainWindow', '&User Manual'))
         self.search_shortcut_action.setText(UiStrings().Search)
         self.search_shortcut_action.setToolTip(
             translate('OpenLP.MainWindow', 'Jump to the search box of the current active plugin.'))
@@ -778,18 +764,16 @@
         import webbrowser
         webbrowser.open_new('http://openlp.org/')
 
-    def on_offline_help_clicked(self):
-        """
-        Load the local OpenLP help file
-        """
-        QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))
-
-    def on_online_help_clicked(self):
-        """
-        Load the online OpenLP manual
-        """
-        import webbrowser
-        webbrowser.open_new('http://manual.openlp.org/')
+    def on_help_clicked(self):
+        """
+        If is_macosx or is_win, open the local OpenLP help file.
+        Use the Online manual in other cases. (Linux)
+        """
+        if is_macosx() or is_win():
+            QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))
+        else:
+            import webbrowser
+            webbrowser.open_new('http://manual.openlp.org/')
 
     def on_about_item_clicked(self):
         """

=== 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-25 19:53:47 +0000
@@ -426,11 +426,11 @@
                     is_valid = False
         if not is_valid:
             text = translate('OpenLP.ShortcutListDialog',
-                             'The shortcut "{key}" is already assigned to another action, please'
-                             ' use a different shortcut.'
+                             'The shortcut "{key}" is already assigned to another action,\n'
+                             'please use a different shortcut.'
                              ).format(key=self.get_shortcut_string(key_sequence))
             self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
-                                             text, for_display=True)
+                                             text)
             self.dialog_was_shown = True
         return is_valid
 

=== 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-25 19:53:47 +0000
@@ -234,21 +234,22 @@
             self.hide_menu.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup)
             self.hide_menu.setMenu(QtWidgets.QMenu(translate('OpenLP.SlideController', 'Hide'), self.toolbar))
             self.toolbar.add_toolbar_widget(self.hide_menu)
-            self.blank_screen = create_action(self, 'blankScreen',
-                                              text=translate('OpenLP.SlideController', 'Blank Screen'),
-                                              icon=':/slides/slide_blank.png',
-                                              checked=False, can_shortcuts=True, category=self.category,
-                                              triggers=self.on_blank_display)
-            self.theme_screen = create_action(self, 'themeScreen',
-                                              text=translate('OpenLP.SlideController', 'Blank to Theme'),
-                                              icon=':/slides/slide_theme.png',
-                                              checked=False, can_shortcuts=True, category=self.category,
-                                              triggers=self.on_theme_display)
+            # The order of the blank to modes in Shortcuts list comes from here.
             self.desktop_screen = create_action(self, 'desktopScreen',
                                                 text=translate('OpenLP.SlideController', 'Show Desktop'),
                                                 icon=':/slides/slide_desktop.png',
                                                 checked=False, can_shortcuts=True, category=self.category,
                                                 triggers=self.on_hide_display)
+            self.theme_screen = create_action(self, 'themeScreen',
+                                              text=translate('OpenLP.SlideController', 'Blank to Theme'),
+                                              icon=':/slides/slide_theme.png',
+                                              checked=False, can_shortcuts=True, category=self.category,
+                                              triggers=self.on_theme_display)
+            self.blank_screen = create_action(self, 'blankScreen',
+                                              text=translate('OpenLP.SlideController', 'Blank Screen'),
+                                              icon=':/slides/slide_blank.png',
+                                              checked=False, can_shortcuts=True, category=self.category,
+                                              triggers=self.on_blank_display)
             self.hide_menu.setDefaultAction(self.blank_screen)
             self.hide_menu.menu().addAction(self.blank_screen)
             self.hide_menu.menu().addAction(self.theme_screen)

=== 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-25 19:53:47 +0000
@@ -130,7 +130,6 @@
     <file>clear_shortcut.png</file>
     <file>system_about.png</file>
     <file>system_help_contents.png</file>
-    <file>system_online_help.png</file>
     <file>system_mediamanager.png</file>
     <file>system_volunteer.png</file>
     <file>system_servicemanager.png</file>

=== removed file 'resources/images/system_online_help.png'
Binary 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-25 19:53:47 +0000
@@ -114,6 +114,27 @@
                 self.assertEqual(self.media_item.search_results, {})
                 self.assertEqual(self.media_item.second_search_results, {})
 
+    def test_required_icons(self):
+        """
+        Test that all the required icons are set properly.
+        """
+        # GIVEN: Mocked icons that need to be called.
+        self.media_item.has_import_icon = MagicMock()
+        self.media_item.has_new_icon = MagicMock()
+        self.media_item.has_edit_icon = MagicMock()
+        self.media_item.has_delete_icon = MagicMock()
+        self.media_item.add_to_service_item = MagicMock()
+
+        # WHEN: self.media_item.required_icons is called
+        self.media_item.required_icons()
+
+        # THEN: On windows it should return True, on other platforms False
+        self.assertTrue(self.media_item.has_import_icon, 'Check that the icon is as True.')
+        self.assertFalse(self.media_item.has_new_icon, 'Check that the icon is called as False.')
+        self.assertTrue(self.media_item.has_edit_icon, 'Check that the icon is called as True.')
+        self.assertTrue(self.media_item.has_delete_icon, 'Check that the icon is called as True.')
+        self.assertFalse(self.media_item.add_to_service_item, 'Check that the icon is called as False')
+
     def on_quick_search_button_general_test(self):
         """
         Test that general things, which should be called on all Quick searches are called.


Follow ups