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,12 +170,9 @@ 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', 'No item selected'),
translate('ImagePlugin.MediaItem', translate('ImagePlugin.MediaItem',
'You must select one item')) 'You must select an item to process.')):
return
item = self.buildServiceItem() item = self.buildServiceItem()
item.render() item.render()
self.parent.live_controller.displayManager. \ self.parent.live_controller.displayManager. \

View File

@ -106,17 +106,11 @@ 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',
'You must select one item'))
return
item = self.ListView.currentItem() item = self.ListView.currentItem()
if item is None:
return False
filename = unicode(item.data(QtCore.Qt.UserRole).toString()) filename = unicode(item.data(QtCore.Qt.UserRole).toString())
print filename
self.parent.live_controller.displayManager.displayVideo(filename) self.parent.live_controller.displayManager.displayVideo(filename)
# items = self.ListView.selectedIndexes() # items = self.ListView.selectedIndexes()
# for item in items: # for item in items: