From 3d2c913deeb7d443b8443126af0dcb99a6d929a3 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Thu, 2 Jul 2015 15:23:08 +0300 Subject: [PATCH] wxDirDialog changeable directory --- youtube_dl_gui/optionsframe.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl_gui/optionsframe.py b/youtube_dl_gui/optionsframe.py index 297a4c7..829545b 100644 --- a/youtube_dl_gui/optionsframe.py +++ b/youtube_dl_gui/optionsframe.py @@ -267,14 +267,14 @@ class TabPanel(wx.Panel): return combobox - def create_dirdialog(self, label): + def create_dirdialog(self, label, path=''): """Creates and returns an wx.DirDialog. Args: label (string): wx.DirDialog widget title. """ - dlg = wx.DirDialog(self, label) + dlg = wx.DirDialog(self, label, path, wx.DD_CHANGE_DIR) return dlg def create_radiobutton(self, label, event_handler=None, style=None): @@ -1328,7 +1328,7 @@ class GeneralTab(TabPanel): def _on_open(self, event): """Event handler of the self.open_button. """ - dlg = self.create_dirdialog(self.PICK_DIR_LABEL) + dlg = self.create_dirdialog(self.PICK_DIR_LABEL, self.savepath_box.GetValue()) if dlg.ShowModal() == wx.ID_OK: self.savepath_box.SetValue(dlg.GetPath())