From b89f320d2603ccd7b41aa52ffe42a88ba25a9a58 Mon Sep 17 00:00:00 2001 From: Alex Dedul Date: Wed, 15 Aug 2007 03:13:04 +0000 Subject: [PATCH] Remember last chose download directory when "Ask where to save each download" is selected. --- src/dialogs.py | 9 ++++++--- src/pref.py | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index 145e989a4..27eeec08f 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -487,8 +487,8 @@ def show_file_open_dialog(parent=None, title=None): f1 = gtk.FileFilter() f1.set_name(_("All files")) f1.add_pattern("*") - loadpref = pref.Preferences() - chooser.set_current_folder(loadpref.get("default_load_path")) + config = pref.Preferences() + chooser.set_current_folder(config.get("open_torrent_dialog_path")) chooser.add_filter(f1) chooser.set_select_multiple(True) @@ -498,7 +498,7 @@ def show_file_open_dialog(parent=None, title=None): response = chooser.run() if response == gtk.RESPONSE_OK: result = chooser.get_filenames() - loadpref.set("default_load_path", chooser.get_current_folder()) + config.set("open_torrent_dialog_path", chooser.get_current_folder()) else: result = None chooser.destroy() @@ -511,8 +511,11 @@ def show_directory_chooser_dialog(parent=None, title=None): buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK)) chooser.set_icon_from_file(common.get_pixmap("deluge32.png")) chooser.set_property("skip-taskbar-hint", True) + config = pref.Preferences() + chooser.set_current_folder(config.get("choose_download_directory_dialog_path")) if chooser.run() == gtk.RESPONSE_OK: result = chooser.get_filename() + config.set("choose_download_directory_dialog_path", result) else: result = None chooser.destroy() diff --git a/src/pref.py b/src/pref.py index 12570e60c..759a0cbb0 100644 --- a/src/pref.py +++ b/src/pref.py @@ -51,7 +51,8 @@ DEFAULT_PREFS = { "queue_above_completed" : False, "clear_max_ratio_torrents" : False, "default_download_path" : os.path.expanduser("~/"), - "default_load_path" : os.path.expanduser("~/"), + "open_torrent_dialog_path" : os.path.expanduser("~/"), + "choose_download_directory_dialog_path": os.path.expanduser("~/"), "default_finished_path" : os.path.expanduser("~/"), "enable_move_completed" : False, "enable_dht" : True,