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
 * peers count
 * additional message
Third, moved the private torrent info to the details tab.

closes: https://dev.deluge-torrent.org/ticket/1015
  • Loading branch information
DjLegolas committed May 22, 2023
1 parent f16678f commit 6c990b6
Show file tree
Hide file tree
Showing 11 changed files with 473 additions and 218 deletions.
6 changes: 6 additions & 0 deletions deluge/ui/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,12 @@ def connection_info(self):

return None

def connection_version(self):
if self.connected():
return self._daemon_proxy.daemon_info

return ''

def register_event_handler(self, event, handler):
"""
Registers a handler that will be called when an event is received from the daemon.
Expand Down
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
27 changes: 27 additions & 0 deletions deluge/ui/gtk3/glade/main_window.tabs.menu_trackers.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">list-add-symbolic</property>
<property name="icon_size">1</property>
</object>
<object class="GtkMenu" id="menu_trackers_tab">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="edit_trackers_menuitem">
<property name="label" translatable="yes">_Edit Trackers</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Edit all trackers</property>
<property name="use_underline">True</property>
<property name="image">image1</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_edit_trackers_activate" swapped="no"/>
</object>
</child>
</object>
</interface>
224 changes: 32 additions & 192 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">5</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">5</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 Expand Up @@ -1446,191 +1466,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkViewport" id="viewport4">
<object class="GtkTreeView" id="trackers_listview">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">5</property>
<property name="bottom_padding">2</property>
<property name="left_padding">10</property>
<property name="right_padding">15</property>
<child>
<object class="GtkGrid" id="table2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">5</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="label_tracker">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Current Tracker:</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary_tracker">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary_next_announce">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary_tracker_status">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary_tracker_total">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary_private">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_tracker_total">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Total Trackers:</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_tracker_status">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Tracker Status:</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_next_announce">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Next Announce:</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<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">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment_edit_trackers">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="top_padding">5</property>
<child>
<object class="GtkButton" id="button_edit_trackers">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_button_edit_trackers_clicked" swapped="no"/>
<child>
<object class="GtkLabel" id="label_edit_trackers">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Edit Trackers</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<property name="can_focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeselection3"/>
</child>
</object>
</child>
Expand Down
1 change: 1 addition & 0 deletions deluge/ui/gtk3/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def patched_connect_signals(*a, **k):
'main_window.tabs.ui',
'main_window.tabs.menu_file.ui',
'main_window.tabs.menu_peer.ui',
'main_window.tabs.menu_trackers.ui',
]
for filename in ui_filenames:
self.main_builder.add_from_file(
Expand Down
Loading

0 comments on commit 6c990b6

Please sign in to comment.