Merge lp:~raoul-snyman/openlp/remove_stylesheet into lp:openlp

Proposed by Raoul Snyman
Status: Merged
Approved by: Tim Bentley
Approved revision: 2597
Merged at revision: 2597
Proposed branch: lp:~raoul-snyman/openlp/remove_stylesheet
Merge into: lp:openlp
Diff against target: 73 lines (+47/-1)
2 files modified
openlp/core/ui/mainwindow.py (+2/-1)
tests/functional/openlp_core_ui/test_mainwindow.py (+45/-0)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/remove_stylesheet
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+282103@code.launchpad.net

Description of the change

Remove the media manager stylesheet for now.

Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/remove_stylesheet (revision 2597)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1228/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1153/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1092/
[FAILURE] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/930/
Stopping after failure

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/ui/mainwindow.py'
2--- openlp/core/ui/mainwindow.py 2015-12-31 22:46:06 +0000
3+++ openlp/core/ui/mainwindow.py 2016-01-09 19:15:08 +0000
4@@ -153,7 +153,8 @@
5 # Create the MediaManager
6 self.media_manager_dock = OpenLPDockWidget(main_window, 'media_manager_dock',
7 ':/system/system_mediamanager.png')
8- self.media_manager_dock.setStyleSheet(MEDIA_MANAGER_STYLE)
9+ # TODO: Figure out how to fix the stylesheet and add it back in
10+ # self.media_manager_dock.setStyleSheet(MEDIA_MANAGER_STYLE)
11 # Create the media toolbox
12 self.media_tool_box = QtWidgets.QToolBox(self.media_manager_dock)
13 self.media_tool_box.setObjectName('media_tool_box')
14
15=== modified file 'tests/functional/openlp_core_ui/test_mainwindow.py'
16--- tests/functional/openlp_core_ui/test_mainwindow.py 2015-12-31 22:46:06 +0000
17+++ tests/functional/openlp_core_ui/test_mainwindow.py 2016-01-09 19:15:08 +0000
18@@ -56,6 +56,15 @@
19 patch('openlp.core.ui.mainwindow.QtWidgets.QMainWindow.addDockWidget') as mocked_add_dock_method, \
20 patch('openlp.core.ui.mainwindow.ThemeManager') as mocked_theme_manager, \
21 patch('openlp.core.ui.mainwindow.Renderer') as mocked_renderer:
22+ self.mocked_settings_form = mocked_settings_form
23+ self.mocked_image_manager = mocked_image_manager
24+ self.mocked_live_controller = mocked_live_controller
25+ self.mocked_preview_controller = mocked_preview_controller
26+ self.mocked_dock_widget = mocked_dock_widget
27+ self.mocked_q_tool_box_class = mocked_q_tool_box_class
28+ self.mocked_add_dock_method = mocked_add_dock_method
29+ self.mocked_theme_manager = mocked_theme_manager
30+ self.mocked_renderer = mocked_renderer
31 self.main_window = MainWindow()
32
33 def tearDown(self):
34@@ -146,3 +155,39 @@
35 'registered.')
36 self.assertTrue('plugin_manager' in self.registry.service_list,
37 'The plugin_manager should have been registered.')
38+
39+ def on_search_shortcut_triggered_shows_media_manager_test(self):
40+ """
41+ Test that the media manager is made visible when the search shortcut is triggered
42+ """
43+ # GIVEN: A build main window set up for testing
44+ with patch.object(self.main_window, 'media_manager_dock') as mocked_media_manager_dock, \
45+ patch.object(self.main_window, 'media_tool_box') as mocked_media_tool_box:
46+ mocked_media_manager_dock.isVisible.return_value = False
47+ mocked_media_tool_box.currentWidget.return_value = None
48+
49+ # WHEN: The search shortcut is triggered
50+ self.main_window.on_search_shortcut_triggered()
51+
52+ # THEN: The media manager dock is made visible
53+ mocked_media_manager_dock.setVisible.assert_called_with(True)
54+
55+ def on_search_shortcut_triggered_focuses_widget_test(self):
56+ """
57+ Test that the focus is set on the widget when the search shortcut is triggered
58+ """
59+ # GIVEN: A build main window set up for testing
60+ with patch.object(self.main_window, 'media_manager_dock') as mocked_media_manager_dock, \
61+ patch.object(self.main_window, 'media_tool_box') as mocked_media_tool_box:
62+ mocked_media_manager_dock.isVisible.return_value = True
63+ mocked_widget = MagicMock()
64+ mocked_media_tool_box.currentWidget.return_value = mocked_widget
65+
66+ # WHEN: The search shortcut is triggered
67+ self.main_window.on_search_shortcut_triggered()
68+
69+ # THEN: The media manager dock is made visible
70+ self.assertEqual(0, mocked_media_manager_dock.setVisible.call_count)
71+ mocked_widget.on_focus.assert_called_with()
72+
73+