Skip to content

Commit

Permalink
[UI] Add and improve trackers tab
Browse files Browse the repository at this point in the history
First, added trackers tab to the WebUI.
Second, now we can view all the trackers and view each:
* status
* number of peers
* additional message
Third, information about DHT, PeX and LSD is also added.
Fourth, moved the private torrent info to the details tab.

closes: https://dev.deluge-torrent.org/ticket/1015
  • Loading branch information
DjLegolas committed Feb 26, 2022
1 parent 2dd7c96 commit 1432487
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
3 changes: 2 additions & 1 deletion deluge/ui/gtk3/details_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import deluge.component as component
from deluge.common import decode_bytes, fdate, fsize, is_url

from .tab_data_funcs import fdate_or_dash, fpieces_num_size
from .tab_data_funcs import fdate_or_dash, fpieces_num_size, fyes_no
from .torrentdetails import Tab

log = logging.getLogger(__name__)
Expand All @@ -34,6 +34,7 @@ def __init__(self):
self.add_tab_widget(
'summary_pieces', fpieces_num_size, ('num_pieces', 'piece_length')
)
self.add_tab_widget('summary_private', fyes_no, ('private',))

def update(self):
# Get the first selected torrent
Expand Down
36 changes: 28 additions & 8 deletions deluge/ui/gtk3/glade/main_window.tabs.ui
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,17 @@
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary_private">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_pieces">
<property name="visible">True</property>
Expand Down Expand Up @@ -801,6 +812,21 @@
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_private">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Private Torrent:</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="vseparator5">
<property name="visible">True</property>
Expand All @@ -809,8 +835,8 @@
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
<property name="height">3</property>
<property name="top_attach">1</property>
<property name="height">4</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -843,12 +869,6 @@
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
Expand Down
3 changes: 2 additions & 1 deletion deluge/ui/gtk3/trackers_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import deluge.component as component

from .tab_data_funcs import ftranslate
from .torrentdetails import Tab

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -145,7 +146,7 @@ def _on_get_torrent_tracker_status(self, status):
for tracker in status['trackers']:
new_trackers.add(tracker['url'])
tracker_url = tracker['url']
tracker_status = status['trackers_status'].get(tracker_url, '')
tracker_status = ftranslate(status['trackers_status'].get(tracker_url, ''))
tracker_peers = status['trackers_peers'].get(tracker_url, 0)
tracker_message = tracker.get('message', '')
if tracker['url'] in self.trackers:
Expand Down

0 comments on commit 1432487

Please sign in to comment.