|
|
@ -499,28 +499,36 @@ class MainFrame(wx.Frame): |
|
|
|
self._status_list.remove_row(self._download_list.index(ditem.object_id)) |
|
|
|
self._download_list.remove(ditem.object_id) |
|
|
|
else: |
|
|
|
while index >= 0: |
|
|
|
object_id = self._status_list.GetItemData(index) |
|
|
|
selected_download_item = self._download_list.get_item(object_id) |
|
|
|
if self.opt_manager.options["confirm_deletion"]: |
|
|
|
dlg = wx.MessageDialog(self, "Are you sure you want to remove selected items?", "Delete", wx.YES_NO | wx.ICON_QUESTION) |
|
|
|
result = dlg.ShowModal() == wx.ID_YES |
|
|
|
dlg.Destroy() |
|
|
|
else: |
|
|
|
result = True |
|
|
|
|
|
|
|
if selected_download_item.stage == "Active": |
|
|
|
self._create_popup("Item is active, cannot remove", self.WARNING_LABEL, wx.OK | wx.ICON_EXCLAMATION) |
|
|
|
else: |
|
|
|
#if selected_download_item.stage == "Completed": |
|
|
|
#dlg = wx.MessageDialog(self, "Do you want to remove the files associated with this item?", "Remove files", wx.YES_NO | wx.ICON_QUESTION) |
|
|
|
if result: |
|
|
|
while index >= 0: |
|
|
|
object_id = self._status_list.GetItemData(index) |
|
|
|
selected_download_item = self._download_list.get_item(object_id) |
|
|
|
|
|
|
|
#result = dlg.ShowModal() == wx.ID_YES |
|
|
|
#dlg.Destroy() |
|
|
|
if selected_download_item.stage == "Active": |
|
|
|
self._create_popup("Item is active, cannot remove", self.WARNING_LABEL, wx.OK | wx.ICON_EXCLAMATION) |
|
|
|
else: |
|
|
|
#if selected_download_item.stage == "Completed": |
|
|
|
#dlg = wx.MessageDialog(self, "Do you want to remove the files associated with this item?", "Remove files", wx.YES_NO | wx.ICON_QUESTION) |
|
|
|
|
|
|
|
#if result: |
|
|
|
#for cur_file in selected_download_item.get_files(): |
|
|
|
#remove_file(cur_file) |
|
|
|
#result = dlg.ShowModal() == wx.ID_YES |
|
|
|
#dlg.Destroy() |
|
|
|
|
|
|
|
self._status_list.remove_row(index) |
|
|
|
self._download_list.remove(object_id) |
|
|
|
index -= 1 |
|
|
|
#if result: |
|
|
|
#for cur_file in selected_download_item.get_files(): |
|
|
|
#remove_file(cur_file) |
|
|
|
|
|
|
|
index = self._status_list.get_next_selected(index) |
|
|
|
self._status_list.remove_row(index) |
|
|
|
self._download_list.remove(object_id) |
|
|
|
index -= 1 |
|
|
|
|
|
|
|
index = self._status_list.get_next_selected(index) |
|
|
|
|
|
|
|
self._update_pause_button(None) |
|
|
|
|
|
|
|