Browse Source

Add 'Re-enter' option

doc-issue-template
MrS0m30n3 8 years ago
parent
commit
621c391275
1 changed files with 22 additions and 1 deletions
  1. 23
      youtube_dl_gui/mainframe.py

23
youtube_dl_gui/mainframe.py

@ -234,7 +234,8 @@ class MainFrame(wx.Frame):
statuslist_menu_data = (
(_("Get URL"), self._on_geturl),
(_("Get command"), self._on_getcmd),
(_("Open destination"), self._on_open_dest)
(_("Open destination"), self._on_open_dest),
(_("Re-enter"), self._on_reneter)
)
# Create options frame
@ -339,6 +340,26 @@ class MainFrame(wx.Frame):
self.PopupMenu(self._statuslist_menu)
def _on_reneter(self, event):
selected = self._status_list.get_selected()
if selected != -1:
object_id = self._status_list.GetItemData(selected)
download_item = self._download_list.get_item(object_id)
if download_item.stage != "Active":
self._status_list.remove_row(selected)
self._download_list.remove(object_id)
options = self._options_parser.parse(self.opt_manager.options)
download_item = DownloadItem(download_item.url, options)
download_item.path = self.opt_manager.options["save_path"]
if not self._download_list.has_item(download_item.object_id):
self._status_list.bind_item(download_item)
self._download_list.insert(download_item)
def _on_open_dest(self, event):
selected = self._status_list.get_selected()

Loading…
Cancel
Save