forked from openlp/openlp
Clean up Media mediaitem
This commit is contained in:
parent
5a3150a063
commit
fa8c543556
@ -54,8 +54,8 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
self.ListViewWithDnD_class = MediaListView
|
self.ListViewWithDnD_class = MediaListView
|
||||||
self.PreviewFunction = QtGui.QPixmap(u':/media/media_video.png').toImage()
|
self.PreviewFunction = QtGui.QPixmap(u':/media/media_video.png').toImage()
|
||||||
MediaManagerItem.__init__(self, parent, icon, title)
|
MediaManagerItem.__init__(self, parent, icon, title)
|
||||||
|
self.single_service_item = False
|
||||||
self.ServiceItemIconName = u':/media/media_video.png'
|
self.ServiceItemIconName = u':/media/media_video.png'
|
||||||
self.MainDisplay = self.parent.maindisplay
|
|
||||||
|
|
||||||
def initPluginNameVisible(self):
|
def initPluginNameVisible(self):
|
||||||
self.PluginNameVisible = self.trUtf8('Media')
|
self.PluginNameVisible = self.trUtf8('Media')
|
||||||
@ -73,14 +73,13 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
self.hasEditIcon = False
|
self.hasEditIcon = False
|
||||||
|
|
||||||
def generateSlideData(self, service_item, item=None):
|
def generateSlideData(self, service_item, item=None):
|
||||||
items = self.ListView.selectedIndexes()
|
if item is None:
|
||||||
if len(items) > 1:
|
item = self.ListView.currentItem()
|
||||||
|
if item is None:
|
||||||
return False
|
return False
|
||||||
|
filename = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
||||||
service_item.title = unicode(self.trUtf8('Media'))
|
service_item.title = unicode(self.trUtf8('Media'))
|
||||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
||||||
for item in items:
|
|
||||||
bitem = self.ListView.item(item.row())
|
|
||||||
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
|
||||||
frame = u':/media/image_clapperboard.png'
|
frame = u':/media/image_clapperboard.png'
|
||||||
(path, name) = os.path.split(filename)
|
(path, name) = os.path.split(filename)
|
||||||
service_item.add_from_command(path, name, frame)
|
service_item.add_from_command(path, name, frame)
|
||||||
|
Loading…
Reference in New Issue
Block a user