From 4cb3debb655c5ccf01b743d691d45fb86e1af936 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Thu, 11 Aug 2016 14:32:44 +0300 Subject: [PATCH 01/22] - Fixed bug: https://bugs.launchpad.net/openlp/+bug/1612187 - Changed the default hotkey for "Blank to Desktop" to "Esc", added "D" as an alternative shortcut. - Removed the default shortcut for "Escape item". --- openlp/core/common/settings.py | 5 +++-- openlp/core/ui/shortcutlistform.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 2caf04dab..a53c55244 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -260,11 +260,12 @@ class Settings(QtCore.QSettings): '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)], diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 1266d1cc4..e23fa0a27 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -430,7 +430,8 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert ' 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 From 9794d26e9550031056433f0619a9a63509daf606 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Thu, 11 Aug 2016 16:28:30 +0300 Subject: [PATCH 02/22] - Changed the order of blank to modes in Shortcuts list from: Black, theme, desktop to desktop, theme, black. - Pep8 fix (Ident) --- openlp/core/common/settings.py | 2 +- openlp/core/ui/slidecontroller.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index a53c55244..0be8d819a 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -261,7 +261,7 @@ class Settings(QtCore.QSettings): 'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)], 'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)], 'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Escape), - QtGui.QKeySequence(QtCore.Qt.Key_D)], + QtGui.QKeySequence(QtCore.Qt.Key_D)], 'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)], 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)], 'shortcuts/editSong': [], diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 7121e5227..43348a980 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -234,21 +234,21 @@ class SlideController(DisplayController, RegistryProperties): 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) 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) From f590294b4adf9838e1f6ffeedcb654014103bd53 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Thu, 11 Aug 2016 23:54:56 +0300 Subject: [PATCH 03/22] - Coded a combined help button, which opens the Local Help if using Mac or Win and Online help if using other OS's. (still need to change the help menu items) --- openlp/core/common/settings.py | 6 +++--- openlp/core/ui/mainwindow.py | 24 +++++++++++------------- openlp/core/ui/slidecontroller.py | 1 + 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 0be8d819a..11aaeae83 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -254,7 +254,7 @@ class Settings(QtCore.QSettings): 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': [], @@ -334,8 +334,8 @@ class Settings(QtCore.QSettings): 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/offlineHelpItem': [QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F1)], + 'shortcuts/onlineHelpItem': [QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F1)], 'shortcuts/openService': [], 'shortcuts/saveService': [], 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 32b1c4db2..2f51dd997 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -312,18 +312,18 @@ class Ui_MainWindow(object): 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) + category=UiStrings().Help, triggers=self.on_help_button_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) + category=UiStrings().Help, triggers=self.on_help_button_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) + category=UiStrings().Help, triggers=self.on_help_button_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, @@ -778,18 +778,16 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): import webbrowser webbrowser.open_new('http://openlp.org/') - def on_offline_help_clicked(self): + def on_help_button_clicked(self): """ - Load the local OpenLP help file + If is_macosx or is_win, open the local OpenLP help file. + Use the Online manual in other cases. (Linux) """ - 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/') + 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): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 43348a980..f56e8247e 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -234,6 +234,7 @@ class SlideController(DisplayController, RegistryProperties): 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) + # 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', From 851a35a8227f75fb0e2782181b168ed51fcd5ca6 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 12 Aug 2016 00:11:34 +0300 Subject: [PATCH 04/22] - Removed Local & Online help buttons, created "User manual" button. --- openlp/core/ui/mainwindow.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 2f51dd997..ef3c8d06d 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -309,21 +309,13 @@ class Ui_MainWindow(object): 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_help_button_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_help_button_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, 'onlineHelpItem', + icon=':/system/system_help_contents.png', can_shortcuts=True, - category=UiStrings().Help, triggers=self.on_help_button_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 @@ class Ui_MainWindow(object): 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 @@ class Ui_MainWindow(object): '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,7 +764,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): import webbrowser webbrowser.open_new('http://openlp.org/') - def on_help_button_clicked(self): + 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) From 4944a98a1de4810cfb99bbdd5a1b46156f2458c8 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 12 Aug 2016 00:15:03 +0300 Subject: [PATCH 05/22] - Removed resources/images/system_online_help.png as it is no longer needed. --- resources/images/openlp-2.qrc | 1 - resources/images/system_online_help.png | Bin 953 -> 0 bytes 2 files changed, 1 deletion(-) delete mode 100644 resources/images/system_online_help.png diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index b45cc745d..867e4dd7a 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -130,7 +130,6 @@ clear_shortcut.png system_about.png system_help_contents.png - system_online_help.png system_mediamanager.png system_volunteer.png system_servicemanager.png diff --git a/resources/images/system_online_help.png b/resources/images/system_online_help.png deleted file mode 100644 index 670c0716f6b7ad8188916f43c4ce6607eb76dcbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 953 zcmV;q14jIbP)@AEu!U{b6o>#4 z1W{1Yzz+x%G$0{Cnp9w02ni{Y1uYVPfr1u>B{`q0CI3_WlmbwM+?u5is{)=3PX9q z)X?ar%*;>Hies9wA`p^CZN=7sN06jA+1&esqsvuU=(9hZt_(XG$ul!!#2QirFJG_t(cLKJ`T=8Mn?*7TTU8VnT7FZw!L99r1LShU8fi0xi zNt79iQbX-5;JaUUs617sk%BKRRK_AZATd&)O-i35S=*=+)lSfD>3uyCmemPM(Mqg=>xspwLB)TY@8NE$xgh8Kqod0ocw(z;USmR}2W*0yMOx@^`v z?6*RO^EP9HS*jNY@DpeU5w_8^wpu1=#a}74v?c*sp7&*=*16l>IMq4VAy6sxcFcHx zhLN5mPEt~nAf&~~y}D^_H-C@(&SwBNfHA9)5I0`ao7`+4-Me}D+SB=?;Xbx{&8Kn7 zgZp*XZ$IRp@7JR6)L)G{?G~2?SfW3;00000NkvXXu0mjf7 Date: Fri, 12 Aug 2016 00:32:20 +0300 Subject: [PATCH 06/22] - Created a shortcut for the new help button, removed the old two shortcuts and created obsolete settings transfer. --- openlp/core/common/settings.py | 7 ++++--- openlp/core/ui/mainwindow.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 11aaeae83..35d2dfad7 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -214,7 +214,9 @@ class Settings(QtCore.QSettings): ('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 @@ -274,6 +276,7 @@ class Settings(QtCore.QSettings): '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)], @@ -334,8 +337,6 @@ class Settings(QtCore.QSettings): QtGui.QKeySequence(QtCore.Qt.Key_PageDown)], 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)], 'shortcuts/newService': [], - 'shortcuts/offlineHelpItem': [QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F1)], - 'shortcuts/onlineHelpItem': [QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F1)], 'shortcuts/openService': [], 'shortcuts/saveService': [], 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ef3c8d06d..5096ad431 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -312,7 +312,7 @@ class Ui_MainWindow(object): elif is_macosx(): self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir), '..', 'Resources', 'OpenLP.help') - self.on_help_item = create_action(main_window, 'onlineHelpItem', + 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) From 35758b306a90fca04ca4fb9c49977ecadbfcbbca Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 15 Aug 2016 00:01:48 +0300 Subject: [PATCH 07/22] - Restored the default Help shortcut. --- openlp/core/common/settings.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 35d2dfad7..1f727c290 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -215,8 +215,9 @@ class Settings(QtCore.QSettings): ('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. - ('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. + ('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 @@ -256,7 +257,7 @@ class Settings(QtCore.QSettings): 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.SHIFT + QtCore.Qt.Key_F1)], + 'shortcuts/aboutItem': [QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F1)], 'shortcuts/addToService': [], 'shortcuts/audioPauseItem': [], 'shortcuts/displayTagItem': [], @@ -276,7 +277,7 @@ class Settings(QtCore.QSettings): '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/HelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)], 'shortcuts/importThemeItem': [], 'shortcuts/importBibleItem': [], 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)], From 33aaf53c421900d861d6a89b9e39f54f498d153f Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 15 Aug 2016 00:14:35 +0300 Subject: [PATCH 08/22] - Pep8 (Over ident fixed) --- openlp/core/ui/mainwindow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 70bd7e440..b8bd126dd 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -313,9 +313,9 @@ class Ui_MainWindow(object): self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir), '..', 'Resources', 'OpenLP.help') 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) + 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, From 4f900dbffbf0f4ac9abd64eaf979aca9c09bb173 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 15 Aug 2016 19:37:53 +0300 Subject: [PATCH 09/22] - 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) --- openlp/core/ui/shortcutlistform.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index e23fa0a27..eb91313c9 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -426,12 +426,11 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert 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 self.dialog_was_shown = True return is_valid From 8224e39a2cf2f54c85d53ea257b7157ba55c2860 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sat, 20 Aug 2016 22:14:15 +0300 Subject: [PATCH 10/22] - Added test --- .../openlp_core_ui/test_mainwindow.py | 3 ++- .../openlp_plugins/bibles/test_mediaitem.py | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/functional/openlp_core_ui/test_mainwindow.py b/tests/functional/openlp_core_ui/test_mainwindow.py index 341e74eb8..09c423304 100644 --- a/tests/functional/openlp_core_ui/test_mainwindow.py +++ b/tests/functional/openlp_core_ui/test_mainwindow.py @@ -26,11 +26,12 @@ import os from unittest import TestCase -from PyQt5 import QtWidgets +from PyQt5 import QtWidgets, QtGui, QtCore from openlp.core.ui.mainwindow import MainWindow from openlp.core.lib.ui import UiStrings from openlp.core.common.registry import Registry +from openlp.core.common import is_win, is_macosx, is_linux from tests.functional import MagicMock, patch from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/bibles/test_mediaitem.py b/tests/functional/openlp_plugins/bibles/test_mediaitem.py index 05418f177..f4b356d2c 100644 --- a/tests/functional/openlp_plugins/bibles/test_mediaitem.py +++ b/tests/functional/openlp_plugins/bibles/test_mediaitem.py @@ -114,6 +114,27 @@ class TestMediaItem(TestCase, TestMixin): 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. From 4733aa2169c10c955dcdcda44019101aaa978b48 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sat, 20 Aug 2016 22:17:00 +0300 Subject: [PATCH 11/22] - Removed modifications to test_mainwindow. --- tests/functional/openlp_core_ui/test_mainwindow.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/functional/openlp_core_ui/test_mainwindow.py b/tests/functional/openlp_core_ui/test_mainwindow.py index 09c423304..341e74eb8 100644 --- a/tests/functional/openlp_core_ui/test_mainwindow.py +++ b/tests/functional/openlp_core_ui/test_mainwindow.py @@ -26,12 +26,11 @@ import os from unittest import TestCase -from PyQt5 import QtWidgets, QtGui, QtCore +from PyQt5 import QtWidgets from openlp.core.ui.mainwindow import MainWindow from openlp.core.lib.ui import UiStrings from openlp.core.common.registry import Registry -from openlp.core.common import is_win, is_macosx, is_linux from tests.functional import MagicMock, patch from tests.helpers.testmixin import TestMixin From 7fba73843b8ac7cb73ef2721356d07bd8d6a4e2c Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Thu, 25 Aug 2016 22:24:59 +0300 Subject: [PATCH 12/22] - Added the missing tag to expection form. (bug 1616441) --- openlp/core/ui/exceptionform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 2122acfaa..9e58ac8b2 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -208,7 +208,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): self.__button_state(False) self.description_word_count.setText( translate('OpenLP.ExceptionDialog', 'Please enter a more detailed description of the situation' - )) + '')) def on_attach_file_button_clicked(self): """ From 875481d2d958a931341f94fca4156f99cff0f144 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 2 Sep 2016 18:22:29 +0300 Subject: [PATCH 13/22] - A working only blank to desktop --- openlp/core/common/settings.py | 5 ++-- openlp/core/ui/slidecontroller.py | 44 ++++++++++++++++++------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 1f727c290..9bff77163 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -215,7 +215,6 @@ class Settings(QtCore.QSettings): ('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. - ('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. ] @@ -263,8 +262,8 @@ class Settings(QtCore.QSettings): '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_Escape), - QtGui.QKeySequence(QtCore.Qt.Key_D)], + 'shortcuts/showDesktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)], + 'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)], 'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)], 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)], 'shortcuts/editSong': [], diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index f56e8247e..75ff4e4fb 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -236,7 +236,7 @@ class SlideController(DisplayController, RegistryProperties): self.toolbar.add_toolbar_widget(self.hide_menu) # 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'), + text=translate('OpenLP.SlideController', 'Show or hide Desktop'), icon=':/slides/slide_desktop.png', checked=False, can_shortcuts=True, category=self.category, triggers=self.on_hide_display) @@ -250,10 +250,17 @@ class SlideController(DisplayController, RegistryProperties): icon=':/slides/slide_blank.png', checked=False, can_shortcuts=True, category=self.category, triggers=self.on_blank_display) + self.escape_item = create_action(self, 'escapeItem', + text=translate('OpenLP.SlideController', 'Escape Item'), + can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut, + category=self.category, + triggers=self.live_escape) + self.hide_menu.setDefaultAction(self.blank_screen) self.hide_menu.menu().addAction(self.blank_screen) self.hide_menu.menu().addAction(self.theme_screen) self.hide_menu.menu().addAction(self.desktop_screen) + self.hide_menu.menu().addAction(self.escape_item) # Wide menu of display control buttons. self.blank_screen_button = QtWidgets.QToolButton(self.toolbar) self.blank_screen_button.setObjectName('blank_screen_button') @@ -267,6 +274,13 @@ class SlideController(DisplayController, RegistryProperties): self.desktop_screen_button.setObjectName('desktop_screen_button') self.toolbar.add_toolbar_widget(self.desktop_screen_button) self.desktop_screen_button.setDefaultAction(self.desktop_screen) + + self.escape_item_button = QtWidgets.QToolButton(self.toolbar) + self.escape_item_button.setObjectName('escape_item_button') + self.toolbar.add_toolbar_widget(self.escape_item_button) + self.escape_item_button.setDefaultAction(self.escape_item) + + self.toolbar.add_toolbar_action('loop_separator', separator=True) # Play Slides Menu self.play_slides_menu = QtWidgets.QToolButton(self.toolbar) @@ -513,23 +527,6 @@ class SlideController(DisplayController, RegistryProperties): can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut, category=self.category, triggers=self.service_next) - self.escape_item = create_action(parent, 'escapeItem', - text=translate('OpenLP.SlideController', 'Escape Item'), - can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut, - category=self.category, - triggers=self.live_escape) - - def live_escape(self, field=None): - """ - If you press ESC on the live screen it should close the display temporarily. - """ - self.display.setVisible(False) - self.media_controller.media_stop(self) - # Stop looping if active - if self.play_slides_loop.isChecked(): - self.on_play_slides_loop(False) - elif self.play_slides_once.isChecked(): - self.on_play_slides_once(False) def toggle_display(self, action): """ @@ -1044,6 +1041,17 @@ class SlideController(DisplayController, RegistryProperties): self.update_preview() self.on_toggle_loop() + def live_escape(self, checked=None): + """ + If you press ESC on the live screen it should close the display temporarily. + """ + self.blank_screen.setChecked(False) + self.theme_screen.setChecked(False) + # Not sure if this line is required. + self.desktop_screen.setChecked(checked) + Registry().execute('live_display_hide', HideMode.Screen) + self.desktop_screen.setChecked(True) + def blank_plugin(self): """ Blank/Hide the display screen within a plugin if required. From 4f48cb5df2ebd14a71c89408a08ba4268f9f29e0 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 2 Sep 2016 18:34:39 +0300 Subject: [PATCH 14/22] - fixed the "blank only" button visibility --- openlp/core/ui/slidecontroller.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 75ff4e4fb..e59fdfffd 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -235,6 +235,11 @@ class SlideController(DisplayController, RegistryProperties): self.hide_menu.setMenu(QtWidgets.QMenu(translate('OpenLP.SlideController', 'Hide'), self.toolbar)) self.toolbar.add_toolbar_widget(self.hide_menu) # The order of the blank to modes in Shortcuts list comes from here. + self.escape_item = create_action(self, 'escapeItem', + text=translate('OpenLP.SlideController', 'Show Desktop'), + can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut, + category=self.category, + triggers=self.live_escape) self.desktop_screen = create_action(self, 'desktopScreen', text=translate('OpenLP.SlideController', 'Show or hide Desktop'), icon=':/slides/slide_desktop.png', @@ -250,12 +255,6 @@ class SlideController(DisplayController, RegistryProperties): icon=':/slides/slide_blank.png', checked=False, can_shortcuts=True, category=self.category, triggers=self.on_blank_display) - self.escape_item = create_action(self, 'escapeItem', - text=translate('OpenLP.SlideController', 'Escape Item'), - can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut, - category=self.category, - triggers=self.live_escape) - self.hide_menu.setDefaultAction(self.blank_screen) self.hide_menu.menu().addAction(self.blank_screen) self.hide_menu.menu().addAction(self.theme_screen) @@ -274,13 +273,6 @@ class SlideController(DisplayController, RegistryProperties): self.desktop_screen_button.setObjectName('desktop_screen_button') self.toolbar.add_toolbar_widget(self.desktop_screen_button) self.desktop_screen_button.setDefaultAction(self.desktop_screen) - - self.escape_item_button = QtWidgets.QToolButton(self.toolbar) - self.escape_item_button.setObjectName('escape_item_button') - self.toolbar.add_toolbar_widget(self.escape_item_button) - self.escape_item_button.setDefaultAction(self.escape_item) - - self.toolbar.add_toolbar_action('loop_separator', separator=True) # Play Slides Menu self.play_slides_menu = QtWidgets.QToolButton(self.toolbar) From 2c4dbda42fbeef8e43296b621a22bcc8e7257595 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 2 Sep 2016 18:41:16 +0300 Subject: [PATCH 15/22] - The new method now also stops loops. --- openlp/core/ui/slidecontroller.py | 8 +++++--- tests/functional/openlp_core_ui/test_slidecontroller.py | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e59fdfffd..e5260bd80 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -235,7 +235,7 @@ class SlideController(DisplayController, RegistryProperties): self.hide_menu.setMenu(QtWidgets.QMenu(translate('OpenLP.SlideController', 'Hide'), self.toolbar)) self.toolbar.add_toolbar_widget(self.hide_menu) # The order of the blank to modes in Shortcuts list comes from here. - self.escape_item = create_action(self, 'escapeItem', + self.desktop_screen_enable = create_action(self, 'escapeItem', text=translate('OpenLP.SlideController', 'Show Desktop'), can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut, category=self.category, @@ -259,7 +259,7 @@ class SlideController(DisplayController, RegistryProperties): self.hide_menu.menu().addAction(self.blank_screen) self.hide_menu.menu().addAction(self.theme_screen) self.hide_menu.menu().addAction(self.desktop_screen) - self.hide_menu.menu().addAction(self.escape_item) + self.hide_menu.menu().addAction(self.desktop_screen_enable) # Wide menu of display control buttons. self.blank_screen_button = QtWidgets.QToolButton(self.toolbar) self.blank_screen_button.setObjectName('blank_screen_button') @@ -612,7 +612,7 @@ class SlideController(DisplayController, RegistryProperties): widget.addActions([ self.previous_item, self.next_item, self.previous_service, self.next_service, - self.escape_item, + self.desktop_screen_enable, self.desktop_screen, self.theme_screen, self.blank_screen]) @@ -1043,6 +1043,8 @@ class SlideController(DisplayController, RegistryProperties): self.desktop_screen.setChecked(checked) Registry().execute('live_display_hide', HideMode.Screen) self.desktop_screen.setChecked(True) + self.update_preview() + self.on_toggle_loop() def blank_plugin(self): """ diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index ef1ce5793..7a171535b 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -697,7 +697,7 @@ class TestSlideController(TestCase): slide_controller.next_item = MagicMock() slide_controller.previous_service = MagicMock() slide_controller.next_service = MagicMock() - slide_controller.escape_item = MagicMock() + slide_controller.desktop_screen_enable = MagicMock() slide_controller.desktop_screen = MagicMock() slide_controller.blank_screen = MagicMock() slide_controller.theme_screen = MagicMock() @@ -709,7 +709,7 @@ class TestSlideController(TestCase): mocked_widget.addActions.assert_called_with([ slide_controller.previous_item, slide_controller.next_item, slide_controller.previous_service, slide_controller.next_service, - slide_controller.escape_item, slide_controller.desktop_screen, + slide_controller.desktop_screen_enable, slide_controller.desktop_screen, slide_controller.theme_screen, slide_controller.blank_screen ]) From 2fcd29296937ca6b44bf4ca28eba04d8c5e79857 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 2 Sep 2016 18:52:44 +0300 Subject: [PATCH 16/22] - Renamed some code --- openlp/core/ui/slidecontroller.py | 12 ++++++++---- .../openlp_core_ui/test_slidecontroller.py | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e5260bd80..b97fd3f2b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -239,7 +239,7 @@ class SlideController(DisplayController, RegistryProperties): text=translate('OpenLP.SlideController', 'Show Desktop'), can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut, category=self.category, - triggers=self.live_escape) + triggers=self.on_hide_display_enable) self.desktop_screen = create_action(self, 'desktopScreen', text=translate('OpenLP.SlideController', 'Show or hide Desktop'), icon=':/slides/slide_desktop.png', @@ -955,7 +955,7 @@ class SlideController(DisplayController, RegistryProperties): else: Registry().execute('live_display_show') else: - self.live_escape() + self.on_hide_display_enable() def on_slide_blank(self): """ @@ -1015,6 +1015,7 @@ class SlideController(DisplayController, RegistryProperties): def on_hide_display(self, checked=None): """ Handle the Hide screen button + This toggles the desktop screen. :param checked: the new state of the of the widget """ @@ -1033,9 +1034,12 @@ class SlideController(DisplayController, RegistryProperties): self.update_preview() self.on_toggle_loop() - def live_escape(self, checked=None): + def on_hide_display_enable(self, checked=None): """ - If you press ESC on the live screen it should close the display temporarily. + Handle the on_hide_display_enable + This only enables the desktop screen. + + :param checked: the new state of the of the widget """ self.blank_screen.setChecked(False) self.theme_screen.setChecked(False) diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 7a171535b..5346c4537 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -208,9 +208,9 @@ class TestSlideController(TestCase): mocked_on_theme_display.assert_called_once_with(False) mocked_on_hide_display.assert_called_once_with(False) - def test_live_escape(self): + def test_on_hide_display_enable(self): """ - Test that when the live_escape() method is called, the display is set to invisible and any media is stopped + Test that when the on_hide_display_enable() method is called, the display is set to invisible and any media is stopped """ # GIVEN: A new SlideController instance and mocked out display and media_controller mocked_display = MagicMock() @@ -224,8 +224,8 @@ class TestSlideController(TestCase): slide_controller.play_slides_loop = play_slides slide_controller.play_slides_once = play_slides - # WHEN: live_escape() is called - slide_controller.live_escape() + # WHEN: on_hide_display_enable() is called + slide_controller.on_hide_display_enable() # THEN: the display should be set to invisible and the media controller stopped mocked_display.setVisible.assert_called_once_with(False) From e4e46d40f57b41d2d66d084e0c5a8b6ad6de3e20 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 2 Sep 2016 19:19:28 +0300 Subject: [PATCH 17/22] - Setting migration for escape item - Renamed shortcut descriptions for blanks --- openlp/core/common/settings.py | 4 ++-- openlp/core/ui/slidecontroller.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 9bff77163..7695e2a7f 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -215,6 +215,7 @@ class Settings(QtCore.QSettings): ('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. + ('shortcuts/escapeItem', 'shortcuts/desktopScreenEnable', []), # Escape item was removed in 2.6. ('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. ] @@ -262,12 +263,11 @@ class Settings(QtCore.QSettings): 'shortcuts/displayTagItem': [], 'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)], 'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)], - 'shortcuts/showDesktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)], 'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)], + 'shortcuts/desktopScreenEnable': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)], 'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)], 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)], 'shortcuts/editSong': [], - 'shortcuts/escapeItem': [], 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)], 'shortcuts/exportThemeItem': [], 'shortcuts/fileNewItem': [QtGui.QKeySequence(QtGui.QKeySequence.New)], diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index b97fd3f2b..51794cdd3 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -235,23 +235,23 @@ class SlideController(DisplayController, RegistryProperties): self.hide_menu.setMenu(QtWidgets.QMenu(translate('OpenLP.SlideController', 'Hide'), self.toolbar)) self.toolbar.add_toolbar_widget(self.hide_menu) # The order of the blank to modes in Shortcuts list comes from here. - self.desktop_screen_enable = create_action(self, 'escapeItem', - text=translate('OpenLP.SlideController', 'Show Desktop'), - can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut, - category=self.category, - triggers=self.on_hide_display_enable) + self.desktop_screen_enable = create_action(self, 'desktopScreenEnable', + text=translate('OpenLP.SlideController', 'Show Desktop'), + icon=':/slides/slide_desktop.png', can_shortcuts=True, + context=QtCore.Qt.WidgetWithChildrenShortcut, + category=self.category, triggers=self.on_hide_display_enable) self.desktop_screen = create_action(self, 'desktopScreen', - text=translate('OpenLP.SlideController', 'Show or hide Desktop'), + text=translate('OpenLP.SlideController', 'Toggle 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'), + text=translate('OpenLP.SlideController', 'Toggle 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'), + text=translate('OpenLP.SlideController', 'Toggle Blank Screen'), icon=':/slides/slide_blank.png', checked=False, can_shortcuts=True, category=self.category, triggers=self.on_blank_display) From 4a57caf084b7a3a150b2e71285777c4ffd7d3e96 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 2 Sep 2016 19:24:57 +0300 Subject: [PATCH 18/22] - Removed the old "escape item" test. --- .../openlp_core_ui/test_slidecontroller.py | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 5346c4537..b93952097 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -208,29 +208,6 @@ class TestSlideController(TestCase): mocked_on_theme_display.assert_called_once_with(False) mocked_on_hide_display.assert_called_once_with(False) - def test_on_hide_display_enable(self): - """ - Test that when the on_hide_display_enable() method is called, the display is set to invisible and any media is stopped - """ - # GIVEN: A new SlideController instance and mocked out display and media_controller - mocked_display = MagicMock() - mocked_media_controller = MagicMock() - Registry.create() - Registry().register('media_controller', mocked_media_controller) - slide_controller = SlideController(None) - slide_controller.display = mocked_display - play_slides = MagicMock() - play_slides.isChecked.return_value = False - slide_controller.play_slides_loop = play_slides - slide_controller.play_slides_once = play_slides - - # WHEN: on_hide_display_enable() is called - slide_controller.on_hide_display_enable() - - # THEN: the display should be set to invisible and the media controller stopped - mocked_display.setVisible.assert_called_once_with(False) - mocked_media_controller.media_stop.assert_called_once_with(slide_controller) - def test_on_go_live_live_controller(self): """ Test that when the on_go_live() method is called the message is sent to the live controller and focus is From aecd6b885873beadab1c6fc44f5008c4db4b3d82 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Fri, 2 Sep 2016 19:54:00 +0300 Subject: [PATCH 19/22] Fixed 1 strong tag --- openlp/core/ui/exceptiondialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 7341287c7..819e3faaa 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -107,7 +107,7 @@ class Ui_ExceptionDialog(object): 'No email app? You can save this ' 'information to a file and
' 'send it from your mail on browser via an attachment.

' - 'Thank you for being part of making OpenLP better!
' + 'Thank you for being part of making OpenLP better!
' ).format(first_part=exception_part1)) self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail')) self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File')) From 7ea310585701cb64c183ab89a3f27454b4c3c0cd Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 12 Sep 2016 14:41:38 +0300 Subject: [PATCH 20/22] - Fixed some .forma tags to .format --- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/songs/forms/editsongform.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index e9e26111f..2b999da19 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -350,7 +350,7 @@ class CustomMediaItem(MediaManagerItem): :param string: The search string :param show_error: The error string to be show. """ - search = '%{search}%'.forma(search=string.lower()) + search = '%{search}%'.format(search=string.lower()) search_results = self.plugin.db_manager.get_all_objects(CustomSlide, or_(func.lower(CustomSlide.title).like(search), func.lower(CustomSlide.text).like(search)), diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 200e1436f..a17c9fb5f 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -317,7 +317,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties): self.song.verse_order = re.sub('([' + verse.upper() + verse.lower() + '])(\W|$)', r'\g<1>1\2', self.song.verse_order) except: - log.exception('Problem processing song Lyrics \n{xml}'.forma(xml=sxml.dump_xml())) + log.exception('Problem processing song Lyrics \n{xml}'.format(xml=sxml.dump_xml())) raise def keyPressEvent(self, event): From 1fae73014ec71982e88df324c2f04badf62c2b42 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 12 Sep 2016 15:11:59 +0300 Subject: [PATCH 21/22] - Removed one unrequired code line --- openlp/core/ui/slidecontroller.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 51794cdd3..13a09d5df 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1043,8 +1043,6 @@ class SlideController(DisplayController, RegistryProperties): """ self.blank_screen.setChecked(False) self.theme_screen.setChecked(False) - # Not sure if this line is required. - self.desktop_screen.setChecked(checked) Registry().execute('live_display_hide', HideMode.Screen) self.desktop_screen.setChecked(True) self.update_preview() From 97d828af4373d5ba80fb09a0754772f426698b33 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Tue, 4 Oct 2016 16:48:54 +0300 Subject: [PATCH 22/22] - Added pip's fix for sword test --- tests/functional/openlp_plugins/bibles/test_swordimport.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/functional/openlp_plugins/bibles/test_swordimport.py b/tests/functional/openlp_plugins/bibles/test_swordimport.py index 261df1c0e..14480bdd1 100644 --- a/tests/functional/openlp_plugins/bibles/test_swordimport.py +++ b/tests/functional/openlp_plugins/bibles/test_swordimport.py @@ -70,8 +70,7 @@ class TestSwordImport(TestCase): @patch('openlp.plugins.bibles.lib.importers.sword.SwordBible.application') @patch('openlp.plugins.bibles.lib.importers.sword.modules') - @patch('openlp.core.common.languages') - def test_simple_import(self, mocked_languages, mocked_pysword_modules, mocked_application): + def test_simple_import(self, mocked_pysword_modules, mocked_application): """ Test that a simple SWORD import works """ @@ -88,7 +87,7 @@ class TestSwordImport(TestCase): importer.create_verse = MagicMock() importer.create_book = MagicMock() importer.session = MagicMock() - mocked_languages.get_language.return_value = 'Danish' + importer.get_language = MagicMock(return_value='Danish') mocked_bible = MagicMock() mocked_genesis = MagicMock() mocked_genesis.name = 'Genesis'