summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2011-06-15 22:29:52 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2011-07-02 18:44:26 +0100
commit795f633bc4e481564a3441f63f21aca29cfc5603 (patch)
tree5badf5f489c75d0521eadc8ba7aad96d422a0ea1
parentb6596a27bca76bcbb2bcc305e5d27bf8d1557093 (diff)
downloaddeluge-795f633bc4e481564a3441f63f21aca29cfc5603.tar.gz
deluge-795f633bc4e481564a3441f63f21aca29cfc5603.tar.bz2
deluge-795f633bc4e481564a3441f63f21aca29cfc5603.zip
Fix #491: Add auto_manage_prefer_seeds to prefs manager and UIs
-rw-r--r--deluge/core/preferencesmanager.py5
-rw-r--r--deluge/ui/console/modes/preference_panes.py1
-rw-r--r--deluge/ui/gtkui/glade/preferences_dialog.glade15
-rw-r--r--deluge/ui/gtkui/preferences.py4
-rw-r--r--deluge/ui/web/js/deluge-all/preferences/QueuePage.js9
5 files changed, 33 insertions, 1 deletions
diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py
index 77b89159b..bdc7f1c43 100644
--- a/deluge/core/preferencesmanager.py
+++ b/deluge/core/preferencesmanager.py
@@ -140,6 +140,7 @@ DEFAULT_PREFS = {
"geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
"cache_size": 512,
"cache_expiry": 60,
+ "auto_manage_prefer_seeds": False,
"shared": False
}
@@ -470,3 +471,7 @@ class PreferencesManager(component.Component):
def _on_set_cache_expiry(self, key, value):
log.debug("%s: %s", key, value)
self.session_set_setting("cache_expiry", value)
+
+ def _on_auto_manage_prefer_seeds(self, key, value):
+ log.debug("%s set to %s..", key, value)
+ self.session_set_setting("auto_manage_prefer_seeds", value)
diff --git a/deluge/ui/console/modes/preference_panes.py b/deluge/ui/console/modes/preference_panes.py
index e24921629..3a64a1068 100644
--- a/deluge/ui/console/modes/preference_panes.py
+++ b/deluge/ui/console/modes/preference_panes.py
@@ -354,6 +354,7 @@ class QueuePane(BasePane):
self.add_int_spin_input("max_active_downloading","Total active downloading:",parent.core_config["max_active_downloading"],-1,9999)
self.add_int_spin_input("max_active_seeding","Total active seeding:",parent.core_config["max_active_seeding"],-1,9999)
self.add_checked_input("dont_count_slow_torrents","Do not count slow torrents",parent.core_config["dont_count_slow_torrents"])
+ self.add_checked_input("auto_manage_prefer_seeds","Prefer Seeding over Downloading",parent.core_config["auto_manage_prefer_seeds"])
self.add_header("Seeding",True)
self.add_float_spin_input("share_ratio_limit","Share Ratio Limit:",parent.core_config["share_ratio_limit"],1.0,2,-1.0,100.0)
self.add_float_spin_input("seed_time_ratio_limit","Share Time Ratio:",parent.core_config["seed_time_ratio_limit"],1.0,2,-1.0,100.0)
diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade
index 1bfd4d340..99bd0ca96 100644
--- a/deluge/ui/gtkui/glade/preferences_dialog.glade
+++ b/deluge/ui/gtkui/glade/preferences_dialog.glade
@@ -3846,6 +3846,21 @@ status tab (&lt;b&gt;EXPERIMENTAL!!!&lt;/b&gt;)</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkCheckButton" id="chk_auto_manage_prefer_seeds">
+ <property name="label" translatable="yes">Prefer Seeding over Downloading</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
index c732f339f..6e637fc66 100644
--- a/deluge/ui/gtkui/preferences.py
+++ b/deluge/ui/gtkui/preferences.py
@@ -363,6 +363,7 @@ class Preferences(component.Component):
"spin_seeding": ("value", self.core_config["max_active_seeding"]),
"spin_downloading": ("value", self.core_config["max_active_downloading"]),
"chk_dont_count_slow_torrents": ("active", self.core_config["dont_count_slow_torrents"]),
+ "chk_auto_manage_prefer_seeds": ("active", self.core_config["auto_manage_prefer_seeds"]),
"chk_queue_new_top": ("active", self.core_config["queue_new_to_top"]),
"spin_share_ratio_limit": ("value", self.core_config["share_ratio_limit"]),
"spin_seed_time_ratio_limit": \
@@ -503,6 +504,7 @@ class Preferences(component.Component):
"spin_downloading",
"spin_active",
"chk_dont_count_slow_torrents",
+ "chk_auto_manage_prefer_seeds",
"chk_queue_new_top",
"chk_seed_ratio",
"spin_share_ratio",
@@ -781,6 +783,8 @@ class Preferences(component.Component):
self.glade.get_widget("spin_active").get_value_as_int()
new_core_config["dont_count_slow_torrents"] = \
self.glade.get_widget("chk_dont_count_slow_torrents").get_active()
+ new_core_config["auto_manage_prefer_seeds"] = \
+ self.glade.get_widget("chk_auto_manage_prefer_seeds").get_active()
new_core_config["stop_seed_at_ratio"] = \
self.glade.get_widget("chk_seed_ratio").get_active()
new_core_config["remove_seed_at_ratio"] = \
diff --git a/deluge/ui/web/js/deluge-all/preferences/QueuePage.js b/deluge/ui/web/js/deluge-all/preferences/QueuePage.js
index cee5a1557..9a6b4cf69 100644
--- a/deluge/ui/web/js/deluge-all/preferences/QueuePage.js
+++ b/deluge/ui/web/js/deluge-all/preferences/QueuePage.js
@@ -102,10 +102,17 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
om.bind('dont_count_slow_torrents', fieldset.add({
xtype: 'checkbox',
name: 'dont_count_slow_torrents',
- height: 40,
+ height: 22,
hideLabel: true,
boxLabel: _('Do not count slow torrents')
}));
+ om.bind('auto_manage_prefer_seeds', fieldset.add({
+ xtype: 'checkbox',
+ name: 'auto_manage_prefer_seeds',
+ height: 40,
+ hideLabel: true,
+ boxLabel: _('Prefer Seeding over Downloading')
+ }));
fieldset = this.add({
xtype: 'fieldset',