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
def onReplaceClick(self):
if not self.ListView.selectedIndexes():
QtGui.QMessageBox.information(self,
translate('ImagePlugin.MediaItem', 'No item selected'),
translate('ImagePlugin.MediaItem',
'You must select one item'))
return
item = self.buildServiceItem()
item.render()
self.parent.live_controller.displayManager. \
displayImage(item.get_rendered_frame(0)[u'display'])
if check_item_selected(self.ListView,
translate('ImagePlugin.MediaItem',
'You must select an item to process.')):
item = self.buildServiceItem()
item.render()
self.parent.live_controller.displayManager. \
displayImage(item.get_rendered_frame(0)[u'display'])
def onPreviewClick(self):

View File

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