mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-13 04:54:23 +00:00
move_completed_to
This commit is contained in:
parent
3883386fcc
commit
173ad0226d
@ -64,19 +64,20 @@ CONFIG_DEFAULTS = {
|
|||||||
CORE_OPTIONS = ["hide_zero_hits", "gtk_alfa", "show_states", "show_trackers", "show_labels","auto_add","auto_add_trackers"]
|
CORE_OPTIONS = ["hide_zero_hits", "gtk_alfa", "show_states", "show_trackers", "show_labels","auto_add","auto_add_trackers"]
|
||||||
|
|
||||||
OPTIONS_DEFAULTS = {
|
OPTIONS_DEFAULTS = {
|
||||||
|
"apply_max":False,
|
||||||
"max_download_speed":-1,
|
"max_download_speed":-1,
|
||||||
"max_upload_speed":-1,
|
"max_upload_speed":-1,
|
||||||
"max_connections":-1,
|
"max_connections":-1,
|
||||||
"max_upload_slots":-1,
|
"max_upload_slots":-1,
|
||||||
"prioritize_first_last":False,
|
"prioritize_first_last":False,
|
||||||
"apply_max":False,
|
|
||||||
"move_completed":False,
|
|
||||||
"move_completed_path":"",
|
|
||||||
"apply_queue":False,
|
"apply_queue":False,
|
||||||
"is_auto_managed":False,
|
"is_auto_managed":False,
|
||||||
"stop_at_ratio":False,
|
"stop_at_ratio":False,
|
||||||
"stop_ratio":2.0,
|
"stop_ratio":2.0,
|
||||||
"remove_at_ratio":False,
|
"remove_at_ratio":False,
|
||||||
|
"apply_move_completed":False,
|
||||||
|
"move_completed":False,
|
||||||
|
"move_completed_path":"",
|
||||||
"auto_add":False,
|
"auto_add":False,
|
||||||
"auto_add_trackers":[],
|
"auto_add_trackers":[],
|
||||||
}
|
}
|
||||||
@ -315,6 +316,9 @@ class Core(CorePluginBase):
|
|||||||
options = self.labels[label_id]
|
options = self.labels[label_id]
|
||||||
torrent = self.torrents[torrent_id]
|
torrent = self.torrents[torrent_id]
|
||||||
|
|
||||||
|
if not options["move_completed_path"]:
|
||||||
|
options["move_completed_path"] = "" #no None.
|
||||||
|
|
||||||
if options["apply_max"]:
|
if options["apply_max"]:
|
||||||
torrent.set_max_download_speed(options["max_download_speed"])
|
torrent.set_max_download_speed(options["max_download_speed"])
|
||||||
torrent.set_max_upload_speed(options["max_upload_speed"])
|
torrent.set_max_upload_speed(options["max_upload_speed"])
|
||||||
@ -328,9 +332,9 @@ class Core(CorePluginBase):
|
|||||||
torrent.set_stop_ratio(options['stop_ratio'])
|
torrent.set_stop_ratio(options['stop_ratio'])
|
||||||
torrent.set_remove_at_ratio(options['remove_at_ratio'])
|
torrent.set_remove_at_ratio(options['remove_at_ratio'])
|
||||||
|
|
||||||
if options["move_completed"]:
|
if options["apply_move_completed"]:
|
||||||
#todo...
|
torrent.set_move_on_completed(options["move_completed"])
|
||||||
pass
|
torrent.set_move_on_completed_path(options["move_completed_path"])
|
||||||
|
|
||||||
def _has_auto_match(self, torrent ,label_options):
|
def _has_auto_match(self, torrent ,label_options):
|
||||||
"match for auto_add fields"
|
"match for auto_add fields"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||||
<!--Generated with glade3 3.4.5 on Tue Aug 5 21:50:51 2008 -->
|
<!--Generated with glade3 3.4.5 on Wed Aug 13 21:59:54 2008 -->
|
||||||
<glade-interface>
|
<glade-interface>
|
||||||
<widget class="GtkDialog" id="dlg_label_options">
|
<widget class="GtkDialog" id="dlg_label_options">
|
||||||
<property name="border_width">5</property>
|
<property name="border_width">5</property>
|
||||||
@ -54,103 +54,41 @@
|
|||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label1">
|
<widget class="GtkLabel" id="label14">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">3</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="right_attach">4</property>
|
<property name="top_attach">4</property>
|
||||||
<property name="y_options">GTK_FILL</property>
|
<property name="bottom_attach">5</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkSpinButton" id="max_upload_speed">
|
<widget class="GtkSpinButton" id="max_connections">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="adjustment">-1 -1 9999 1 10 10</property>
|
<property name="adjustment">-1 -1 9999 1 10 10</property>
|
||||||
|
<property name="numeric">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="bottom_attach">4</property>
|
||||||
<property name="x_options"></property>
|
<property name="x_options"></property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"></property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label24">
|
<widget class="GtkLabel" id="label2">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">Kib/s</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkSpinButton" id="max_download_speed">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="adjustment">-1 -1 9999 1 10 10</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="x_options"></property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label6">
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Upload Slots: </property>
|
<property name="label" translatable="yes">Connections:</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="bottom_attach">3</property>
|
<property name="bottom_attach">4</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label5">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">Upload Speed:</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label4">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">Download Speed:</property>
|
|
||||||
<property name="use_markup">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label3">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">Kib/s</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options">GTK_FILL</property>
|
<property name="y_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -172,43 +110,105 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label2">
|
<widget class="GtkLabel" id="label3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="label" translatable="yes">Kib/s</property>
|
||||||
<property name="label" translatable="yes">Connections:</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="top_attach">3</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="bottom_attach">4</property>
|
<property name="right_attach">3</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options">GTK_FILL</property>
|
<property name="y_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkSpinButton" id="max_connections">
|
<widget class="GtkLabel" id="label4">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Download Speed:</property>
|
||||||
|
<property name="use_markup">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label5">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Upload Speed:</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label6">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Upload Slots: </property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
<property name="bottom_attach">3</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkSpinButton" id="max_download_speed">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="adjustment">-1 -1 9999 1 10 10</property>
|
<property name="adjustment">-1 -1 9999 1 10 10</property>
|
||||||
<property name="numeric">True</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">3</property>
|
|
||||||
<property name="bottom_attach">4</property>
|
|
||||||
<property name="x_options"></property>
|
<property name="x_options"></property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"></property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label14">
|
<widget class="GtkLabel" id="label24">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Kib/s</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkSpinButton" id="max_upload_speed">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="adjustment">-1 -1 9999 1 10 10</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="x_options"></property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="right_attach">2</property>
|
<property name="left_attach">3</property>
|
||||||
<property name="top_attach">4</property>
|
<property name="right_attach">4</property>
|
||||||
<property name="bottom_attach">5</property>
|
<property name="y_options">GTK_FILL</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
@ -269,58 +269,14 @@
|
|||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label16">
|
<widget class="GtkLabel" id="label13">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="right_attach">3</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="bottom_attach">4</property>
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkCheckButton" id="is_auto_managed">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="label" translatable="yes">Auto Managed</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="draw_indicator">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkCheckButton" id="stop_at_ratio">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="label" translatable="yes">Stop seed at ratio:</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="draw_indicator">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkCheckButton" id="remove_at_ratio">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="label" translatable="yes">Remove at ratio</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="draw_indicator">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="top_attach">2</property>
|
|
||||||
<property name="bottom_attach">3</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@ -340,14 +296,58 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label13">
|
<widget class="GtkCheckButton" id="remove_at_ratio">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Remove at ratio</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
<property name="bottom_attach">3</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkCheckButton" id="stop_at_ratio">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Stop seed at ratio:</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkCheckButton" id="is_auto_managed">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Auto Managed</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label16">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="right_attach">2</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="right_attach">3</property>
|
||||||
<property name="bottom_attach">4</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
@ -397,40 +397,15 @@
|
|||||||
<property name="n_rows">3</property>
|
<property name="n_rows">3</property>
|
||||||
<property name="n_columns">2</property>
|
<property name="n_columns">2</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label11">
|
<widget class="GtkLabel" id="label9">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">warning : not effective yet</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="bottom_attach">3</property>
|
<property name="bottom_attach">3</property>
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<widget class="GtkFileChooserButton" id="move_completed_path">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label19">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkCheckButton" id="move_completed">
|
<widget class="GtkCheckButton" id="move_completed">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@ -439,6 +414,36 @@
|
|||||||
<property name="response_id">0</property>
|
<property name="response_id">0</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkFileChooserButton" id="move_completed_path">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="y_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkCheckButton" id="apply_move_completed">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Apply move location settings:</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="type">label_item</property>
|
<property name="type">label_item</property>
|
||||||
</packing>
|
</packing>
|
||||||
|
@ -130,14 +130,18 @@ class AddDialog(object):
|
|||||||
|
|
||||||
class OptionsDialog(object):
|
class OptionsDialog(object):
|
||||||
spin_ids = ["max_download_speed", "max_upload_speed", "max_upload_slots", "max_connections", "stop_ratio"]
|
spin_ids = ["max_download_speed", "max_upload_speed", "max_upload_slots", "max_connections", "stop_ratio"]
|
||||||
chk_ids = ["apply_max", "apply_queue", "stop_at_ratio", "apply_queue", "remove_at_ratio", "move_completed", "is_auto_managed", "auto_add"]
|
chk_ids = ["apply_max", "apply_queue", "stop_at_ratio", "apply_queue", "remove_at_ratio",
|
||||||
sensitive_groups = { #keys must be checkboxes , value-list is to be enabled on checked.
|
"apply_move_completed", "move_completed", "is_auto_managed", "auto_add"]
|
||||||
"apply_max": ["max_download_speed", "max_upload_speed", "max_upload_slots", "max_connections"],
|
|
||||||
"apply_queue":["is_auto_managed", "remove_at_ratio", "stop_at_ratio", "stop_ratio"],
|
#list of tuples, because order matters when nesting.
|
||||||
#"stop_at_ratio":["stop_at_ratio","remove_at_ratio"], #nested from apply_queue, will probably cause bugs.
|
sensitive_groups = [
|
||||||
"move_completed":["move_completed_path"],
|
("apply_max", ["max_download_speed", "max_upload_speed", "max_upload_slots", "max_connections"]),
|
||||||
"auto_add":["auto_add_trackers"]
|
("apply_queue", ["is_auto_managed", "stop_at_ratio"]),
|
||||||
}
|
("stop_at_ratio", ["remove_at_ratio", "stop_ratio"]), #nested
|
||||||
|
("apply_move_completed", ["move_completed"]),
|
||||||
|
("move_completed", ["move_completed_path"]), #nested
|
||||||
|
("auto_add", ["auto_add_trackers"])
|
||||||
|
]
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
@ -151,7 +155,7 @@ class OptionsDialog(object):
|
|||||||
"on_options_cancel":self.on_cancel,
|
"on_options_cancel":self.on_cancel,
|
||||||
})
|
})
|
||||||
|
|
||||||
for chk_id in self.sensitive_groups:
|
for chk_id, group in self.sensitive_groups:
|
||||||
log.debug(chk_id)
|
log.debug(chk_id)
|
||||||
chk = self.glade.get_widget(chk_id)
|
chk = self.glade.get_widget(chk_id)
|
||||||
chk.connect("toggled",self.apply_sensitivity)
|
chk.connect("toggled",self.apply_sensitivity)
|
||||||
@ -193,16 +197,14 @@ class OptionsDialog(object):
|
|||||||
self.dialog.destroy()
|
self.dialog.destroy()
|
||||||
|
|
||||||
def apply_sensitivity(self, event=None):
|
def apply_sensitivity(self, event=None):
|
||||||
|
nested = []
|
||||||
log.debug("apply-sensitivity")
|
log.debug("apply-sensitivity")
|
||||||
for chk_id , sensitive_list in self.sensitive_groups.iteritems():
|
for chk_id , sensitive_list in self.sensitive_groups:
|
||||||
sens = self.glade.get_widget(chk_id).get_active()
|
chk = self.glade.get_widget(chk_id)
|
||||||
|
sens = chk.get_active() and chk.get_property("sensitive")
|
||||||
for widget_id in sensitive_list:
|
for widget_id in sensitive_list:
|
||||||
self.glade.get_widget(widget_id).set_sensitive(sens)
|
self.glade.get_widget(widget_id).set_sensitive(sens)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def on_cancel(self, event=None):
|
def on_cancel(self, event=None):
|
||||||
self.dialog.destroy()
|
self.dialog.destroy()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user