Images bulk delete if selected

This commit is contained in:
Tim Bentley 2010-03-25 20:01:15 +00:00
parent b20c29f45c
commit 63aa583942

View File

@ -114,16 +114,17 @@ 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:
try: for item in items:
os.remove(os.path.join(self.servicePath, unicode(item.text()))) text = self.ListView.item(item.row())
except: try:
#if not present do not worry os.remove(os.path.join(self.servicePath, unicode(text.text())))
pass except:
row = self.ListView.row(item) #if not present do not worry
self.ListView.takeItem(row) pass
self.parent.config.set_list(self.ConfigSection, self.getFileList()) self.ListView.takeItem(item.row())
self.parent.config.set_list(self.ConfigSection, self.getFileList())
def loadList(self, list): def loadList(self, list):
for file in list: for file in list: