From 2db5baa2bf0b6dcaf0d8fad17421fca0bb8a4d81 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Fri, 8 Feb 2008 06:53:05 -0500 Subject: [PATCH] Select the location from the detailed window, and not the torrent-file selector window. --- example/delugent/delugent.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/example/delugent/delugent.py b/example/delugent/delugent.py index 71161ff..96d86c1 100755 --- a/example/delugent/delugent.py +++ b/example/delugent/delugent.py @@ -677,9 +677,29 @@ def select_files_from_torrent(filename): # Some options to override the defaults add_paused = create_checkbox("Do not start downloading yet", 'add_paused', local.configs) win.add_widget(add_paused) + full_alloc = create_checkbox("Allocate space for the selected files immediately", 'compact_allocation', local.configs, True) win.add_widget(full_alloc) - # XXX: Change the location to save? + + def change_dl_loc(b, label): + def location_selected(fl, path, file, label): + fl.destroy() + client.set_config({'download_location': path}) + label.set_text("Download to: " + path) + fl = gnt.FileSel() + fl.set_title("Select Location") + fl.set_dirs_only(True) + fl.set_current_location(local.configs['download_location']) + setup_fileselector(fl, fl) + fl.connect('file_selected', location_selected, label) + fl.show() + downloadto = bold_label_and_flag("Download to: " + local.configs['download_location'], gnt.TEXT_FLAG_BOLD) + change = gnt.Button("...") + change.connect('activate', change_dl_loc, downloadto) + box = common.pack_widget(False, [downloadto, change]) + box.set_fill(False) + box.set_alignment(gnt.ALIGN_MID) + win.add_widget(box) win.add_widget(gnt.Line(False)) @@ -728,18 +748,6 @@ def main(): gntui['load_torrent_location'] = path for file in files: select_files_from_torrent(file) - def change_dl_loc(b, label): - def location_selected(fl, path, file, label): - fl.destroy() - client.set_config({'download_location': path}) - label.set_text("Download to: " + path) - fl = gnt.FileSel() - fl.set_title("Select Location") - fl.set_dirs_only(True) - fl.set_current_location(local.configs['download_location']) - setup_fileselector(fl, fl) - fl.connect('file_selected', location_selected, label) - fl.show() win = gnt.Window() win.set_property('vertical', True) @@ -754,14 +762,6 @@ def main(): gnt.set_flag(fl, gnt.WIDGET_NO_BORDER | gnt.WIDGET_NO_SHADOW) fl.draw() - downloadto = bold_label_and_flag("Download to: " + local.configs['download_location'], gnt.TEXT_FLAG_BOLD) - change = gnt.Button("...") - change.connect('activate', change_dl_loc, downloadto) - box = common.pack_widget(False, [downloadto, change]) - box.set_fill(False) - box.set_alignment(gnt.ALIGN_MID) - win.add_widget(box) - win.add_widget(gnt.Line(False)) win.add_widget(fl) win.give_focus_to_child(fl) win.show() -- 2.11.4.GIT