diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index 55610b9e6..ca2410881 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -88,7 +88,8 @@ class AddTorrentDialog(component.Component): "on_button_add_clicked": self._on_button_add_clicked, "on_button_apply_clicked": self._on_button_apply_clicked, "on_button_revert_clicked": self._on_button_revert_clicked, - "on_alocation_toggled": self._on_alocation_toggled + "on_alocation_toggled": self._on_alocation_toggled, + "on_chk_move_completed_toggled": self._on_chk_move_completed_toggled }) self.torrent_liststore = gtk.ListStore(str, str, str) @@ -153,7 +154,9 @@ class AddTorrentDialog(component.Component): "prioritize_first_last_pieces", "sequential_download", "download_location", - "add_paused" + "add_paused", + "move_completed", + "move_completed_path" ] self.core_config = {} @@ -169,9 +172,13 @@ class AddTorrentDialog(component.Component): if client.is_localhost(): self.builder.get_object("button_location").show() self.builder.get_object("entry_download_path").hide() + self.builder.get_object("button_move_completed_location").show() + self.builder.get_object("entry_move_completed_path").hide() else: self.builder.get_object("button_location").hide() self.builder.get_object("entry_download_path").show() + self.builder.get_object("button_move_completed_location").hide() + self.builder.get_object("entry_move_completed_path").show() self.dialog.set_transient_for(component.get("MainWindow").window) self.dialog.present() @@ -376,9 +383,13 @@ class AddTorrentDialog(component.Component): if client.is_localhost(): self.builder.get_object("button_location").set_current_folder( options["download_location"]) + self.builder.get_object("button_move_completed_location").set_current_folder( + options["move_completed_path"]) else: self.builder.get_object("entry_download_path").set_text( options["download_location"]) + self.builder.get_object("entry_move_completed_path").set_text( + options["move_completed_path"]) self.builder.get_object("radio_full").set_active( not options["compact_allocation"]) @@ -419,9 +430,13 @@ class AddTorrentDialog(component.Component): if client.is_localhost(): options["download_location"] = \ self.builder.get_object("button_location").get_filename() + options["move_completed_path"] = \ + self.builder.get_object("button_move_completed_location").get_filename() else: options["download_location"] = \ self.builder.get_object("entry_download_path").get_text() + options["move_completed_path"] = \ + self.builder.get_object("entry_move_completed_path").get_text() options["compact_allocation"] = \ self.builder.get_object("radio_compact").get_active() @@ -447,6 +462,8 @@ class AddTorrentDialog(component.Component): options["sequential_download"] = \ self.builder.get_object("radio_full").get_active() and \ self.builder.get_object("chk_sequential_download").get_active() or False + options["move_completed"] = \ + self.builder.get_object("chk_move_completed").get_active() self.options[torrent_id] = options @@ -474,9 +491,13 @@ class AddTorrentDialog(component.Component): if client.is_localhost(): self.builder.get_object("button_location").set_current_folder( self.core_config["download_location"]) + self.builder.get_object("button_move_completed_location").set_current_folder( + self.core_config["move_completed_path"]) else: self.builder.get_object("entry_download_path").set_text( self.core_config["download_location"]) + self.builder.get_object("entry_move_completed_path").set_text( + self.core_config["move_completed_path"]) self.builder.get_object("radio_compact").set_active( self.core_config["compact_allocation"]) @@ -496,6 +517,8 @@ class AddTorrentDialog(component.Component): self.core_config["prioritize_first_last_pieces"]) self.builder.get_object("chk_sequential_download").set_active( self.core_config["sequential_download"]) + self.builder.get_object("chk_move_completed").set_active( + self.core_config["move_completed"]) def get_file_priorities(self, torrent_id): # A list of priorities @@ -826,6 +849,11 @@ class AddTorrentDialog(component.Component): del self.options[model.get_value(row, 0)] self.set_default_options() + def _on_chk_move_completed_toggled(self, widget): + value = widget.get_active() + self.builder.get_object("button_move_completed_location").set_sensitive(value) + self.builder.get_object("entry_move_completed_path").set_sensitive(value) + def _on_delete_event(self, widget, event): self.hide() return True diff --git a/deluge/ui/gtkui/glade/add_torrent_dialog.ui b/deluge/ui/gtkui/glade/add_torrent_dialog.ui index f6844d580..967e9bb71 100644 --- a/deluge/ui/gtkui/glade/add_torrent_dialog.ui +++ b/deluge/ui/gtkui/glade/add_torrent_dialog.ui @@ -1,4 +1,4 @@ - + @@ -27,7 +27,6 @@ 10 - False 5 Add Torrents center-on-parent @@ -36,7 +35,6 @@ True - False 2 @@ -45,20 +43,17 @@ True - False 0 none True - False 5 12 12 True - False True @@ -76,33 +71,27 @@ - True - True 0 True - False center True True True - False - + True - False 2 4 True - False gtk-open 1 @@ -115,7 +104,6 @@ True - False _File True @@ -139,18 +127,15 @@ True True True - False - + True - False 2 4 True - False gtk-network 1 @@ -163,7 +148,6 @@ True - False _URL True @@ -187,18 +171,15 @@ True True True - False - + True - False 2 4 True - False gtk-revert-to-saved 1 @@ -211,7 +192,6 @@ True - False Info_hash True @@ -235,17 +215,14 @@ True True True - False - + True - False 4 True - False gtk-remove @@ -257,7 +234,6 @@ True - False _Remove True @@ -290,7 +266,6 @@ True - False <b>Torrents</b> True @@ -327,29 +302,22 @@ True - False True - False gtk-open - True - True 0 True - False Fi_les True - True - True 5 1 @@ -362,35 +330,28 @@ True - False 5 5 True - False 0 none True - False 5 5 5 True - False - False select-folder Select A Folder - True - True 0 @@ -398,14 +359,10 @@ True True - False - False True True - True - True 1 @@ -416,7 +373,6 @@ True - False <b>Download Location</b> True @@ -428,37 +384,99 @@ 0 + + + True + 0 + none + + + True + 5 + 5 + 5 + + + True + + + True + True + False + True + + + + False + 0 + + + + + True + select-folder + Select A Folder + + + 1 + + + + + True + + True + True + True + + + 2 + + + + + + + + + True + <b>Move Complete Location</b> + True + + + + + False + False + 1 + + True - False 10 True - False 0 none True - False 5 12 True - False Full True True False - False True True - + False @@ -472,10 +490,9 @@ True True False - False True radio_full - + False @@ -490,7 +507,6 @@ True - False <b>Allocation</b> True @@ -505,19 +521,16 @@ True - False 0 none True - False 5 12 True - False 4 2 10 @@ -526,8 +539,6 @@ True True 1 - False - False True True adjustment1 @@ -542,7 +553,6 @@ True - False 0 Max Down Speed: @@ -554,7 +564,6 @@ True - False 0 Max Up Speed: @@ -568,7 +577,6 @@ True - False 0 Max Connections: @@ -582,7 +590,6 @@ True - False 0 Max Upload Slots: @@ -598,8 +605,6 @@ True True 1 - False - False True True adjustment2 @@ -619,8 +624,6 @@ True True 1 - False - False True True adjustment3 @@ -639,8 +642,6 @@ True True 1 - False - False True True adjustment4 @@ -661,7 +662,6 @@ True - False <b>Bandwidth</b> True @@ -676,26 +676,22 @@ True - False 0 none True - False 5 12 True - False Prioritize First/Last Pieces True True False - False True @@ -717,7 +713,6 @@ sequence instead of rarest first. Enabling sequential download will affect the piece distribution negatively in the swarm. It should be used sparingly. - False True @@ -732,7 +727,6 @@ used sparingly. True True False - False True True @@ -749,7 +743,6 @@ used sparingly. True - False <b>General</b> True @@ -765,33 +758,75 @@ used sparingly. False False - 1 + 2 True - False 5 + + + True + + + True + True + True + + + + True + + + True + gtk-revert-to-saved + + + False + False + 0 + + + + + True + Revert To Defaults + + + False + False + 5 + 1 + + + + + + + + + False + False + end + 1 + + True - False True True True - False - + True - False True - False 1 gtk-apply @@ -804,7 +839,6 @@ used sparingly. True - False 0 Apply To All @@ -827,63 +861,11 @@ used sparingly. 0 - - - True - False - - - True - True - True - False - - - - True - False - - - True - False - gtk-revert-to-saved - - - False - False - 0 - - - - - True - False - Revert To Defaults - - - False - False - 5 - 1 - - - - - - - - - False - False - end - 1 - - False False - 2 + 3 @@ -894,29 +876,22 @@ used sparingly. True - False True - False gtk-properties - True - True 0 True - False _Options True - True - True 5 1 @@ -935,15 +910,12 @@ used sparingly. - True - True 0 True - False end @@ -951,9 +923,8 @@ used sparingly. True True True - False True - + False @@ -967,9 +938,8 @@ used sparingly. True True True - False True - + False @@ -980,7 +950,6 @@ used sparingly. False - True end 1