Browse Source

Add filename on Video column

doc-issue-template
MrS0m30n3 10 years ago
parent
commit
9723c083e7
3 changed files with 10 additions and 2 deletions
  1. 8
      youtube_dl_gui/SignalHandler.py
  2. 2
      youtube_dl_gui/Utils.py
  3. 2
      youtube_dl_gui/YoutubeDLGUI.py

8
youtube_dl_gui/SignalHandler.py

@ -2,7 +2,8 @@
from .Utils import ( from .Utils import (
remove_spaces, remove_spaces,
string_to_array
string_to_array,
get_filename
) )
class DownloadHandler(): class DownloadHandler():
@ -72,6 +73,8 @@ class IndexDownloadHandler():
self.post_proc() self.post_proc()
elif pack.header == 'remove': elif pack.header == 'remove':
self.remove() self.remove()
elif pack.header == 'filename':
self.filename(pack.data)
def finish(self): def finish(self):
self.ListCtrl._write_data(self.index, 4, '') self.ListCtrl._write_data(self.index, 4, '')
@ -112,6 +115,9 @@ class IndexDownloadHandler():
def remove(self): def remove(self):
self.ListCtrl._write_data(self.index, 5, 'Removing DASH Files') 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(): class DataPack():
def __init__(self, header, index=-1, data=None): def __init__(self, header, index=-1, data=None):

2
youtube_dl_gui/Utils.py

@ -72,4 +72,6 @@ def get_icon_path(icon_path, file_path):
path = get_path_seperator().join(path) path = get_path_seperator().join(path)
return path return path
def get_filename(path):
return path.split(get_path_seperator())[-1]

2
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): def __init__(self, parent=None, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0):
wx.ListCtrl.__init__(self, parent, id, pos, size, style) wx.ListCtrl.__init__(self, parent, id, pos, size, style)
ListCtrlAutoWidthMixin.__init__(self) ListCtrlAutoWidthMixin.__init__(self)
self.InsertColumn(0, 'URL', width=150)
self.InsertColumn(0, 'Video', width=150)
self.InsertColumn(1, 'Size', width=80) self.InsertColumn(1, 'Size', width=80)
self.InsertColumn(2, 'Percent', width=65) self.InsertColumn(2, 'Percent', width=65)
self.InsertColumn(3, 'ETA', width=45) self.InsertColumn(3, 'ETA', width=45)

Loading…
Cancel
Save