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

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

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

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

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

See the comment for the right place.

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

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

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

Revision history for this message
Tim Bentley (trb143) wrote :

See below and tests would be nice.

review: Needs Fixing
2700. By Azaziah

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

2701. By Azaziah

- Added test

2702. By Azaziah

- Removed modifications to test_mainwindow.

2703. By Azaziah

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

2704. By Azaziah

- Merged trunk

2705. By Azaziah

- A working only blank to desktop

2706. By Azaziah

- fixed the "blank only" button visibility

2707. By Azaziah

- The new method now also stops loops.

2708. By Azaziah

- Renamed some code

2709. By Azaziah

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

2710. By Azaziah

- Removed the old "escape item" test.

2711. By Azaziah

Fixed 1 strong tag

2712. By Azaziah

- Fixed some .forma tags to .format

2713. By Azaziah

- Removed one unrequired code line

2714. By Azaziah

- Merged trunk on 4.10.16

2715. By Azaziah

- Added pip's fix for sword test

2716. By Azaziah

- Merged trunk and fixed conflict.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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-20 19:19:48 +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/mainwindow.py'
50--- openlp/core/ui/mainwindow.py 2016-08-11 22:12:50 +0000
51+++ openlp/core/ui/mainwindow.py 2016-08-20 19:19:48 +0000
52@@ -309,21 +309,13 @@
53 self.about_item.setMenuRole(QtWidgets.QAction.AboutRole)
54 if is_win():
55 self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm')
56- self.offline_help_item = create_action(main_window, 'offlineHelpItem',
57- icon=':/system/system_help_contents.png',
58- can_shortcuts=True,
59- category=UiStrings().Help, triggers=self.on_offline_help_clicked)
60 elif is_macosx():
61 self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir),
62 '..', 'Resources', 'OpenLP.help')
63- self.offline_help_item = create_action(main_window, 'offlineHelpItem',
64- icon=':/system/system_help_contents.png',
65- can_shortcuts=True,
66- category=UiStrings().Help, triggers=self.on_offline_help_clicked)
67- self.on_line_help_item = create_action(main_window, 'onlineHelpItem',
68- icon=':/system/system_online_help.png',
69- can_shortcuts=True,
70- category=UiStrings().Help, triggers=self.on_online_help_clicked)
71+ self.on_help_item = create_action(main_window, 'HelpItem',
72+ icon=':/system/system_help_contents.png',
73+ can_shortcuts=True,
74+ category=UiStrings().Help, triggers=self.on_help_clicked)
75 self.web_site_item = create_action(main_window, 'webSiteItem', can_shortcuts=True, category=UiStrings().Help)
76 # Shortcuts not connected to buttons or menu entries.
77 self.search_shortcut_action = create_action(main_window,
78@@ -362,11 +354,7 @@
79 add_actions(self.tools_menu, (self.tools_open_data_folder, None))
80 add_actions(self.tools_menu, (self.tools_first_time_wizard, None))
81 add_actions(self.tools_menu, [self.update_theme_images])
82- if (is_win() or is_macosx()) and (hasattr(sys, 'frozen') and sys.frozen == 1):
83- add_actions(self.help_menu, (self.offline_help_item, self.on_line_help_item, None, self.web_site_item,
84- self.about_item))
85- else:
86- add_actions(self.help_menu, (self.on_line_help_item, None, self.web_site_item, self.about_item))
87+ add_actions(self.help_menu, (self.on_help_item, None, self.web_site_item, self.about_item))
88 add_actions(self.menu_bar, (self.file_menu.menuAction(), self.view_menu.menuAction(),
89 self.tools_menu.menuAction(), self.settings_menu.menuAction(), self.help_menu.menuAction()))
90 add_actions(self, [self.search_shortcut_action])
91@@ -462,9 +450,7 @@
92 'from here.'))
93 self.about_item.setText(translate('OpenLP.MainWindow', '&About'))
94 self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP.'))
95- if is_win() or is_macosx():
96- self.offline_help_item.setText(translate('OpenLP.MainWindow', '&User Guide'))
97- self.on_line_help_item.setText(translate('OpenLP.MainWindow', '&Online Help'))
98+ self.on_help_item.setText(translate('OpenLP.MainWindow', '&User Manual'))
99 self.search_shortcut_action.setText(UiStrings().Search)
100 self.search_shortcut_action.setToolTip(
101 translate('OpenLP.MainWindow', 'Jump to the search box of the current active plugin.'))
102@@ -778,18 +764,16 @@
103 import webbrowser
104 webbrowser.open_new('http://openlp.org/')
105
106- def on_offline_help_clicked(self):
107- """
108- Load the local OpenLP help file
109- """
110- QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))
111-
112- def on_online_help_clicked(self):
113- """
114- Load the online OpenLP manual
115- """
116- import webbrowser
117- webbrowser.open_new('http://manual.openlp.org/')
118+ def on_help_clicked(self):
119+ """
120+ If is_macosx or is_win, open the local OpenLP help file.
121+ Use the Online manual in other cases. (Linux)
122+ """
123+ if is_macosx() or is_win():
124+ QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))
125+ else:
126+ import webbrowser
127+ webbrowser.open_new('http://manual.openlp.org/')
128
129 def on_about_item_clicked(self):
130 """
131
132=== modified file 'openlp/core/ui/shortcutlistform.py'
133--- openlp/core/ui/shortcutlistform.py 2016-05-20 16:22:06 +0000
134+++ openlp/core/ui/shortcutlistform.py 2016-08-20 19:19:48 +0000
135@@ -426,11 +426,11 @@
136 is_valid = False
137 if not is_valid:
138 text = translate('OpenLP.ShortcutListDialog',
139- 'The shortcut "{key}" is already assigned to another action, please'
140- ' use a different shortcut.'
141+ 'The shortcut "{key}" is already assigned to another action,\n'
142+ 'please use a different shortcut.'
143 ).format(key=self.get_shortcut_string(key_sequence))
144 self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
145- text, for_display=True)
146+ text)
147 self.dialog_was_shown = True
148 return is_valid
149
150
151=== modified file 'openlp/core/ui/slidecontroller.py'
152--- openlp/core/ui/slidecontroller.py 2016-08-10 18:50:40 +0000
153+++ openlp/core/ui/slidecontroller.py 2016-08-20 19:19:48 +0000
154@@ -234,21 +234,22 @@
155 self.hide_menu.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup)
156 self.hide_menu.setMenu(QtWidgets.QMenu(translate('OpenLP.SlideController', 'Hide'), self.toolbar))
157 self.toolbar.add_toolbar_widget(self.hide_menu)
158- self.blank_screen = create_action(self, 'blankScreen',
159- text=translate('OpenLP.SlideController', 'Blank Screen'),
160- icon=':/slides/slide_blank.png',
161- checked=False, can_shortcuts=True, category=self.category,
162- triggers=self.on_blank_display)
163- self.theme_screen = create_action(self, 'themeScreen',
164- text=translate('OpenLP.SlideController', 'Blank to Theme'),
165- icon=':/slides/slide_theme.png',
166- checked=False, can_shortcuts=True, category=self.category,
167- triggers=self.on_theme_display)
168+ # The order of the blank to modes in Shortcuts list comes from here.
169 self.desktop_screen = create_action(self, 'desktopScreen',
170 text=translate('OpenLP.SlideController', 'Show Desktop'),
171 icon=':/slides/slide_desktop.png',
172 checked=False, can_shortcuts=True, category=self.category,
173 triggers=self.on_hide_display)
174+ self.theme_screen = create_action(self, 'themeScreen',
175+ text=translate('OpenLP.SlideController', 'Blank to Theme'),
176+ icon=':/slides/slide_theme.png',
177+ checked=False, can_shortcuts=True, category=self.category,
178+ triggers=self.on_theme_display)
179+ self.blank_screen = create_action(self, 'blankScreen',
180+ text=translate('OpenLP.SlideController', 'Blank Screen'),
181+ icon=':/slides/slide_blank.png',
182+ checked=False, can_shortcuts=True, category=self.category,
183+ triggers=self.on_blank_display)
184 self.hide_menu.setDefaultAction(self.blank_screen)
185 self.hide_menu.menu().addAction(self.blank_screen)
186 self.hide_menu.menu().addAction(self.theme_screen)
187
188=== modified file 'resources/images/openlp-2.qrc'
189--- resources/images/openlp-2.qrc 2016-06-14 21:49:29 +0000
190+++ resources/images/openlp-2.qrc 2016-08-20 19:19:48 +0000
191@@ -130,7 +130,6 @@
192 <file>clear_shortcut.png</file>
193 <file>system_about.png</file>
194 <file>system_help_contents.png</file>
195- <file>system_online_help.png</file>
196 <file>system_mediamanager.png</file>
197 <file>system_volunteer.png</file>
198 <file>system_servicemanager.png</file>
199
200=== removed file 'resources/images/system_online_help.png'
201Binary 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
202=== modified file 'tests/functional/openlp_plugins/bibles/test_mediaitem.py'
203--- tests/functional/openlp_plugins/bibles/test_mediaitem.py 2016-06-14 21:55:37 +0000
204+++ tests/functional/openlp_plugins/bibles/test_mediaitem.py 2016-08-20 19:19:48 +0000
205@@ -114,6 +114,27 @@
206 self.assertEqual(self.media_item.search_results, {})
207 self.assertEqual(self.media_item.second_search_results, {})
208
209+ def test_required_icons(self):
210+ """
211+ Test that all the required icons are set properly.
212+ """
213+ # GIVEN: Mocked icons that need to be called.
214+ self.media_item.has_import_icon = MagicMock()
215+ self.media_item.has_new_icon = MagicMock()
216+ self.media_item.has_edit_icon = MagicMock()
217+ self.media_item.has_delete_icon = MagicMock()
218+ self.media_item.add_to_service_item = MagicMock()
219+
220+ # WHEN: self.media_item.required_icons is called
221+ self.media_item.required_icons()
222+
223+ # THEN: On windows it should return True, on other platforms False
224+ self.assertTrue(self.media_item.has_import_icon, 'Check that the icon is as True.')
225+ self.assertFalse(self.media_item.has_new_icon, 'Check that the icon is called as False.')
226+ self.assertTrue(self.media_item.has_edit_icon, 'Check that the icon is called as True.')
227+ self.assertTrue(self.media_item.has_delete_icon, 'Check that the icon is called as True.')
228+ self.assertFalse(self.media_item.add_to_service_item, 'Check that the icon is called as False')
229+
230 def on_quick_search_button_general_test(self):
231 """
232 Test that general things, which should be called on all Quick searches are called.