Fix showing remote download/torrent files path in Preferences.

This commit is contained in:
Andrew Resch 2008-03-09 03:31:30 +00:00
parent 5d91c170e4
commit 7a0365fd4a
1 changed files with 29 additions and 4 deletions

View File

@ -246,6 +246,24 @@ class Preferences(component.Component):
"chk_remove_ratio": ("active", self.core_config["remove_seed_at_ratio"])
}
# Change a few widgets if we're connected to a remote host
if not client.is_localhost():
self.glade.get_widget("entry_download_path").show()
self.glade.get_widget("download_path_button").hide()
core_widgets.pop("download_path_button")
core_widgets["entry_download_path"] = ("text", self.core_config["download_location"])
self.glade.get_widget("entry_torrents_path").show()
self.glade.get_widget("torrent_files_button").hide()
core_widgets.pop("torrent_files_button")
core_widgets["entry_torrents_path"] = ("text", self.core_config["torrentfiles_location"])
else:
self.glade.get_widget("entry_download_path").hide()
self.glade.get_widget("download_path_button").show()
self.glade.get_widget("entry_torrents_path").hide()
self.glade.get_widget("torrent_files_button").show()
# Update the widgets accordingly
for key in core_widgets.keys():
modifier = core_widgets[key][0]
@ -380,10 +398,17 @@ class Preferences(component.Component):
self.glade.get_widget("chk_show_dialog").get_active()
new_gtkui_config["focus_add_dialog"] = \
self.glade.get_widget("chk_focus_dialog").get_active()
if client.is_localhost():
new_core_config["download_location"] = \
self.glade.get_widget("download_path_button").get_filename()
new_core_config["torrentfiles_location"] = \
self.glade.get_widget("torrent_files_button").get_filename()
else:
new_core_config["download_location"] = \
self.glade.get_widget("entry_download_path").get_text()
new_core_config["torrentfiles_location"] = \
self.glade.get_widget("entry_torrents_path").get_text()
new_gtkui_config["autoadd_enable"] = \
self.glade.get_widget("chk_autoadd_folder").get_active()
new_gtkui_config["autoadd_location"] = \