forked from openlp/openlp
Fix phantom expansion in Service Manager
This commit is contained in:
commit
2d690c209d
@ -358,6 +358,10 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
u'to be defined by the plugin')
|
u'to be defined by the plugin')
|
||||||
|
|
||||||
def onPreviewClick(self):
|
def onPreviewClick(self):
|
||||||
|
if not self.ListView.selectedIndexes():
|
||||||
|
QtGui.QMessageBox.information(self,
|
||||||
|
self.trUtf8(u'No items selected...'),
|
||||||
|
self.trUtf8(u'You must select one or more items'))
|
||||||
log.debug(self.PluginNameShort + u' Preview Requested')
|
log.debug(self.PluginNameShort + u' Preview Requested')
|
||||||
service_item = self.buildServiceItem()
|
service_item = self.buildServiceItem()
|
||||||
if service_item is not None:
|
if service_item is not None:
|
||||||
@ -365,6 +369,10 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
self.parent.preview_controller.addServiceItem(service_item)
|
self.parent.preview_controller.addServiceItem(service_item)
|
||||||
|
|
||||||
def onLiveClick(self):
|
def onLiveClick(self):
|
||||||
|
if not self.ListView.selectedIndexes():
|
||||||
|
QtGui.QMessageBox.information(self,
|
||||||
|
self.trUtf8(u'No items selected...'),
|
||||||
|
self.trUtf8(u'You must select one or more items'))
|
||||||
log.debug(self.PluginNameShort + u' Live Requested')
|
log.debug(self.PluginNameShort + u' Live Requested')
|
||||||
service_item = self.buildServiceItem()
|
service_item = self.buildServiceItem()
|
||||||
if service_item is not None:
|
if service_item is not None:
|
||||||
@ -373,6 +381,10 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
self.parent.live_controller.addServiceItem(service_item)
|
self.parent.live_controller.addServiceItem(service_item)
|
||||||
|
|
||||||
def onAddClick(self):
|
def onAddClick(self):
|
||||||
|
if not self.ListView.selectedIndexes():
|
||||||
|
QtGui.QMessageBox.information(self,
|
||||||
|
self.trUtf8(u'No items selected...'),
|
||||||
|
self.trUtf8(u'You must select one or more items'))
|
||||||
log.debug(self.PluginNameShort + u' Add Requested')
|
log.debug(self.PluginNameShort + u' Add Requested')
|
||||||
service_item = self.buildServiceItem()
|
service_item = self.buildServiceItem()
|
||||||
if service_item is not None:
|
if service_item is not None:
|
||||||
|
@ -76,7 +76,6 @@ class Renderer(object):
|
|||||||
self.theme_name = theme.theme_name
|
self.theme_name = theme.theme_name
|
||||||
self._set_theme_font()
|
self._set_theme_font()
|
||||||
if theme.background_type == u'image':
|
if theme.background_type == u'image':
|
||||||
print theme.background_filename
|
|
||||||
if theme.background_filename is not None:
|
if theme.background_filename is not None:
|
||||||
self.set_bg_image(theme.background_filename)
|
self.set_bg_image(theme.background_filename)
|
||||||
|
|
||||||
|
@ -94,15 +94,15 @@ class MainDisplay(DisplayLabel):
|
|||||||
self.layout.setObjectName(u'layout')
|
self.layout.setObjectName(u'layout')
|
||||||
self.mediaObject = Phonon.MediaObject(self)
|
self.mediaObject = Phonon.MediaObject(self)
|
||||||
self.video = Phonon.VideoWidget()
|
self.video = Phonon.VideoWidget()
|
||||||
|
self.video.setVisible(False)
|
||||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||||
self.video.setFullScreen(True)
|
|
||||||
Phonon.createPath(self.mediaObject, self.video)
|
Phonon.createPath(self.mediaObject, self.video)
|
||||||
Phonon.createPath(self.mediaObject, self.audio)
|
Phonon.createPath(self.mediaObject, self.audio)
|
||||||
self.layout.insertWidget(0, self.video)
|
self.layout.insertWidget(0, self.video)
|
||||||
self.display = QtGui.QLabel(self)
|
self.display = QtGui.QLabel(self)
|
||||||
self.display.setScaledContents(True)
|
self.display.setScaledContents(True)
|
||||||
self.layout.insertWidget(0, self.display)
|
self.layout.insertWidget(0, self.display)
|
||||||
self.primary = False
|
self.primary = True
|
||||||
self.displayBlank = False
|
self.displayBlank = False
|
||||||
self.blankFrame = None
|
self.blankFrame = None
|
||||||
self.frame = None
|
self.frame = None
|
||||||
@ -272,6 +272,7 @@ class MainDisplay(DisplayLabel):
|
|||||||
self.firstTime = True
|
self.firstTime = True
|
||||||
self.mediaLoaded = True
|
self.mediaLoaded = True
|
||||||
self.display.hide()
|
self.display.hide()
|
||||||
|
self.video.setFullScreen(True)
|
||||||
self.mediaObject.play()
|
self.mediaObject.play()
|
||||||
if self.primary:
|
if self.primary:
|
||||||
self.setVisible(True)
|
self.setVisible(True)
|
||||||
@ -292,4 +293,5 @@ class MainDisplay(DisplayLabel):
|
|||||||
self.mediaObject.stop()
|
self.mediaObject.stop()
|
||||||
self.mediaObject.clearQueue()
|
self.mediaObject.clearQueue()
|
||||||
self.mediaLoaded = False
|
self.mediaLoaded = False
|
||||||
|
self.video.setVisible(False)
|
||||||
self.display.show()
|
self.display.show()
|
||||||
|
@ -99,17 +99,6 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
|||||||
mimeData.setText(u'ServiceManager')
|
mimeData.setText(u'ServiceManager')
|
||||||
dropAction = drag.start(QtCore.Qt.CopyAction)
|
dropAction = drag.start(QtCore.Qt.CopyAction)
|
||||||
|
|
||||||
class Iter(QtGui.QTreeWidgetItemIterator):
|
|
||||||
def __init__(self, *args):
|
|
||||||
QtGui.QTreeWidgetItemIterator.__init__(self, *args)
|
|
||||||
|
|
||||||
def next(self):
|
|
||||||
self.__iadd__(1)
|
|
||||||
value = self.value()
|
|
||||||
if value:
|
|
||||||
return self.value()
|
|
||||||
else:
|
|
||||||
return None
|
|
||||||
|
|
||||||
class ServiceManager(QtGui.QWidget):
|
class ServiceManager(QtGui.QWidget):
|
||||||
"""
|
"""
|
||||||
@ -173,6 +162,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
QtGui.QAbstractItemView.DragDrop)
|
QtGui.QAbstractItemView.DragDrop)
|
||||||
self.ServiceManagerList.setAlternatingRowColors(True)
|
self.ServiceManagerList.setAlternatingRowColors(True)
|
||||||
self.ServiceManagerList.setHeaderHidden(True)
|
self.ServiceManagerList.setHeaderHidden(True)
|
||||||
|
self.ServiceManagerList.setExpandsOnDoubleClick(False)
|
||||||
self.ServiceManagerList.setObjectName(u'ServiceManagerList')
|
self.ServiceManagerList.setObjectName(u'ServiceManagerList')
|
||||||
# enable drop
|
# enable drop
|
||||||
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
||||||
@ -248,23 +238,22 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Moves the selection up the window
|
Moves the selection up the window
|
||||||
Called by the up arrow
|
Called by the up arrow
|
||||||
"""
|
"""
|
||||||
it = Iter(self.ServiceManagerList)
|
serviceIterator = QTreeWidgetItemIterator(self.ServiceManagerList)
|
||||||
item = it.value()
|
|
||||||
tempItem = None
|
tempItem = None
|
||||||
setLastItem = False
|
setLastItem = False
|
||||||
while item is not None:
|
while serviceIterator:
|
||||||
if item.isSelected() and tempItem is None:
|
if serviceIterator.isSelected() and tempItem is None:
|
||||||
setLastItem = True
|
setLastItem = True
|
||||||
item.setSelected(False)
|
serviceIterator.setSelected(False)
|
||||||
if item.isSelected():
|
if serviceIterator.isSelected():
|
||||||
#We are on the first record
|
#We are on the first record
|
||||||
if tempItem is not None:
|
if tempItem is not None:
|
||||||
tempItem.setSelected(True)
|
tempItem.setSelected(True)
|
||||||
item.setSelected(False)
|
serviceIterator.setSelected(False)
|
||||||
else:
|
else:
|
||||||
tempItem = item
|
tempItem = serviceIterator
|
||||||
lastItem = item
|
lastItem = serviceIterator
|
||||||
item = it.next()
|
++serviceIterator
|
||||||
#Top Item was selected so set the last one
|
#Top Item was selected so set the last one
|
||||||
if setLastItem:
|
if setLastItem:
|
||||||
lastItem.setSelected(True)
|
lastItem.setSelected(True)
|
||||||
@ -274,18 +263,17 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Moves the selection down the window
|
Moves the selection down the window
|
||||||
Called by the down arrow
|
Called by the down arrow
|
||||||
"""
|
"""
|
||||||
it = Iter(self.ServiceManagerList)
|
serviceIterator = QTreeWidgetItemIterator(self.ServiceManagerList)
|
||||||
item = it.value()
|
firstItem = serviceIterator
|
||||||
firstItem = item
|
|
||||||
setSelected = False
|
setSelected = False
|
||||||
while item is not None:
|
while serviceIterator:
|
||||||
if setSelected:
|
if setSelected:
|
||||||
setSelected = False
|
setSelected = False
|
||||||
item.setSelected(True)
|
serviceIterator.setSelected(True)
|
||||||
elif item.isSelected():
|
elif serviceIterator.isSelected():
|
||||||
item.setSelected(False)
|
serviceIterator.setSelected(False)
|
||||||
setSelected = True
|
setSelected = True
|
||||||
item = it.next()
|
++serviceIterator
|
||||||
if setSelected:
|
if setSelected:
|
||||||
firstItem.setSelected(True)
|
firstItem.setSelected(True)
|
||||||
|
|
||||||
|
@ -160,9 +160,11 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def onPreviewClick(self):
|
def onPreviewClick(self):
|
||||||
if self.overrideActive:
|
if self.overrideActive:
|
||||||
|
if not self.ListView.selectedIndexes():
|
||||||
|
QtGui.QMessageBox.information(self,
|
||||||
|
self.trUtf8(u'No items selected...'),
|
||||||
|
self.trUtf8(u'You must select one or more items'))
|
||||||
items = self.ListView.selectedIndexes()
|
items = self.ListView.selectedIndexes()
|
||||||
if len(items) == 0:
|
|
||||||
return False
|
|
||||||
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())
|
||||||
|
@ -50,9 +50,9 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
# this next is a class, not an instance of a class - it will
|
# this next is a class, not an instance of a class - it will
|
||||||
# be instanced by the base MediaManagerItem
|
# be instanced by the base MediaManagerItem
|
||||||
self.ListViewWithDnD_class = MediaListView
|
self.ListViewWithDnD_class = MediaListView
|
||||||
self.ServiceItemIconName = u':/media/media_video.png'
|
|
||||||
self.PreviewFunction = self.video_get_preview
|
self.PreviewFunction = self.video_get_preview
|
||||||
MediaManagerItem.__init__(self, parent, icon, title)
|
MediaManagerItem.__init__(self, parent, icon, title)
|
||||||
|
self.ServiceItemIconName = u':/media/media_video.png'
|
||||||
self.MainDisplay = self.parent.live_controller.parent.mainDisplay
|
self.MainDisplay = self.parent.live_controller.parent.mainDisplay
|
||||||
|
|
||||||
def initPluginNameVisible(self):
|
def initPluginNameVisible(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user