forked from openlp/openlp
Add maintain menu item
This commit is contained in:
parent
de8d0f4d9c
commit
c1182aa9cc
@ -69,6 +69,7 @@ class ServiceItem(object):
|
|||||||
self.service_item_path = None
|
self.service_item_path = None
|
||||||
self.service_item_type = None
|
self.service_item_type = None
|
||||||
self.edit_enabled = False
|
self.edit_enabled = False
|
||||||
|
self.maintain_allowed = False
|
||||||
self._raw_frames = []
|
self._raw_frames = []
|
||||||
self._display_frames = []
|
self._display_frames = []
|
||||||
self._uuid = unicode(uuid.uuid1())
|
self._uuid = unicode(uuid.uuid1())
|
||||||
|
@ -202,6 +202,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.menu = QtGui.QMenu()
|
self.menu = QtGui.QMenu()
|
||||||
self.editAction = self.menu.addAction(self.trUtf8('&Edit Item'))
|
self.editAction = self.menu.addAction(self.trUtf8('&Edit Item'))
|
||||||
self.editAction.setIcon(build_icon(u':/services/service_edit.png'))
|
self.editAction.setIcon(build_icon(u':/services/service_edit.png'))
|
||||||
|
self.maintainAction = self.menu.addAction(self.trUtf8('&Maintain Item'))
|
||||||
|
self.maintainAction.setIcon(build_icon(u':/services/service_edit.png'))
|
||||||
self.notesAction = self.menu.addAction(self.trUtf8('&Notes'))
|
self.notesAction = self.menu.addAction(self.trUtf8('&Notes'))
|
||||||
self.notesAction.setIcon(build_icon(u':/services/service_notes.png'))
|
self.notesAction.setIcon(build_icon(u':/services/service_notes.png'))
|
||||||
self.deleteAction = self.menu.addAction(self.trUtf8('&Delete From Service'))
|
self.deleteAction = self.menu.addAction(self.trUtf8('&Delete From Service'))
|
||||||
@ -227,9 +229,12 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
pos = item.parent().data(0, QtCore.Qt.UserRole).toInt()[0]
|
pos = item.parent().data(0, QtCore.Qt.UserRole).toInt()[0]
|
||||||
serviceItem = self.serviceItems[pos - 1]
|
serviceItem = self.serviceItems[pos - 1]
|
||||||
self.editAction.setVisible(False)
|
self.editAction.setVisible(False)
|
||||||
|
self.maintainAction.setVisible(False)
|
||||||
self.notesAction.setVisible(False)
|
self.notesAction.setVisible(False)
|
||||||
if serviceItem[u'service_item'].edit_enabled:
|
if serviceItem[u'service_item'].edit_enabled:
|
||||||
self.editAction.setVisible(True)
|
self.editAction.setVisible(True)
|
||||||
|
if serviceItem[u'service_item'].maintain_allowed:
|
||||||
|
self.maintainAction.setVisible(True)
|
||||||
if item.parent() is None:
|
if item.parent() is None:
|
||||||
self.notesAction.setVisible(True)
|
self.notesAction.setVisible(True)
|
||||||
self.themeMenu.menuAction().setVisible(False)
|
self.themeMenu.menuAction().setVisible(False)
|
||||||
|
@ -146,6 +146,7 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
if items:
|
if items:
|
||||||
service_item.title = self.trUtf8('Image(s)')
|
service_item.title = self.trUtf8('Image(s)')
|
||||||
service_item.autoPreviewAllowed = True
|
service_item.autoPreviewAllowed = True
|
||||||
|
service_item.maintain_allowed = True
|
||||||
for item in items:
|
for item in items:
|
||||||
bitem = self.ListView.item(item.row())
|
bitem = self.ListView.item(item.row())
|
||||||
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
||||||
|
Loading…
Reference in New Issue
Block a user