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')
|
||||
|
||||
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')
|
||||
service_item = self.buildServiceItem()
|
||||
if service_item is not None:
|
||||
@ -365,6 +369,10 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
self.parent.preview_controller.addServiceItem(service_item)
|
||||
|
||||
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')
|
||||
service_item = self.buildServiceItem()
|
||||
if service_item is not None:
|
||||
@ -373,6 +381,10 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
self.parent.live_controller.addServiceItem(service_item)
|
||||
|
||||
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')
|
||||
service_item = self.buildServiceItem()
|
||||
if service_item is not None:
|
||||
|
@ -76,7 +76,6 @@ class Renderer(object):
|
||||
self.theme_name = theme.theme_name
|
||||
self._set_theme_font()
|
||||
if theme.background_type == u'image':
|
||||
print theme.background_filename
|
||||
if theme.background_filename is not None:
|
||||
self.set_bg_image(theme.background_filename)
|
||||
|
||||
|
@ -94,15 +94,15 @@ class MainDisplay(DisplayLabel):
|
||||
self.layout.setObjectName(u'layout')
|
||||
self.mediaObject = Phonon.MediaObject(self)
|
||||
self.video = Phonon.VideoWidget()
|
||||
self.video.setVisible(False)
|
||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||
self.video.setFullScreen(True)
|
||||
Phonon.createPath(self.mediaObject, self.video)
|
||||
Phonon.createPath(self.mediaObject, self.audio)
|
||||
self.layout.insertWidget(0, self.video)
|
||||
self.display = QtGui.QLabel(self)
|
||||
self.display.setScaledContents(True)
|
||||
self.layout.insertWidget(0, self.display)
|
||||
self.primary = False
|
||||
self.primary = True
|
||||
self.displayBlank = False
|
||||
self.blankFrame = None
|
||||
self.frame = None
|
||||
@ -272,6 +272,7 @@ class MainDisplay(DisplayLabel):
|
||||
self.firstTime = True
|
||||
self.mediaLoaded = True
|
||||
self.display.hide()
|
||||
self.video.setFullScreen(True)
|
||||
self.mediaObject.play()
|
||||
if self.primary:
|
||||
self.setVisible(True)
|
||||
@ -292,4 +293,5 @@ class MainDisplay(DisplayLabel):
|
||||
self.mediaObject.stop()
|
||||
self.mediaObject.clearQueue()
|
||||
self.mediaLoaded = False
|
||||
self.video.setVisible(False)
|
||||
self.display.show()
|
||||
|
@ -99,17 +99,6 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
||||
mimeData.setText(u'ServiceManager')
|
||||
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):
|
||||
"""
|
||||
@ -173,6 +162,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
QtGui.QAbstractItemView.DragDrop)
|
||||
self.ServiceManagerList.setAlternatingRowColors(True)
|
||||
self.ServiceManagerList.setHeaderHidden(True)
|
||||
self.ServiceManagerList.setExpandsOnDoubleClick(False)
|
||||
self.ServiceManagerList.setObjectName(u'ServiceManagerList')
|
||||
# enable drop
|
||||
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
||||
@ -248,23 +238,22 @@ class ServiceManager(QtGui.QWidget):
|
||||
Moves the selection up the window
|
||||
Called by the up arrow
|
||||
"""
|
||||
it = Iter(self.ServiceManagerList)
|
||||
item = it.value()
|
||||
serviceIterator = QTreeWidgetItemIterator(self.ServiceManagerList)
|
||||
tempItem = None
|
||||
setLastItem = False
|
||||
while item is not None:
|
||||
if item.isSelected() and tempItem is None:
|
||||
while serviceIterator:
|
||||
if serviceIterator.isSelected() and tempItem is None:
|
||||
setLastItem = True
|
||||
item.setSelected(False)
|
||||
if item.isSelected():
|
||||
serviceIterator.setSelected(False)
|
||||
if serviceIterator.isSelected():
|
||||
#We are on the first record
|
||||
if tempItem is not None:
|
||||
tempItem.setSelected(True)
|
||||
item.setSelected(False)
|
||||
serviceIterator.setSelected(False)
|
||||
else:
|
||||
tempItem = item
|
||||
lastItem = item
|
||||
item = it.next()
|
||||
tempItem = serviceIterator
|
||||
lastItem = serviceIterator
|
||||
++serviceIterator
|
||||
#Top Item was selected so set the last one
|
||||
if setLastItem:
|
||||
lastItem.setSelected(True)
|
||||
@ -274,18 +263,17 @@ class ServiceManager(QtGui.QWidget):
|
||||
Moves the selection down the window
|
||||
Called by the down arrow
|
||||
"""
|
||||
it = Iter(self.ServiceManagerList)
|
||||
item = it.value()
|
||||
firstItem = item
|
||||
serviceIterator = QTreeWidgetItemIterator(self.ServiceManagerList)
|
||||
firstItem = serviceIterator
|
||||
setSelected = False
|
||||
while item is not None:
|
||||
while serviceIterator:
|
||||
if setSelected:
|
||||
setSelected = False
|
||||
item.setSelected(True)
|
||||
elif item.isSelected():
|
||||
item.setSelected(False)
|
||||
serviceIterator.setSelected(True)
|
||||
elif serviceIterator.isSelected():
|
||||
serviceIterator.setSelected(False)
|
||||
setSelected = True
|
||||
item = it.next()
|
||||
++serviceIterator
|
||||
if setSelected:
|
||||
firstItem.setSelected(True)
|
||||
|
||||
|
@ -160,9 +160,11 @@ class ImageMediaItem(MediaManagerItem):
|
||||
|
||||
def onPreviewClick(self):
|
||||
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()
|
||||
if len(items) == 0:
|
||||
return False
|
||||
for item in items:
|
||||
bitem = self.ListView.item(item.row())
|
||||
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
|
||||
# be instanced by the base MediaManagerItem
|
||||
self.ListViewWithDnD_class = MediaListView
|
||||
self.ServiceItemIconName = u':/media/media_video.png'
|
||||
self.PreviewFunction = self.video_get_preview
|
||||
MediaManagerItem.__init__(self, parent, icon, title)
|
||||
self.ServiceItemIconName = u':/media/media_video.png'
|
||||
self.MainDisplay = self.parent.live_controller.parent.mainDisplay
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
|
Loading…
Reference in New Issue
Block a user