diff --git a/deluge/ui/webui/templates/classic/tab_options.html b/deluge/ui/webui/templates/classic/tab_options.html index 5ea736fdf..665500134 100644 --- a/deluge/ui/webui/templates/classic/tab_options.html +++ b/deluge/ui/webui/templates/classic/tab_options.html @@ -2,6 +2,7 @@ $def with (torrent)
+ $_("Download") $:(forms.torrent_options(torrent).as_table(["max_download_speed", "max_upload_speed", "max_connections", "max_upload_slots"])) @@ -9,7 +10,13 @@ $def with (torrent)
+$_("Queue") + + $:(forms.torrent_options(torrent).as_table(["is_auto_managed", "stop_at_ratio", "stop_ratio", "remove_at_ratio"])) +
+
+$_("General") $:(forms.torrent_options(torrent).as_table(["prioritize_first_last", "private"]))
@@ -17,5 +24,7 @@ $def with (torrent)
+ +
diff --git a/deluge/ui/webui/torrent_options.py b/deluge/ui/webui/torrent_options.py index 94934b8b5..b77197fdc 100644 --- a/deluge/ui/webui/torrent_options.py +++ b/deluge/ui/webui/torrent_options.py @@ -18,10 +18,16 @@ class TorrentOptionsForm(forms.Form): _("Maximum Up Speed")) max_connections = forms.DelugeInt(_("Maximum Connections")) max_upload_slots = forms.DelugeInt(_("Maximum Upload Slots")) + #general - prioritize_first_last = forms.CheckBox( - _('Prioritize first and last pieces [TODO!]')) - #private = forms.CheckBox(_('Private')) + prioritize_first_last = forms.CheckBox(_('Prioritize First/Last')) + + #Ratio + is_auto_managed = forms.CheckBox(_('Auto Managed')) + stop_at_ratio = forms.CheckBox(_('Stop seed at ratio')) + stop_ratio = forms.FloatField(min_value=-1) + remove_at_ratio = forms.CheckBox(_('Remove at ratio')) + class torrent_options: @deco.check_session @@ -41,7 +47,13 @@ class torrent_options: aclient.set_torrent_max_download_speed(torrent.id, options['max_download_speed']) aclient.set_torrent_max_upload_slots(torrent.id, options['max_upload_slots']) aclient.set_torrent_max_upload_speed(torrent.id, options['max_upload_speed']) - #aclient.set_torrent_private_flag(torrent.id, options['private']) + + aclient.set_torrent_prioritize_first_last(torrent.id, options['prioritize_first_last']) + aclient.set_torrent_auto_managed(torrent.id, options['is_auto_managed']) + aclient.set_torrent_stop_at_ratio(torrent.id, options['stop_at_ratio']) + aclient.set_torrent_stop_ratio(torrent.id, options['stop_ratio']) + aclient.set_torrent_remove_at_ratio(torrent.id, options['remove_at_ratio']) + aclient.force_call() diff --git a/deluge/ui/webui/webserver_common.py b/deluge/ui/webui/webserver_common.py index 3f43c3120..eb4ce53ae 100644 --- a/deluge/ui/webui/webserver_common.py +++ b/deluge/ui/webui/webserver_common.py @@ -45,6 +45,7 @@ TORRENT_KEYS = ['name', 'total_size', 'num_files', 'num_pieces', 'piece_length', 'max_upload_slots', 'max_download_speed', 'prioritize_first_last', 'private','max_upload_speed','queue','peers', "active_time", "seeding_time", "seed_rank", "is_auto_managed", #stats + "stop_at_ratio","stop_ratio","remove_at_ratio", #ratio 'tracker_host', 'label' #label-plugin ]