From 32dc683d5cb3462e9121996eae8e517da6a0c793 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 9 Jun 2017 17:38:28 +0100 Subject: [PATCH] [#3037] Add creator field to details tabs --- deluge/core/torrent.py | 1 + deluge/ui/gtkui/details_tab.py | 1 + deluge/ui/gtkui/glade/main_window.tabs.ui | 223 ++++++++++-------- deluge/ui/web/js/deluge-all/Keys.js | 2 +- .../web/js/deluge-all/details/DetailsTab.js | 4 +- 5 files changed, 130 insertions(+), 101 deletions(-) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index a482eeba1..ac37dec36 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -1039,6 +1039,7 @@ class Torrent(object): 'tracker_status': lambda: self.tracker_status, 'upload_payload_rate': lambda: self.status.upload_payload_rate, 'comment': lambda: decode_bytes(self.torrent_info.comment()) if self.has_metadata else '', + 'creator': lambda: decode_bytes(self.torrent_info.creator()) if self.has_metadata else '', 'num_files': lambda: self.torrent_info.num_files() if self.has_metadata else 0, 'num_pieces': lambda: self.torrent_info.num_pieces() if self.has_metadata else 0, 'piece_length': lambda: self.torrent_info.piece_length() if self.has_metadata else 0, diff --git a/deluge/ui/gtkui/details_tab.py b/deluge/ui/gtkui/details_tab.py index e9589e506..b6e921e04 100644 --- a/deluge/ui/gtkui/details_tab.py +++ b/deluge/ui/gtkui/details_tab.py @@ -32,6 +32,7 @@ class DetailsTab(Tab): self.add_tab_widget('summary_torrent_path', None, ('download_location',)) self.add_tab_widget('summary_hash', str, ('hash',)) self.add_tab_widget('summary_comments', str, ('comment',)) + self.add_tab_widget('summary_creator', str, ('creator',)) self.add_tab_widget('summary_pieces', fpieces_num_size, ('num_pieces', 'piece_length')) def update(self): diff --git a/deluge/ui/gtkui/glade/main_window.tabs.ui b/deluge/ui/gtkui/glade/main_window.tabs.ui index e6b959409..dba2f12f2 100644 --- a/deluge/ui/gtkui/glade/main_window.tabs.ui +++ b/deluge/ui/gtkui/glade/main_window.tabs.ui @@ -104,6 +104,12 @@ 8 10 5 + + + + + + True @@ -604,12 +610,6 @@ GTK_FILL - - - - - - False @@ -662,7 +662,7 @@ True False - 6 + 7 5 10 5 @@ -683,40 +683,6 @@ GTK_EXPAND - - - True - False - 0 - Comments: - - - - - - 5 - 6 - GTK_FILL - - - - - - True - False - 0 - char - True - end - - - 1 - 5 - 5 - 6 - - - True @@ -743,7 +709,7 @@ GTK_FILL - + @@ -760,7 +726,7 @@ 2 3 GTK_FILL - + @@ -776,7 +742,7 @@ 2 3 GTK_FILL - + @@ -793,7 +759,7 @@ 3 4 GTK_FILL - + @@ -809,7 +775,7 @@ 3 4 GTK_FILL - + @@ -828,7 +794,7 @@ 3 4 GTK_FILL - + @@ -842,7 +808,7 @@ 5 3 4 - + @@ -861,7 +827,7 @@ 2 3 GTK_FILL - + @@ -876,7 +842,7 @@ 5 2 3 - + @@ -895,7 +861,7 @@ 4 5 GTK_FILL - + @@ -909,7 +875,7 @@ 5 4 5 - + @@ -926,7 +892,7 @@ 4 5 GTK_FILL - + @@ -944,7 +910,7 @@ 4 5 GTK_FILL - + @@ -961,7 +927,7 @@ 1 2 GTK_FILL - + @@ -979,7 +945,75 @@ 5 1 2 - + + + + + + True + False + 0 + char + True + end + + + 1 + 5 + 6 + 7 + + + + + + True + False + 0 + Comments: + + + + + + 6 + 7 + GTK_FILL + + + + + + True + False + 0 + Created By: + + + + + + 5 + 6 + GTK_FILL + + + + + + True + False + 0 + char + True + end + + + 1 + 5 + 5 + 6 + @@ -1096,7 +1130,7 @@ 1 2 - + @@ -1107,7 +1141,7 @@ 3 4 - + @@ -1132,6 +1166,12 @@ 3 4 2 + + + + + + True @@ -1152,8 +1192,8 @@ 2 2 3 - - + + @@ -1177,8 +1217,8 @@ 2 1 2 - - + + @@ -1201,8 +1241,8 @@ 1 2 - - + + @@ -1216,7 +1256,7 @@ 2 3 GTK_FILL - + @@ -1230,7 +1270,7 @@ 1 2 GTK_FILL - + @@ -1242,7 +1282,7 @@ GTK_FILL - + @@ -1258,8 +1298,8 @@ 2 3 - - + + @@ -1276,8 +1316,8 @@ 3 1 2 - - + + @@ -1291,7 +1331,7 @@ 3 4 GTK_FILL - + @@ -1314,16 +1354,10 @@ 2 3 4 - - + + - - - - - - @@ -1340,7 +1374,7 @@ - + GTK_FILL @@ -1399,7 +1433,6 @@ Shared - False True True False @@ -1415,7 +1448,6 @@ Prioritize First/Last - False True True False @@ -1431,7 +1463,6 @@ Sequential Download - False True True False @@ -1447,7 +1478,6 @@ Move completed: - False True True False @@ -1496,7 +1526,6 @@ Auto Managed - False True True False @@ -1512,7 +1541,6 @@ Stop seed at ratio: - False True True False @@ -1562,7 +1590,6 @@ Remove at ratio - False True True False @@ -1598,7 +1625,6 @@ _Apply - False True False True @@ -1687,7 +1713,7 @@ 1 2 GTK_FILL - + @@ -1702,7 +1728,7 @@ 2 1 2 - + @@ -1719,7 +1745,7 @@ 3 4 GTK_FILL - + @@ -1734,7 +1760,7 @@ 2 3 4 - + @@ -1752,7 +1778,7 @@ 2 3 GTK_FILL - + @@ -1781,7 +1807,6 @@ 5 - False True True True @@ -1804,7 +1829,7 @@ 5 6 GTK_FILL - + @@ -1819,7 +1844,7 @@ GTK_FILL - + @@ -1849,7 +1874,7 @@ 4 5 GTK_FILL - + @@ -1866,7 +1891,7 @@ 4 5 GTK_FILL - + diff --git a/deluge/ui/web/js/deluge-all/Keys.js b/deluge/ui/web/js/deluge-all/Keys.js index da5fa5eed..1b7803178 100644 --- a/deluge/ui/web/js/deluge-all/Keys.js +++ b/deluge/ui/web/js/deluge-all/Keys.js @@ -69,7 +69,7 @@ Deluge.Keys = { */ Details: [ 'name', 'download_location', 'total_size', 'num_files', 'message', - 'tracker_host', 'comment' + 'tracker_host', 'comment', 'creator' ], /** diff --git a/deluge/ui/web/js/deluge-all/details/DetailsTab.js b/deluge/ui/web/js/deluge-all/details/DetailsTab.js index c743577fe..2ef513185 100644 --- a/deluge/ui/web/js/deluge-all/details/DetailsTab.js +++ b/deluge/ui/web/js/deluge-all/details/DetailsTab.js @@ -29,6 +29,7 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, { this.addItem('comment', _('Comment:')); this.addItem('status', _('Status:')); this.addItem('tracker', _('Tracker:')); + this.addItem('creator', _('Created By:')); }, onRender: function(ct, position) { @@ -80,7 +81,8 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, { files: torrent.num_files, status: torrent.message, tracker: torrent.tracker_host, - comment: torrent.comment + comment: torrent.comment, + creator: torrent.creator }; for (var field in this.fields) {