Update missing checks

This commit is contained in:
Tim Bentley 2010-06-30 18:05:12 +01:00
parent 8b5931d50c
commit 9ebdc1e2d3
2 changed files with 13 additions and 22 deletions

View File

@ -170,16 +170,13 @@ class ImageMediaItem(MediaManagerItem):
return False return False
def onReplaceClick(self): def onReplaceClick(self):
if not self.ListView.selectedIndexes(): if check_item_selected(self.ListView,
QtGui.QMessageBox.information(self, translate('ImagePlugin.MediaItem',
translate('ImagePlugin.MediaItem', 'No item selected'), 'You must select an item to process.')):
translate('ImagePlugin.MediaItem', item = self.buildServiceItem()
'You must select one item')) item.render()
return self.parent.live_controller.displayManager. \
item = self.buildServiceItem() displayImage(item.get_rendered_frame(0)[u'display'])
item.render()
self.parent.live_controller.displayManager. \
displayImage(item.get_rendered_frame(0)[u'display'])
def onPreviewClick(self): def onPreviewClick(self):

View File

@ -106,18 +106,12 @@ class MediaMediaItem(MediaManagerItem):
# Receiver.send_message(u'videodisplay_stop') # Receiver.send_message(u'videodisplay_stop')
# else: # else:
# self.background = True # self.background = True
if not self.ListView.selectedIndexes(): if check_item_selected(self.ListView,
QtGui.QMessageBox.information(self, translate('ImagePlugin.MediaItem',
translate('MediaPlugin.MediaItem', 'No item selected'), 'You must select an item to process.')):
translate('MediaPlugin.MediaItem', item = self.ListView.currentItem()
'You must select one item')) filename = unicode(item.data(QtCore.Qt.UserRole).toString())
return self.parent.live_controller.displayManager.displayVideo(filename)
item = self.ListView.currentItem()
if item is None:
return False
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
print filename
self.parent.live_controller.displayManager.displayVideo(filename)
# items = self.ListView.selectedIndexes() # items = self.ListView.selectedIndexes()
# for item in items: # for item in items:
# bitem = self.ListView.item(item.row()) # bitem = self.ListView.item(item.row())