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