diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index abdf4af6a..155e484ee 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -213,13 +213,6 @@ class MediaManagerItem(QtGui.QWidget, RegistryProperties): icon=':/general/general_edit.png', triggers=self.on_edit_click) create_widget_action(self.list_view, separator=True) - if self.has_delete_icon: - create_widget_action(self.list_view, - 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Delete.title()), - text=self.plugin.get_string(StringContent.Delete)['title'], - icon=':/general/general_delete.png', - can_shortcuts=True, triggers=self.on_delete_click) - create_widget_action(self.list_view, separator=True) create_widget_action(self.list_view, 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Preview.title()), text=self.plugin.get_string(StringContent.Preview)['title'], @@ -238,6 +231,13 @@ class MediaManagerItem(QtGui.QWidget, RegistryProperties): text=self.plugin.get_string(StringContent.Service)['title'], icon=':/general/general_add.png', triggers=self.on_add_click) + if self.has_delete_icon: + create_widget_action(self.list_view, separator=True) + create_widget_action(self.list_view, + 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Delete.title()), + text=self.plugin.get_string(StringContent.Delete)['title'], + icon=':/general/general_delete.png', + can_shortcuts=True, triggers=self.on_delete_click) if self.add_to_service_item: create_widget_action(self.list_view, separator=True) create_widget_action(self.list_view, diff --git a/tests/functional/openlp_core_ui/test_mainwindow.py b/tests/functional/openlp_core_ui/test_mainwindow.py index 02062c06b..b912d488a 100644 --- a/tests/functional/openlp_core_ui/test_mainwindow.py +++ b/tests/functional/openlp_core_ui/test_mainwindow.py @@ -128,3 +128,21 @@ class TestMainWindow(TestCase, TestMixin): # THEN the main window's title should be set to the self.assertEqual(self.main_window.windowTitle(), '%s - %s' % (UiStrings().OLPV2x, 'test.osz'), 'The main window\'s title should be set to " - test.osz"') + + def mainwindow_configuration_test(self): + """ + Check that the Main Window initialises the Registry Correctly + """ + # GIVEN: A built main window + + # WHEN: you check the started functions + + # THEN: the following registry functions should have been registered + self.assertEqual(len(self.registry.service_list), 6, 'The registry should have 6 services.') + self.assertEqual(len(self.registry.functions_list), 16, 'The registry should have 16 functions') + self.assertTrue('application' in self.registry.service_list, 'The application should have been registered.') + self.assertTrue('main_window' in self.registry.service_list, 'The main_window should have been registered.') + self.assertTrue('media_controller' in self.registry.service_list, 'The media_controller should have been ' + 'registered.') + self.assertTrue('plugin_manager' in self.registry.service_list, + 'The plugin_manager should have been registered.')