forked from openlp/openlp
Added capability to edit title of service_item
This commit is contained in:
parent
637cb09e74
commit
eca016c21d
@ -113,6 +113,10 @@ class ItemCapabilities(object):
|
|||||||
|
|
||||||
``CanAutoStartForLive``
|
``CanAutoStartForLive``
|
||||||
The capability to ignore the do not play if display blank flag.
|
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
|
CanPreview = 1
|
||||||
@ -131,6 +135,7 @@ class ItemCapabilities(object):
|
|||||||
CanWordSplit = 14
|
CanWordSplit = 14
|
||||||
HasBackgroundAudio = 15
|
HasBackgroundAudio = 15
|
||||||
CanAutoStartForLive = 16
|
CanAutoStartForLive = 16
|
||||||
|
CanEditTitle = 17
|
||||||
|
|
||||||
|
|
||||||
class ServiceItem(object):
|
class ServiceItem(object):
|
||||||
@ -442,7 +447,7 @@ class ServiceItem(object):
|
|||||||
"""
|
"""
|
||||||
Returns the title of the service item.
|
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
|
return self.title
|
||||||
else:
|
else:
|
||||||
if ItemCapabilities.HasDetailedTitleDisplay in self.capabilities:
|
if ItemCapabilities.HasDetailedTitleDisplay in self.capabilities:
|
||||||
|
@ -783,8 +783,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
|||||||
self.auto_start_action.setVisible(False)
|
self.auto_start_action.setVisible(False)
|
||||||
if service_item[u'service_item'].is_capable(ItemCapabilities.CanEdit) and service_item[u'service_item'].edit_id:
|
if service_item[u'service_item'].is_capable(ItemCapabilities.CanEdit) and service_item[u'service_item'].edit_id:
|
||||||
self.edit_action.setVisible(True)
|
self.edit_action.setVisible(True)
|
||||||
if not service_item[u'service_item'].is_capable(ItemCapabilities.HasDetailedTitleDisplay)\
|
if service_item[u'service_item'].is_capable(ItemCapabilities.CanEditTitle):
|
||||||
and not service_item[u'service_item'].is_capable(ItemCapabilities.CanEdit):
|
|
||||||
self.rename_action.setVisible(True)
|
self.rename_action.setVisible(True)
|
||||||
if service_item[u'service_item'].is_capable(ItemCapabilities.CanMaintain):
|
if service_item[u'service_item'].is_capable(ItemCapabilities.CanMaintain):
|
||||||
self.maintain_action.setVisible(True)
|
self.maintain_action.setVisible(True)
|
||||||
@ -1404,8 +1403,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
|||||||
Opens a dialog to rename the service item.
|
Opens a dialog to rename the service item.
|
||||||
"""
|
"""
|
||||||
item = self.find_service_item()[0]
|
item = self.find_service_item()[0]
|
||||||
if ItemCapabilities.HasDetailedTitleDisplay in self.service_items[item][u'service_item'].capabilities\
|
if not service_item[u'service_item'].is_capable(ItemCapabilities.CanEditTitle):
|
||||||
or ItemCapabilities.CanEdit in self.service_items[item][u'service_item'].capabilities:
|
|
||||||
return
|
return
|
||||||
title = self.service_items[item][u'service_item'].title
|
title = self.service_items[item][u'service_item'].title
|
||||||
title, ok = QtGui.QInputDialog.getText(self, self.tr(translate('OpenLP.ServiceManager', 'Input title')),
|
title, ok = QtGui.QInputDialog.getText(self, self.tr(translate('OpenLP.ServiceManager', 'Input title')),
|
||||||
|
@ -842,6 +842,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
service_item.add_capability(ItemCapabilities.CanPreview)
|
service_item.add_capability(ItemCapabilities.CanPreview)
|
||||||
service_item.add_capability(ItemCapabilities.CanLoop)
|
service_item.add_capability(ItemCapabilities.CanLoop)
|
||||||
service_item.add_capability(ItemCapabilities.CanWordSplit)
|
service_item.add_capability(ItemCapabilities.CanWordSplit)
|
||||||
|
service_item.add_capability(ItemCapabilities.CanEditTitle)
|
||||||
# Service Item: Title
|
# Service Item: Title
|
||||||
service_item.title = create_separated_list(raw_title)
|
service_item.title = create_separated_list(raw_title)
|
||||||
# Service Item: Theme
|
# Service Item: Theme
|
||||||
|
@ -553,6 +553,7 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
service_item.add_capability(ItemCapabilities.CanPreview)
|
service_item.add_capability(ItemCapabilities.CanPreview)
|
||||||
service_item.add_capability(ItemCapabilities.CanLoop)
|
service_item.add_capability(ItemCapabilities.CanLoop)
|
||||||
service_item.add_capability(ItemCapabilities.CanAppend)
|
service_item.add_capability(ItemCapabilities.CanAppend)
|
||||||
|
service_item.add_capability(ItemCapabilities.CanEditTitle)
|
||||||
# force a nonexistent theme
|
# force a nonexistent theme
|
||||||
service_item.theme = -1
|
service_item.theme = -1
|
||||||
missing_items = []
|
missing_items = []
|
||||||
|
@ -181,9 +181,9 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
translate('MediaPlugin.MediaItem', 'Missing Media File'),
|
translate('MediaPlugin.MediaItem', 'Missing Media File'),
|
||||||
translate('MediaPlugin.MediaItem', 'The file %s no longer exists.') % filename)
|
translate('MediaPlugin.MediaItem', 'The file %s no longer exists.') % filename)
|
||||||
return False
|
return False
|
||||||
service_item.title = self.displayTypeComboBox.currentText()
|
service_item.shortname = self.displayTypeComboBox.currentText()
|
||||||
service_item.shortname = service_item.title
|
|
||||||
(path, name) = os.path.split(filename)
|
(path, name) = os.path.split(filename)
|
||||||
|
service_item.title = name
|
||||||
service_item.add_from_command(path, name, CLAPPERBOARD)
|
service_item.add_from_command(path, name, CLAPPERBOARD)
|
||||||
# Only get start and end times if going to a service
|
# Only get start and end times if going to a service
|
||||||
if context == ServiceItemContext.Service:
|
if context == ServiceItemContext.Service:
|
||||||
@ -192,7 +192,7 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
return False
|
return False
|
||||||
service_item.add_capability(ItemCapabilities.CanAutoStartForLive)
|
service_item.add_capability(ItemCapabilities.CanAutoStartForLive)
|
||||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
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:
|
if Settings().value(self.settings_section + u'/media auto start') == QtCore.Qt.Checked:
|
||||||
service_item.will_auto_start = True
|
service_item.will_auto_start = True
|
||||||
# force a non-existent theme
|
# force a non-existent theme
|
||||||
|
@ -244,10 +244,9 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
items = self.list_view.selectedItems()
|
items = self.list_view.selectedItems()
|
||||||
if len(items) > 1:
|
if len(items) > 1:
|
||||||
return False
|
return False
|
||||||
service_item.title = self.displayTypeComboBox.currentText()
|
|
||||||
service_item.shortname = self.displayTypeComboBox.currentText()
|
service_item.shortname = self.displayTypeComboBox.currentText()
|
||||||
service_item.add_capability(ItemCapabilities.ProvidesOwnDisplay)
|
service_item.add_capability(ItemCapabilities.ProvidesOwnDisplay)
|
||||||
service_item.add_capability(ItemCapabilities.HasDetailedTitleDisplay)
|
service_item.add_capability(ItemCapabilities.CanEditTitle)
|
||||||
shortname = service_item.shortname
|
shortname = service_item.shortname
|
||||||
if not shortname:
|
if not shortname:
|
||||||
return False
|
return False
|
||||||
@ -260,6 +259,7 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
return False
|
return False
|
||||||
controller = self.controllers[service_item.shortname]
|
controller = self.controllers[service_item.shortname]
|
||||||
(path, name) = os.path.split(filename)
|
(path, name) = os.path.split(filename)
|
||||||
|
service_item.title = name
|
||||||
doc = controller.add_document(filename)
|
doc = controller.add_document(filename)
|
||||||
if doc.get_thumbnail_path(1, True) is None:
|
if doc.get_thumbnail_path(1, True) is None:
|
||||||
doc.load_presentation()
|
doc.load_presentation()
|
||||||
|
Loading…
Reference in New Issue
Block a user