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: 245 lines (+60/-52)
7 files modified
openlp/core/common/settings.py (+8/-5)
openlp/core/ui/exceptionform.py (+1/-1)
openlp/core/ui/mainwindow.py (+16/-32)
openlp/core/ui/shortcutlistform.py (+3/-3)
openlp/core/ui/slidecontroller.py (+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 Pending
Review via email: mp+303486@code.launchpad.net

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

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

Description of the change

- 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

--------------------------------
lp:~suutari-olli/openlp/change-blank-to-desktop-hotkey-to-esc (revision 2702)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1755/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1666/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1604/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1360/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/950/
[SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1018/
[SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/886/
[SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/52/

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

See the comment for the right place.

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

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

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

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

See below and tests would be nice.

review: Needs Fixing
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
1=== modified file 'openlp/core/common/settings.py'
2--- openlp/core/common/settings.py 2016-07-31 11:58:54 +0000
3+++ openlp/core/common/settings.py 2016-08-25 19:28:32 +0000
4@@ -214,7 +214,10 @@
5 ('media/players', 'media/players_temp', [(media_players_conv, None)]), # Convert phonon to system
6 ('media/players_temp', 'media/players', []), # Move temp setting from above to correct setting
7 ('advanced/default color', 'core/logo background color', []), # Default image renamed + moved to general > 2.4.
8- ('advanced/default image', '/core/logo file', []) # Default image renamed + moved to general after 2.4.
9+ ('advanced/default image', 'core/logo file', []), # Default image renamed + moved to general after 2.4.
10+ ('shortcuts/escapeItem', 'shortcuts/desktopScreen', []), # Default image renamed + moved to general after 2.4.
11+ ('shortcuts/offlineHelpItem', 'shortcuts/HelpItem', []), # Online and Offline help were combined in 2.6.
12+ ('shortcuts/onlineHelpItem', 'shortcuts/HelpItem', []) # Online and Offline help were combined in 2.6.
13 ]
14
15 @staticmethod
16@@ -260,11 +263,12 @@
17 'shortcuts/displayTagItem': [],
18 'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)],
19 'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)],
20- 'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)],
21+ 'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Escape),
22+ QtGui.QKeySequence(QtCore.Qt.Key_D)],
23 'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],
24 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)],
25 'shortcuts/editSong': [],
26- 'shortcuts/escapeItem': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)],
27+ 'shortcuts/escapeItem': [],
28 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)],
29 'shortcuts/exportThemeItem': [],
30 'shortcuts/fileNewItem': [QtGui.QKeySequence(QtGui.QKeySequence.New)],
31@@ -273,6 +277,7 @@
32 'shortcuts/fileSaveItem': [QtGui.QKeySequence(QtGui.QKeySequence.Save)],
33 'shortcuts/fileOpenItem': [QtGui.QKeySequence(QtGui.QKeySequence.Open)],
34 'shortcuts/goLive': [],
35+ 'shortcuts/HelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
36 'shortcuts/importThemeItem': [],
37 'shortcuts/importBibleItem': [],
38 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete)],
39@@ -333,8 +338,6 @@
40 QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
41 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
42 'shortcuts/newService': [],
43- 'shortcuts/offlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
44- 'shortcuts/onlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
45 'shortcuts/openService': [],
46 'shortcuts/saveService': [],
47 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up),
48
49=== modified file 'openlp/core/ui/exceptionform.py'
50--- openlp/core/ui/exceptionform.py 2016-08-11 22:12:50 +0000
51+++ openlp/core/ui/exceptionform.py 2016-08-25 19:28:32 +0000
52@@ -208,7 +208,7 @@
53 self.__button_state(False)
54 self.description_word_count.setText(
55 translate('OpenLP.ExceptionDialog', '<strong>Please enter a more detailed description of the situation'
56- ))
57+ '</strong>'))
58
59 def on_attach_file_button_clicked(self):
60 """
61
62=== modified file 'openlp/core/ui/mainwindow.py'
63--- openlp/core/ui/mainwindow.py 2016-08-11 22:12:50 +0000
64+++ openlp/core/ui/mainwindow.py 2016-08-25 19:28:32 +0000
65@@ -309,21 +309,13 @@
66 self.about_item.setMenuRole(QtWidgets.QAction.AboutRole)
67 if is_win():
68 self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm')
69- self.offline_help_item = create_action(main_window, 'offlineHelpItem',
70- icon=':/system/system_help_contents.png',
71- can_shortcuts=True,
72- category=UiStrings().Help, triggers=self.on_offline_help_clicked)
73 elif is_macosx():
74 self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir),
75 '..', 'Resources', 'OpenLP.help')
76- self.offline_help_item = create_action(main_window, 'offlineHelpItem',
77- icon=':/system/system_help_contents.png',
78- can_shortcuts=True,
79- category=UiStrings().Help, triggers=self.on_offline_help_clicked)
80- self.on_line_help_item = create_action(main_window, 'onlineHelpItem',
81- icon=':/system/system_online_help.png',
82- can_shortcuts=True,
83- category=UiStrings().Help, triggers=self.on_online_help_clicked)
84+ self.on_help_item = create_action(main_window, 'HelpItem',
85+ icon=':/system/system_help_contents.png',
86+ can_shortcuts=True,
87+ category=UiStrings().Help, triggers=self.on_help_clicked)
88 self.web_site_item = create_action(main_window, 'webSiteItem', can_shortcuts=True, category=UiStrings().Help)
89 # Shortcuts not connected to buttons or menu entries.
90 self.search_shortcut_action = create_action(main_window,
91@@ -362,11 +354,7 @@
92 add_actions(self.tools_menu, (self.tools_open_data_folder, None))
93 add_actions(self.tools_menu, (self.tools_first_time_wizard, None))
94 add_actions(self.tools_menu, [self.update_theme_images])
95- if (is_win() or is_macosx()) and (hasattr(sys, 'frozen') and sys.frozen == 1):
96- add_actions(self.help_menu, (self.offline_help_item, self.on_line_help_item, None, self.web_site_item,
97- self.about_item))
98- else:
99- add_actions(self.help_menu, (self.on_line_help_item, None, self.web_site_item, self.about_item))
100+ add_actions(self.help_menu, (self.on_help_item, None, self.web_site_item, self.about_item))
101 add_actions(self.menu_bar, (self.file_menu.menuAction(), self.view_menu.menuAction(),
102 self.tools_menu.menuAction(), self.settings_menu.menuAction(), self.help_menu.menuAction()))
103 add_actions(self, [self.search_shortcut_action])
104@@ -462,9 +450,7 @@
105 'from here.'))
106 self.about_item.setText(translate('OpenLP.MainWindow', '&About'))
107 self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP.'))
108- if is_win() or is_macosx():
109- self.offline_help_item.setText(translate('OpenLP.MainWindow', '&User Guide'))
110- self.on_line_help_item.setText(translate('OpenLP.MainWindow', '&Online Help'))
111+ self.on_help_item.setText(translate('OpenLP.MainWindow', '&User Manual'))
112 self.search_shortcut_action.setText(UiStrings().Search)
113 self.search_shortcut_action.setToolTip(
114 translate('OpenLP.MainWindow', 'Jump to the search box of the current active plugin.'))
115@@ -778,18 +764,16 @@
116 import webbrowser
117 webbrowser.open_new('http://openlp.org/')
118
119- def on_offline_help_clicked(self):
120- """
121- Load the local OpenLP help file
122- """
123- QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))
124-
125- def on_online_help_clicked(self):
126- """
127- Load the online OpenLP manual
128- """
129- import webbrowser
130- webbrowser.open_new('http://manual.openlp.org/')
131+ def on_help_clicked(self):
132+ """
133+ If is_macosx or is_win, open the local OpenLP help file.
134+ Use the Online manual in other cases. (Linux)
135+ """
136+ if is_macosx() or is_win():
137+ QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))
138+ else:
139+ import webbrowser
140+ webbrowser.open_new('http://manual.openlp.org/')
141
142 def on_about_item_clicked(self):
143 """
144
145=== modified file 'openlp/core/ui/shortcutlistform.py'
146--- openlp/core/ui/shortcutlistform.py 2016-05-20 16:22:06 +0000
147+++ openlp/core/ui/shortcutlistform.py 2016-08-25 19:28:32 +0000
148@@ -426,11 +426,11 @@
149 is_valid = False
150 if not is_valid:
151 text = translate('OpenLP.ShortcutListDialog',
152- 'The shortcut "{key}" is already assigned to another action, please'
153- ' use a different shortcut.'
154+ 'The shortcut "{key}" is already assigned to another action,\n'
155+ 'please use a different shortcut.'
156 ).format(key=self.get_shortcut_string(key_sequence))
157 self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
158- text, for_display=True)
159+ text)
160 self.dialog_was_shown = True
161 return is_valid
162
163
164=== modified file 'openlp/core/ui/slidecontroller.py'
165--- openlp/core/ui/slidecontroller.py 2016-08-10 18:50:40 +0000
166+++ openlp/core/ui/slidecontroller.py 2016-08-25 19:28:32 +0000
167@@ -234,21 +234,22 @@
168 self.hide_menu.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup)
169 self.hide_menu.setMenu(QtWidgets.QMenu(translate('OpenLP.SlideController', 'Hide'), self.toolbar))
170 self.toolbar.add_toolbar_widget(self.hide_menu)
171- self.blank_screen = create_action(self, 'blankScreen',
172- text=translate('OpenLP.SlideController', 'Blank Screen'),
173- icon=':/slides/slide_blank.png',
174- checked=False, can_shortcuts=True, category=self.category,
175- triggers=self.on_blank_display)
176- self.theme_screen = create_action(self, 'themeScreen',
177- text=translate('OpenLP.SlideController', 'Blank to Theme'),
178- icon=':/slides/slide_theme.png',
179- checked=False, can_shortcuts=True, category=self.category,
180- triggers=self.on_theme_display)
181+ # The order of the blank to modes in Shortcuts list comes from here.
182 self.desktop_screen = create_action(self, 'desktopScreen',
183 text=translate('OpenLP.SlideController', 'Show Desktop'),
184 icon=':/slides/slide_desktop.png',
185 checked=False, can_shortcuts=True, category=self.category,
186 triggers=self.on_hide_display)
187+ self.theme_screen = create_action(self, 'themeScreen',
188+ text=translate('OpenLP.SlideController', 'Blank to Theme'),
189+ icon=':/slides/slide_theme.png',
190+ checked=False, can_shortcuts=True, category=self.category,
191+ triggers=self.on_theme_display)
192+ self.blank_screen = create_action(self, 'blankScreen',
193+ text=translate('OpenLP.SlideController', 'Blank Screen'),
194+ icon=':/slides/slide_blank.png',
195+ checked=False, can_shortcuts=True, category=self.category,
196+ triggers=self.on_blank_display)
197 self.hide_menu.setDefaultAction(self.blank_screen)
198 self.hide_menu.menu().addAction(self.blank_screen)
199 self.hide_menu.menu().addAction(self.theme_screen)
200
201=== modified file 'resources/images/openlp-2.qrc'
202--- resources/images/openlp-2.qrc 2016-06-14 21:49:29 +0000
203+++ resources/images/openlp-2.qrc 2016-08-25 19:28:32 +0000
204@@ -130,7 +130,6 @@
205 <file>clear_shortcut.png</file>
206 <file>system_about.png</file>
207 <file>system_help_contents.png</file>
208- <file>system_online_help.png</file>
209 <file>system_mediamanager.png</file>
210 <file>system_volunteer.png</file>
211 <file>system_servicemanager.png</file>
212
213=== removed file 'resources/images/system_online_help.png'
214Binary 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
215=== modified file 'tests/functional/openlp_plugins/bibles/test_mediaitem.py'
216--- tests/functional/openlp_plugins/bibles/test_mediaitem.py 2016-06-14 21:55:37 +0000
217+++ tests/functional/openlp_plugins/bibles/test_mediaitem.py 2016-08-25 19:28:32 +0000
218@@ -114,6 +114,27 @@
219 self.assertEqual(self.media_item.search_results, {})
220 self.assertEqual(self.media_item.second_search_results, {})
221
222+ def test_required_icons(self):
223+ """
224+ Test that all the required icons are set properly.
225+ """
226+ # GIVEN: Mocked icons that need to be called.
227+ self.media_item.has_import_icon = MagicMock()
228+ self.media_item.has_new_icon = MagicMock()
229+ self.media_item.has_edit_icon = MagicMock()
230+ self.media_item.has_delete_icon = MagicMock()
231+ self.media_item.add_to_service_item = MagicMock()
232+
233+ # WHEN: self.media_item.required_icons is called
234+ self.media_item.required_icons()
235+
236+ # THEN: On windows it should return True, on other platforms False
237+ self.assertTrue(self.media_item.has_import_icon, 'Check that the icon is as True.')
238+ self.assertFalse(self.media_item.has_new_icon, 'Check that the icon is called as False.')
239+ self.assertTrue(self.media_item.has_edit_icon, 'Check that the icon is called as True.')
240+ self.assertTrue(self.media_item.has_delete_icon, 'Check that the icon is called as True.')
241+ self.assertFalse(self.media_item.add_to_service_item, 'Check that the icon is called as False')
242+
243 def on_quick_search_button_general_test(self):
244 """
245 Test that general things, which should be called on all Quick searches are called.