Skip to content

Commit

Permalink
Support announcing to all trackers of the same tier.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unit193 committed Dec 17, 2021
1 parent 6a10e57 commit 6211cb2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deluge/core/preferencesmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
'max_active_downloading': 3,
'max_active_limit': 8,
'dont_count_slow_torrents': False,
'announce_to_all_trackers': True,
'queue_new_to_top': False,
'stop_seed_at_ratio': False,
'remove_seed_at_ratio': False,
Expand Down Expand Up @@ -371,6 +372,9 @@ def _on_set_max_active_limit(self, key, value):
def _on_set_dont_count_slow_torrents(self, key, value):
self.core.apply_session_setting('dont_count_slow_torrents', value)

def _on_set_announce_to_all_trackers(self, key, value):
self.core.apply_session_setting('announce_to_all_trackers', value)

def _on_set_send_info(self, key, value):
"""sends anonymous stats home"""
log.debug('Sending anonymous stats..')
Expand Down
5 changes: 5 additions & 0 deletions deluge/ui/console/modes/preferences/preference_panes.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ def create_pane(self, core_conf, console_config):
'Ignore slow torrents',
core_conf['dont_count_slow_torrents'],
)
self.add_checked_input(
'announce_to_all_trackers',
'Announce to all trackers of the same tier',
core_conf['announce_to_all_trackers'],
)
self.add_checked_input(
'auto_manage_prefer_seeds',
'Prefer seeding torrents',
Expand Down
12 changes: 12 additions & 0 deletions deluge/ui/gtk3/glade/preferences_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,18 @@ used sparingly.</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chk_announce_to_all_trackers">
<property name="label" translatable="yes">Announce to all trackers of the same tier</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chk_auto_manage_prefer_seeds">
<property name="label" translatable="yes">Prefer seeding torrents</property>
Expand Down
4 changes: 4 additions & 0 deletions deluge/ui/gtk3/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ def _show(self):
'spin_seeding': ('value', 'max_active_seeding'),
'spin_downloading': ('value', 'max_active_downloading'),
'chk_dont_count_slow_torrents': ('active', 'dont_count_slow_torrents'),
'chk_announce_to_all_trackers': ('active', 'announce_to_all_trackers'),
'chk_auto_manage_prefer_seeds': ('active', 'auto_manage_prefer_seeds'),
'chk_queue_new_top': ('active', 'queue_new_to_top'),
'spin_share_ratio_limit': ('value', 'share_ratio_limit'),
Expand Down Expand Up @@ -835,6 +836,9 @@ def set_config(self, hide=False):
new_core_config['dont_count_slow_torrents'] = self.builder.get_object(
'chk_dont_count_slow_torrents'
).get_active()
new_core_config['announce_to_all_trackers'] = self.builder.get_object(
'chk_announce_to_all_trackers'
).get_active()
new_core_config['auto_manage_prefer_seeds'] = self.builder.get_object(
'chk_auto_manage_prefer_seeds'
).get_active()
Expand Down
9 changes: 9 additions & 0 deletions deluge/ui/web/js/deluge-all/preferences/QueuePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
boxLabel: _('Ignore slow torrents'),
})
);
om.bind(
'announce_to_all_trackers',
fieldset.add({
xtype: 'checkbox',
name: 'announce_to_all_trackers',
hideLabel: true,
boxLabel: _('Announce to all trackers of the same tier'),
})
);
om.bind(
'auto_manage_prefer_seeds',
fieldset.add({
Expand Down

0 comments on commit 6211cb2

Please sign in to comment.