From 849b579316421d279f56de05e8aae44c365af633 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 8 Mar 2009 20:14:42 +0000 Subject: [PATCH] Label: Fix setting 'Move on completed' folder when connected to a remote daemon --- .../label/label/data/label_options.glade | 37 ++++++++++++------- .../plugins/label/label/gtkui/sidebar_menu.py | 15 +++++++- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/deluge/plugins/label/label/data/label_options.glade b/deluge/plugins/label/label/data/label_options.glade index 18a66e233..0316d2205 100644 --- a/deluge/plugins/label/label/data/label_options.glade +++ b/deluge/plugins/label/label/data/label_options.glade @@ -1,6 +1,6 @@ - + 5 @@ -446,18 +446,6 @@ True 3 2 - - - True - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - - - 2 - 1 - 2 - GTK_FILL - - True @@ -482,6 +470,29 @@ 3 + + + True + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + + + 1 + 2 + GTK_FILL + + + + + True + + + 1 + 2 + 1 + 2 + GTK_FILL + + diff --git a/deluge/plugins/label/label/gtkui/sidebar_menu.py b/deluge/plugins/label/label/gtkui/sidebar_menu.py index 9b0ed0015..50ae5f31e 100644 --- a/deluge/plugins/label/label/gtkui/sidebar_menu.py +++ b/deluge/plugins/label/label/gtkui/sidebar_menu.py @@ -191,7 +191,14 @@ class OptionsDialog(object): for id in self.chk_ids: self.glade.get_widget(id).set_active(bool(options[id])) - self.glade.get_widget("move_completed_path").set_filename(options["move_completed_path"]) + if client.is_localhost(): + self.glade.get_widget("move_completed_path").set_filename(options["move_completed_path"]) + self.glade.get_widget("move_completed_path").show() + self.glade.get_widget("move_completed_path_entry").hide() + else: + self.glade.get_widget("move_completed_path_entry").set_text(options["move_completed_path"]) + self.glade.get_widget("move_completed_path_entry").show() + self.glade.get_widget("move_completed_path").hide() self.glade.get_widget("auto_add_trackers").get_buffer().set_text("\n".join(options["auto_add_trackers"])) @@ -206,7 +213,11 @@ class OptionsDialog(object): for id in self.chk_ids: options[id] = self.glade.get_widget(id).get_active() - options["move_completed_path"] = self.glade.get_widget("move_completed_path").get_filename() + if client.is_localhost(): + options["move_completed_path"] = self.glade.get_widget("move_completed_path").get_filename() + else: + options["move_completed_path"] = self.glade.get_widget("move_completed_path_entry").get_text() + buff = self.glade.get_widget("auto_add_trackers").get_buffer() #sometimes I hate gtk... tracker_lst = buff.get_text(buff.get_start_iter(), buff.get_end_iter()).strip().split("\n") options["auto_add_trackers"] = [x for x in tracker_lst if x] #filter out empty lines.