forked from openlp/openlp
ServiceItem Cleanups
This commit is contained in:
parent
b5c46964d8
commit
4abcbe86b2
@ -73,6 +73,7 @@ class ServiceItem(object):
|
|||||||
self._display_frames = []
|
self._display_frames = []
|
||||||
self._uuid = unicode(uuid.uuid1())
|
self._uuid = unicode(uuid.uuid1())
|
||||||
self.autoPreviewAllowed = False
|
self.autoPreviewAllowed = False
|
||||||
|
self.notes = u''
|
||||||
|
|
||||||
def addIcon(self, icon):
|
def addIcon(self, icon):
|
||||||
"""
|
"""
|
||||||
@ -202,6 +203,7 @@ class ServiceItem(object):
|
|||||||
u'footer':self.raw_footer,
|
u'footer':self.raw_footer,
|
||||||
u'type':self.service_item_type,
|
u'type':self.service_item_type,
|
||||||
u'audit':self.audit,
|
u'audit':self.audit,
|
||||||
|
u'notes':self.notes,
|
||||||
u'preview':self.autoPreviewAllowed
|
u'preview':self.autoPreviewAllowed
|
||||||
}
|
}
|
||||||
service_data = []
|
service_data = []
|
||||||
@ -237,6 +239,7 @@ class ServiceItem(object):
|
|||||||
self.raw_footer = header[u'footer']
|
self.raw_footer = header[u'footer']
|
||||||
self.audit = header[u'audit']
|
self.audit = header[u'audit']
|
||||||
self.autoPreviewAllowed = header[u'preview']
|
self.autoPreviewAllowed = header[u'preview']
|
||||||
|
self.notes = header[u'notes']
|
||||||
if self.service_item_type == ServiceItemType.Text:
|
if self.service_item_type == ServiceItemType.Text:
|
||||||
for slide in serviceitem[u'serviceitem'][u'data']:
|
for slide in serviceitem[u'serviceitem'][u'data']:
|
||||||
self._raw_frames.append(slide)
|
self._raw_frames.append(slide)
|
||||||
|
@ -186,6 +186,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
Receiver.send_message(u'screen_changed')
|
Receiver.send_message(u'screen_changed')
|
||||||
|
|
||||||
def resetDisplay(self):
|
def resetDisplay(self):
|
||||||
|
Receiver.send_message(u'stop_display_loop')
|
||||||
if self.primary:
|
if self.primary:
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
else:
|
else:
|
||||||
|
@ -41,24 +41,31 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
|||||||
QtGui.QTreeWidget.__init__(self,parent)
|
QtGui.QTreeWidget.__init__(self,parent)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
||||||
# def mousePressEvent(self, event):
|
def mouseDoubleClickEvent(self, event):
|
||||||
# if event.button() == QtCore.Qt.RightButton:
|
self.parent.makeLive()
|
||||||
# item = self.itemAt(event.pos())
|
event.ignore()
|
||||||
# parentitem = item.parent()
|
|
||||||
# if parentitem is None:
|
def mousePressEvent(self, event):
|
||||||
# pos = item.data(0, QtCore.Qt.UserRole).toInt()[0]
|
if event.button() == QtCore.Qt.RightButton:
|
||||||
# else:
|
item = self.itemAt(event.pos())
|
||||||
# pos = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0]
|
parentitem = item.parent()
|
||||||
# serviceItem = self.parent.serviceItems[pos - 1]
|
self.parent.noteAction.setVisible(False)
|
||||||
# if serviceItem[u'data'].edit_enabled:
|
if parentitem is None:
|
||||||
# self.parent.editAction.setVisible(True)
|
pos = item.data(0, QtCore.Qt.UserRole).toInt()[0]
|
||||||
# else:
|
self.parent.noteAction.setVisible(True)
|
||||||
# self.parent.editAction.setVisible(False)
|
else:
|
||||||
# event.accept()
|
pos = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0]
|
||||||
# else:
|
serviceItem = self.parent.serviceItems[pos - 1]
|
||||||
# event.ignore()
|
if serviceItem[u'service_item'].edit_enabled:
|
||||||
|
self.parent.editAction.setVisible(True)
|
||||||
|
else:
|
||||||
|
self.parent.editAction.setVisible(False)
|
||||||
|
event.accept()
|
||||||
|
else:
|
||||||
|
event.ignore()
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
|
print event.isAutoRepeat()
|
||||||
if type(event) == QtGui.QKeyEvent:
|
if type(event) == QtGui.QKeyEvent:
|
||||||
#here accept the event and do something
|
#here accept the event and do something
|
||||||
if event.key() == QtCore.Qt.Key_Enter:
|
if event.key() == QtCore.Qt.Key_Enter:
|
||||||
@ -93,6 +100,7 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
|||||||
just tell it what plugin to call
|
just tell it what plugin to call
|
||||||
"""
|
"""
|
||||||
if event.buttons() != QtCore.Qt.LeftButton:
|
if event.buttons() != QtCore.Qt.LeftButton:
|
||||||
|
event.ignore()
|
||||||
return
|
return
|
||||||
drag = QtGui.QDrag(self)
|
drag = QtGui.QDrag(self)
|
||||||
mimeData = QtCore.QMimeData()
|
mimeData = QtCore.QMimeData()
|
||||||
@ -171,7 +179,11 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.editAction = contextMenuAction(
|
self.editAction = contextMenuAction(
|
||||||
self.ServiceManagerList, ':/system/system_live.png',
|
self.ServiceManagerList, ':/system/system_live.png',
|
||||||
self.trUtf8('&Edit Item'), self.remoteEdit)
|
self.trUtf8('&Edit Item'), self.remoteEdit)
|
||||||
|
self.noteAction = contextMenuAction(
|
||||||
|
self.ServiceManagerList, ':/system/system_live.png',
|
||||||
|
self.trUtf8('&Notes'), self.remoteEdit)
|
||||||
self.ServiceManagerList.addAction(self.editAction)
|
self.ServiceManagerList.addAction(self.editAction)
|
||||||
|
self.ServiceManagerList.addAction(self.noteAction)
|
||||||
self.ServiceManagerList.addAction(contextMenuSeparator(
|
self.ServiceManagerList.addAction(contextMenuSeparator(
|
||||||
self.ServiceManagerList))
|
self.ServiceManagerList))
|
||||||
self.ServiceManagerList.addAction(contextMenuAction(
|
self.ServiceManagerList.addAction(contextMenuAction(
|
||||||
@ -625,6 +637,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Send the current item to the Live slide controller
|
Send the current item to the Live slide controller
|
||||||
"""
|
"""
|
||||||
|
print "ml"
|
||||||
item, count = self.findServiceItem()
|
item, count = self.findServiceItem()
|
||||||
self.parent.LiveController.addServiceManagerItem(
|
self.parent.LiveController.addServiceManagerItem(
|
||||||
self.serviceItems[item][u'service_item'], count)
|
self.serviceItems[item][u'service_item'], count)
|
||||||
|
@ -193,6 +193,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
u'Stop Loop', u':/media/media_stop.png',
|
u'Stop Loop', u':/media/media_stop.png',
|
||||||
self.trUtf8('Stop continuous loop'), self.onStopLoop)
|
self.trUtf8('Stop continuous loop'), self.onStopLoop)
|
||||||
self.DelaySpinBox = QtGui.QSpinBox()
|
self.DelaySpinBox = QtGui.QSpinBox()
|
||||||
|
self.DelaySpinBox.setMinimum(1)
|
||||||
|
self.DelaySpinBox.setMaximum(180)
|
||||||
self.Toolbar.addToolbarWidget(
|
self.Toolbar.addToolbarWidget(
|
||||||
u'Image SpinBox', self.DelaySpinBox)
|
u'Image SpinBox', self.DelaySpinBox)
|
||||||
self.DelaySpinBox.setSuffix(self.trUtf8('s'))
|
self.DelaySpinBox.setSuffix(self.trUtf8('s'))
|
||||||
@ -279,6 +281,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
|
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
|
||||||
self.Mediabar.setVisible(False)
|
self.Mediabar.setVisible(False)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'stop_display_loop'), self.onStopLoop)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'%s_first' % prefix), self.onSlideSelectedFirst)
|
QtCore.SIGNAL(u'%s_first' % prefix), self.onSlideSelectedFirst)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
@ -49,6 +49,7 @@ class ImageTab(SettingsTab):
|
|||||||
self.TimeoutLabel.setObjectName(u'TimeoutLabel')
|
self.TimeoutLabel.setObjectName(u'TimeoutLabel')
|
||||||
self.TimeoutLayout.addWidget(self.TimeoutLabel)
|
self.TimeoutLayout.addWidget(self.TimeoutLabel)
|
||||||
self.TimeoutSpinBox = QtGui.QSpinBox(self.ImageSettingsGroupBox)
|
self.TimeoutSpinBox = QtGui.QSpinBox(self.ImageSettingsGroupBox)
|
||||||
|
self.TimeoutSpinBox.setMinimum(1)
|
||||||
self.TimeoutSpinBox.setMaximum(180)
|
self.TimeoutSpinBox.setMaximum(180)
|
||||||
self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox')
|
self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox')
|
||||||
self.TimeoutLayout.addWidget(self.TimeoutSpinBox)
|
self.TimeoutLayout.addWidget(self.TimeoutSpinBox)
|
||||||
|
Loading…
Reference in New Issue
Block a user