def requiredIcons(self): MediaManagerItem.requiredIcons(self) self.hasImportIcon = True self.hasNewIcon = False self.hasEditIcon = True self.hasDeleteIcon = True self.addToServiceItem = False
def required_icons(self): """ Set which icons the media manager tab should show """ MediaManagerItem.required_icons(self) self.has_file_icon = True self.has_new_icon = False self.has_edit_icon = False
def requiredIcons(self): """ Set which icons the media manager tab should show """ MediaManagerItem.requiredIcons(self) self.hasFileIcon = True self.hasNewIcon = False self.hasEditIcon = False
def required_icons(self): """ Set which icons the media manager tab should show """ MediaManagerItem.required_icons(self) self.has_import_icon = True self.has_new_icon = False self.has_edit_icon = True self.has_delete_icon = True self.add_to_service_item = False
def __init__(self, parent, plugin, icon): self.IconPath = u'custom/custom' MediaManagerItem.__init__(self, parent, plugin, icon) self.edit_custom_form = EditCustomForm(self, self.main_window, self.plugin.manager) self.singleServiceItem = False self.quickPreviewAllowed = True self.hasSearch = True # Holds information about whether the edit is remotely triggered and # which Custom is required. self.remoteCustom = -1 self.manager = plugin.manager
def __init__(self, parent, plugin): self.icon_path = 'songs/song' self.lock_icon = build_icon(':/bibles/bibles_search_lock.png') self.unlock_icon = build_icon(':/bibles/bibles_search_unlock.png') MediaManagerItem.__init__(self, parent, plugin) # Place to store the search results for both bibles. self.settings = self.plugin.settings_tab self.quick_preview_allowed = True self.has_search = True self.search_results = {} self.second_search_results = {} self.check_search_result() Registry().register_function('bibles_load_list', self.reload_bibles)
def __init__(self, parent, plugin, icon): self.IconPath = u'songs/song' self.lockIcon = build_icon(u':/bibles/bibles_search_lock.png') self.unlockIcon = build_icon(u':/bibles/bibles_search_unlock.png') MediaManagerItem.__init__(self, parent, plugin, icon) # Place to store the search results for both bibles. self.settings = self.plugin.settingsTab self.quickPreviewAllowed = True self.hasSearch = True self.search_results = {} self.second_search_results = {} self.checkSearchResult() QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'bibles_load_list'), self.reloadBibles)
def __init__(self, parent, plugin, icon): self.IconPath = u'songs/song' MediaManagerItem.__init__(self, parent, plugin, icon) self.editSongForm = EditSongForm(self, self.main_window, self.plugin.manager) self.openLyrics = OpenLyrics(self.plugin.manager) self.singleServiceItem = False self.songMaintenanceForm = SongMaintenanceForm(self.plugin.manager, self) # Holds information about whether the edit is remotely triggered and # which Song is required. self.remoteSong = -1 self.editItem = None self.quickPreviewAllowed = True self.hasSearch = True
def test_required_icons(self): """ Test the default icons for plugins """ # GIVEN: A MediaManagerItem mmi = MediaManagerItem(None) # WHEN: Object is created mmi.required_icons() # THEN: Default icons should be populated self.assertFalse(mmi.has_import_icon, 'There should be no import icon by default') self.assertTrue(mmi.has_new_icon, 'By default a new icon should be present') self.assertFalse(mmi.has_file_icon, 'There should be no file icon by default') self.assertTrue(mmi.has_delete_icon, 'By default a delete icon should be present') self.assertFalse(mmi.add_to_service_item, 'There should be no add_to_service icon by default')
def test_on_double_clicked(self, mocked_on_preview_click, MockedSettings): """ Test that when an item is double-clicked then the item is previewed """ # GIVEN: A setting to enable "Double-click to go live" and a media manager item mocked_settings = MagicMock() mocked_settings.value.return_value = False MockedSettings.return_value = mocked_settings mmi = MediaManagerItem(None) # WHEN: on_double_clicked() is called mmi.on_double_clicked() # THEN: on_preview_click() should have been called mocked_on_preview_click.assert_called_with()
def on_double_clicked_go_live_test(self, mocked_on_live_click, MockedSettings): """ Test that when "Double-click to go live" is enabled that the item goes live """ # GIVEN: A setting to enable "Double-click to go live" and a media manager item mocked_settings = MagicMock() mocked_settings.value.side_effect = lambda x: x == 'advanced/double click live' MockedSettings.return_value = mocked_settings mmi = MediaManagerItem(None) # WHEN: on_double_clicked() is called mmi.on_double_clicked() # THEN: on_live_click() should have been called mocked_on_live_click.assert_called_with()
def on_double_clicked_test(self, mocked_on_preview_click, MockedSettings): """ Test that when an item is double-clicked then the item is previewed """ # GIVEN: A setting to enable "Double-click to go live" and a media manager item mocked_settings = MagicMock() mocked_settings.value.return_value = False MockedSettings.return_value = mocked_settings mmi = MediaManagerItem(None) # WHEN: on_double_clicked() is called mmi.on_double_clicked() # THEN: on_preview_click() should have been called mocked_on_preview_click.assert_called_with()
def test_on_double_clicked_go_live(self, mocked_on_live_click, MockedSettings): """ Test that when "Double-click to go live" is enabled that the item goes live """ # GIVEN: A setting to enable "Double-click to go live" and a media manager item mocked_settings = MagicMock() mocked_settings.value.side_effect = lambda x: x == 'advanced/double click live' MockedSettings.return_value = mocked_settings mmi = MediaManagerItem(None) # WHEN: on_double_clicked() is called mmi.on_double_clicked() # THEN: on_live_click() should have been called mocked_on_live_click.assert_called_with()
def __init__(self, parent, plugin, icon, controllers): """ Constructor. Setup defaults """ self.controllers = controllers self.IconPath = u'presentations/presentation' self.Automatic = u'' MediaManagerItem.__init__(self, parent, plugin, icon) self.message_listener = MessageListener(self) self.hasSearch = True self.singleServiceItem = False QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'mediaitem_presentation_rebuild'), self.populateDisplayTypes) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'mediaitem_suffixes'), self.buildFileMaskString) # Allow DnD from the desktop self.listView.activateDnD()
def test_on_double_clicked_single_click_preview(self, mocked_on_preview_click, mocked_on_live_click, MockedSettings): """ Test that when "Single-click preview" is enabled then nothing happens on double-click """ # GIVEN: A setting to enable "Double-click to go live" and a media manager item mocked_settings = MagicMock() mocked_settings.value.side_effect = lambda x: x == 'advanced/single click preview' MockedSettings.return_value = mocked_settings mmi = MediaManagerItem(None) # WHEN: on_double_clicked() is called mmi.on_double_clicked() # THEN: on_live_click() should have been called self.assertEqual(0, mocked_on_live_click.call_count, u'on_live_click() should not have been called') self.assertEqual(0, mocked_on_preview_click.call_count, u'on_preview_click() should not have been called')
def on_double_clicked_single_click_preview_test(self, mocked_on_preview_click, mocked_on_live_click, MockedSettings): """ Test that when "Single-click preview" is enabled then nothing happens on double-click """ # GIVEN: A setting to enable "Double-click to go live" and a media manager item mocked_settings = MagicMock() mocked_settings.value.side_effect = lambda x: x == 'advanced/single click preview' MockedSettings.return_value = mocked_settings mmi = MediaManagerItem(None) # WHEN: on_double_clicked() is called mmi.on_double_clicked() # THEN: on_live_click() should have been called self.assertEqual(0, mocked_on_live_click.call_count, u'on_live_click() should not have been called') self.assertEqual(0, mocked_on_preview_click.call_count, u'on_preview_click() should not have been called')
def __init__(self, parent, plugin, icon): self.iconPath = u'images/image' self.background = False self.automatic = u'' MediaManagerItem.__init__(self, parent, plugin, icon) self.singleServiceItem = False self.hasSearch = True self.mediaObject = None self.displayController = DisplayController(parent) self.displayController.controllerLayout = QtGui.QVBoxLayout() self.media_controller.register_controller(self.displayController) self.media_controller.set_controls_visible(self.displayController, False) self.displayController.previewDisplay = Display(self.displayController, False, self.displayController) self.displayController.previewDisplay.hide() self.displayController.previewDisplay.setGeometry(QtCore.QRect(0, 0, 300, 300)) self.displayController.previewDisplay.screen = {u'size':self.displayController.previewDisplay.geometry()} self.displayController.previewDisplay.setup() self.media_controller.setup_display(self.displayController.previewDisplay, False) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'video_background_replaced'), self.videobackgroundReplaced) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'mediaitem_media_rebuild'), self.rebuild_players) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_screen_changed'), self.displaySetup) # Allow DnD from the desktop self.listView.activateDnD()
def add_list_view_to_toolbar(self): """ Creates the main widget for listing items. """ MediaManagerItem.add_list_view_to_toolbar(self) self.list_view.addAction(self.replace_action)
def addListViewToToolBar(self): MediaManagerItem.addListViewToToolBar(self) self.listView.addAction(self.replaceAction)
def add_list_view_to_toolbar(self): MediaManagerItem.add_list_view_to_toolbar(self) self.list_view.addAction(self.replace_action)
def requiredIcons(self): MediaManagerItem.requiredIcons(self) self.hasFileIcon = True self.hasNewIcon = False self.hasEditIcon = False