Images bulk delete if selected

This commit is contained in:
Tim Bentley 2010-03-25 20:01:15 +00:00
parent b20c29f45c
commit 63aa583942
1 changed files with 11 additions and 10 deletions

View File

@ -114,15 +114,16 @@ class ImageMediaItem(MediaManagerItem):
self.toggleOverrideState) self.toggleOverrideState)
def onDeleteClick(self): def onDeleteClick(self):
item = self.ListView.currentItem() items = self.ListView.selectedIndexes()
if item: if items:
for item in items:
text = self.ListView.item(item.row())
try: try:
os.remove(os.path.join(self.servicePath, unicode(item.text()))) os.remove(os.path.join(self.servicePath, unicode(text.text())))
except: except:
#if not present do not worry #if not present do not worry
pass pass
row = self.ListView.row(item) self.ListView.takeItem(item.row())
self.ListView.takeItem(row)
self.parent.config.set_list(self.ConfigSection, self.getFileList()) self.parent.config.set_list(self.ConfigSection, self.getFileList())
def loadList(self, list): def loadList(self, list):