From 9723c083e79b697b97dc50f4d48a58a8ae9a6167 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Fri, 4 Apr 2014 19:27:02 +0300 Subject: [PATCH] Add filename on Video column --- youtube_dl_gui/SignalHandler.py | 8 +++++++- youtube_dl_gui/Utils.py | 2 ++ youtube_dl_gui/YoutubeDLGUI.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/youtube_dl_gui/SignalHandler.py b/youtube_dl_gui/SignalHandler.py index 2bedbfa..f1d7df7 100644 --- a/youtube_dl_gui/SignalHandler.py +++ b/youtube_dl_gui/SignalHandler.py @@ -2,7 +2,8 @@ from .Utils import ( remove_spaces, - string_to_array + string_to_array, + get_filename ) class DownloadHandler(): @@ -72,6 +73,8 @@ class IndexDownloadHandler(): self.post_proc() elif pack.header == 'remove': self.remove() + elif pack.header == 'filename': + self.filename(pack.data) def finish(self): self.ListCtrl._write_data(self.index, 4, '') @@ -112,6 +115,9 @@ class IndexDownloadHandler(): def remove(self): self.ListCtrl._write_data(self.index, 5, 'Removing DASH Files') + def filename(self, fl): + self.ListCtrl._write_data(self.index, 0, get_filename(fl)) + class DataPack(): def __init__(self, header, index=-1, data=None): diff --git a/youtube_dl_gui/Utils.py b/youtube_dl_gui/Utils.py index 2024ce1..e37ebab 100644 --- a/youtube_dl_gui/Utils.py +++ b/youtube_dl_gui/Utils.py @@ -72,4 +72,6 @@ def get_icon_path(icon_path, file_path): path = get_path_seperator().join(path) return path +def get_filename(path): + return path.split(get_path_seperator())[-1] diff --git a/youtube_dl_gui/YoutubeDLGUI.py b/youtube_dl_gui/YoutubeDLGUI.py index dbdbd65..2f0d2a7 100644 --- a/youtube_dl_gui/YoutubeDLGUI.py +++ b/youtube_dl_gui/YoutubeDLGUI.py @@ -280,7 +280,7 @@ class ListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin): def __init__(self, parent=None, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0): wx.ListCtrl.__init__(self, parent, id, pos, size, style) ListCtrlAutoWidthMixin.__init__(self) - self.InsertColumn(0, 'URL', width=150) + self.InsertColumn(0, 'Video', width=150) self.InsertColumn(1, 'Size', width=80) self.InsertColumn(2, 'Percent', width=65) self.InsertColumn(3, 'ETA', width=45)