diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 466b6808f..e7af59ee7 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -113,6 +113,10 @@ class ItemCapabilities(object): ``CanAutoStartForLive`` The capability to ignore the do not play if display blank flag. + + ``CanEditTitle`` + The capability to allow the ServiceManager to allow the title of the item to be + edited """ CanPreview = 1 @@ -131,6 +135,7 @@ class ItemCapabilities(object): CanWordSplit = 14 HasBackgroundAudio = 15 CanAutoStartForLive = 16 + CanEditTitle = 17 class ServiceItem(object): @@ -442,7 +447,7 @@ class ServiceItem(object): """ Returns the title of the service item. """ - if self.is_text() or self.is_image(): + if self.is_text() or ItemCapabilities.CanEditTitle in self.capabilities: return self.title else: if ItemCapabilities.HasDetailedTitleDisplay in self.capabilities: diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 033b20ccd..d6c416f52 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -783,8 +783,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog): self.auto_start_action.setVisible(False) if service_item[u'service_item'].is_capable(ItemCapabilities.CanEdit) and service_item[u'service_item'].edit_id: self.edit_action.setVisible(True) - if not service_item[u'service_item'].is_capable(ItemCapabilities.HasDetailedTitleDisplay)\ - and not service_item[u'service_item'].is_capable(ItemCapabilities.CanEdit): + if service_item[u'service_item'].is_capable(ItemCapabilities.CanEditTitle): self.rename_action.setVisible(True) if service_item[u'service_item'].is_capable(ItemCapabilities.CanMaintain): self.maintain_action.setVisible(True) @@ -1404,8 +1403,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog): Opens a dialog to rename the service item. """ item = self.find_service_item()[0] - if ItemCapabilities.HasDetailedTitleDisplay in self.service_items[item][u'service_item'].capabilities\ - or ItemCapabilities.CanEdit in self.service_items[item][u'service_item'].capabilities: + if not service_item[u'service_item'].is_capable(ItemCapabilities.CanEditTitle): return title = self.service_items[item][u'service_item'].title title, ok = QtGui.QInputDialog.getText(self, self.tr(translate('OpenLP.ServiceManager', 'Input title')), diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index abe3cc45a..3d8473fdd 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -842,6 +842,7 @@ class BibleMediaItem(MediaManagerItem): service_item.add_capability(ItemCapabilities.CanPreview) service_item.add_capability(ItemCapabilities.CanLoop) service_item.add_capability(ItemCapabilities.CanWordSplit) + service_item.add_capability(ItemCapabilities.CanEditTitle) # Service Item: Title service_item.title = create_separated_list(raw_title) # Service Item: Theme diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index f9c29c9e0..39fe4f036 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -553,6 +553,7 @@ class ImageMediaItem(MediaManagerItem): service_item.add_capability(ItemCapabilities.CanPreview) service_item.add_capability(ItemCapabilities.CanLoop) service_item.add_capability(ItemCapabilities.CanAppend) + service_item.add_capability(ItemCapabilities.CanEditTitle) # force a nonexistent theme service_item.theme = -1 missing_items = [] diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 57bc6947b..0c386787a 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -181,9 +181,9 @@ class MediaMediaItem(MediaManagerItem): translate('MediaPlugin.MediaItem', 'Missing Media File'), translate('MediaPlugin.MediaItem', 'The file %s no longer exists.') % filename) return False - service_item.title = self.displayTypeComboBox.currentText() - service_item.shortname = service_item.title + service_item.shortname = self.displayTypeComboBox.currentText() (path, name) = os.path.split(filename) + service_item.title = name service_item.add_from_command(path, name, CLAPPERBOARD) # Only get start and end times if going to a service if context == ServiceItemContext.Service: @@ -192,7 +192,7 @@ class MediaMediaItem(MediaManagerItem): return False service_item.add_capability(ItemCapabilities.CanAutoStartForLive) service_item.add_capability(ItemCapabilities.RequiresMedia) - service_item.add_capability(ItemCapabilities.HasDetailedTitleDisplay) + service_item.add_capability(ItemCapabilities.CanEditTitle) if Settings().value(self.settings_section + u'/media auto start') == QtCore.Qt.Checked: service_item.will_auto_start = True # force a non-existent theme diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index f92562541..759f166d3 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -244,10 +244,9 @@ class PresentationMediaItem(MediaManagerItem): items = self.list_view.selectedItems() if len(items) > 1: return False - service_item.title = self.displayTypeComboBox.currentText() service_item.shortname = self.displayTypeComboBox.currentText() service_item.add_capability(ItemCapabilities.ProvidesOwnDisplay) - service_item.add_capability(ItemCapabilities.HasDetailedTitleDisplay) + service_item.add_capability(ItemCapabilities.CanEditTitle) shortname = service_item.shortname if not shortname: return False @@ -260,6 +259,7 @@ class PresentationMediaItem(MediaManagerItem): return False controller = self.controllers[service_item.shortname] (path, name) = os.path.split(filename) + service_item.title = name doc = controller.add_document(filename) if doc.get_thumbnail_path(1, True) is None: doc.load_presentation()