← Back to team overview

openlp-core team mailing list archive

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

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/remove_stylesheet into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/remove_stylesheet/+merge/282103

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

-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/remove_stylesheet into lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2015-12-31 22:46:06 +0000
+++ openlp/core/ui/mainwindow.py	2016-01-09 19:15:08 +0000
@@ -153,7 +153,8 @@
         # Create the MediaManager
         self.media_manager_dock = OpenLPDockWidget(main_window, 'media_manager_dock',
                                                    ':/system/system_mediamanager.png')
-        self.media_manager_dock.setStyleSheet(MEDIA_MANAGER_STYLE)
+        # TODO: Figure out how to fix the stylesheet and add it back in
+        # self.media_manager_dock.setStyleSheet(MEDIA_MANAGER_STYLE)
         # Create the media toolbox
         self.media_tool_box = QtWidgets.QToolBox(self.media_manager_dock)
         self.media_tool_box.setObjectName('media_tool_box')

=== modified file 'tests/functional/openlp_core_ui/test_mainwindow.py'
--- tests/functional/openlp_core_ui/test_mainwindow.py	2015-12-31 22:46:06 +0000
+++ tests/functional/openlp_core_ui/test_mainwindow.py	2016-01-09 19:15:08 +0000
@@ -56,6 +56,15 @@
                 patch('openlp.core.ui.mainwindow.QtWidgets.QMainWindow.addDockWidget') as mocked_add_dock_method, \
                 patch('openlp.core.ui.mainwindow.ThemeManager') as mocked_theme_manager, \
                 patch('openlp.core.ui.mainwindow.Renderer') as mocked_renderer:
+            self.mocked_settings_form = mocked_settings_form
+            self.mocked_image_manager = mocked_image_manager
+            self.mocked_live_controller = mocked_live_controller
+            self.mocked_preview_controller = mocked_preview_controller
+            self.mocked_dock_widget = mocked_dock_widget
+            self.mocked_q_tool_box_class = mocked_q_tool_box_class
+            self.mocked_add_dock_method = mocked_add_dock_method
+            self.mocked_theme_manager = mocked_theme_manager
+            self.mocked_renderer = mocked_renderer
             self.main_window = MainWindow()
 
     def tearDown(self):
@@ -146,3 +155,39 @@
                                                                           'registered.')
         self.assertTrue('plugin_manager' in self.registry.service_list,
                         'The plugin_manager should have been registered.')
+
+    def on_search_shortcut_triggered_shows_media_manager_test(self):
+        """
+        Test that the media manager is made visible when the search shortcut is triggered
+        """
+        # GIVEN: A build main window set up for testing
+        with patch.object(self.main_window, 'media_manager_dock') as mocked_media_manager_dock, \
+                patch.object(self.main_window, 'media_tool_box') as mocked_media_tool_box:
+            mocked_media_manager_dock.isVisible.return_value = False
+            mocked_media_tool_box.currentWidget.return_value = None
+
+            # WHEN: The search shortcut is triggered
+            self.main_window.on_search_shortcut_triggered()
+
+            # THEN: The media manager dock is made visible
+            mocked_media_manager_dock.setVisible.assert_called_with(True)
+
+    def on_search_shortcut_triggered_focuses_widget_test(self):
+        """
+        Test that the focus is set on the widget when the search shortcut is triggered
+        """
+        # GIVEN: A build main window set up for testing
+        with patch.object(self.main_window, 'media_manager_dock') as mocked_media_manager_dock, \
+                patch.object(self.main_window, 'media_tool_box') as mocked_media_tool_box:
+            mocked_media_manager_dock.isVisible.return_value = True
+            mocked_widget = MagicMock()
+            mocked_media_tool_box.currentWidget.return_value = mocked_widget
+
+            # WHEN: The search shortcut is triggered
+            self.main_window.on_search_shortcut_triggered()
+
+            # THEN: The media manager dock is made visible
+            self.assertEqual(0, mocked_media_manager_dock.setVisible.call_count)
+            mocked_widget.on_focus.assert_called_with()
+
+


Follow ups