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

bzr-revno: 2597
This commit is contained in:
raoul@snyman.info 2016-01-09 19:33:38 +00:00 committed by Tim Bentley
commit 285ad89725
2 changed files with 47 additions and 1 deletions

View File

@ -153,7 +153,8 @@ class Ui_MainWindow(object):
# Create the MediaManager # Create the MediaManager
self.media_manager_dock = OpenLPDockWidget(main_window, 'media_manager_dock', self.media_manager_dock = OpenLPDockWidget(main_window, 'media_manager_dock',
':/system/system_mediamanager.png') ':/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 # Create the media toolbox
self.media_tool_box = QtWidgets.QToolBox(self.media_manager_dock) self.media_tool_box = QtWidgets.QToolBox(self.media_manager_dock)
self.media_tool_box.setObjectName('media_tool_box') self.media_tool_box.setObjectName('media_tool_box')

View File

@ -56,6 +56,15 @@ class TestMainWindow(TestCase, TestMixin):
patch('openlp.core.ui.mainwindow.QtWidgets.QMainWindow.addDockWidget') as mocked_add_dock_method, \ 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.ThemeManager') as mocked_theme_manager, \
patch('openlp.core.ui.mainwindow.Renderer') as mocked_renderer: 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() self.main_window = MainWindow()
def tearDown(self): def tearDown(self):
@ -146,3 +155,39 @@ class TestMainWindow(TestCase, TestMixin):
'registered.') 'registered.')
self.assertTrue('plugin_manager' in self.registry.service_list, self.assertTrue('plugin_manager' in self.registry.service_list,
'The plugin_manager should have been registered.') '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()