← 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:
  OpenLP Core (openlp-core)
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

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

- For diff
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc into 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-14 20:56:36 +0000
@@ -214,7 +214,9 @@
         ('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/offlineHelpItem', 'shortcuts/HelpItem', []),  # There used to be separated buttons for local and
+        ('shortcuts/onlineHelpItem', 'shortcuts/HelpItem', [])  # online help buttons. Now combined into one since 2.6.
     ]
 
     @staticmethod
@@ -254,17 +256,18 @@
             QtCore.QSettings.__init__(self, *args)
         # Add shortcuts here so QKeySequence has a QApplication instance to use.
         Settings.__default_settings__.update({
-            'shortcuts/aboutItem': [QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F1)],
+            'shortcuts/aboutItem': [QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_F1)],
             'shortcuts/addToService': [],
             'shortcuts/audioPauseItem': [],
             '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 +276,7 @@
             'shortcuts/fileSaveItem': [QtGui.QKeySequence(QtGui.QKeySequence.Save)],
             'shortcuts/fileOpenItem': [QtGui.QKeySequence(QtGui.QKeySequence.Open)],
             'shortcuts/goLive': [],
+            'shortcuts/HelpItem': [QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F1)],
             'shortcuts/importThemeItem': [],
             'shortcuts/importBibleItem': [],
             'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],
@@ -333,8 +337,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/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2016-08-11 22:12:50 +0000
+++ openlp/core/ui/mainwindow.py	2016-08-14 20:56:36 +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',
+        self.on_help_item = create_action(main_window, 'HelpItem',
+                                               icon=':/system/system_help_contents.png',
                                                can_shortcuts=True,
-                                               category=UiStrings().Help, triggers=self.on_online_help_clicked)
+                                               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-14 20:56:36 +0000
@@ -430,7 +430,8 @@
                              ' 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)
+            for_display = True
             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-14 20:56:36 +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-14 20:56:36 +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

References