From 97fec6ce1a7c0986d0f54c530ba6ead24f9a23f4 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 15 Mar 2009 01:35:20 +0000 Subject: [PATCH] Add 'Comments' field to the Details tab --- ChangeLog | 7 + deluge/core/torrent.py | 9 + deluge/ui/gtkui/details_tab.py | 6 +- deluge/ui/gtkui/glade/main_window.glade | 1341 ++++++++++++----------- 4 files changed, 699 insertions(+), 664 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0df1ddb0..f0bc9674d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +=== Deluge 1.1.5 - (In Development) === +==== Core ==== + * Fix config file saving when no current config file exists + +==== GtkUI ==== + * Add 'Comments' field to the Details tab + === Deluge 1.1.4 - (08 March 2009) === ==== Core ==== * Fix displaying file errors when the torrent isn't paused diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 310547375..5c0c1f178 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -604,6 +604,14 @@ class Torrent: "time_added": self.time_added } + def ti_comment(): + if self.handle.has_metadata(): + try: + return self.torrent_info.comment().decode("utf8", "ignore") + except UnicodeDecodeError: + return self.torrent_info.comment() + return "" + def ti_name(): if self.handle.has_metadata(): try: @@ -634,6 +642,7 @@ class Torrent: return 0 fns = { + "comment": ti_comment, "name": ti_name, "private": ti_priv, "total_size": ti_total_size, diff --git a/deluge/ui/gtkui/details_tab.py b/deluge/ui/gtkui/details_tab.py index f5a7b6db5..13c40347b 100644 --- a/deluge/ui/gtkui/details_tab.py +++ b/deluge/ui/gtkui/details_tab.py @@ -50,7 +50,8 @@ class DetailsTab(Tab): (glade.get_widget("summary_tracker"), None, ("tracker",)), (glade.get_widget("summary_torrent_path"), None, ("save_path",)), (glade.get_widget("summary_message"), str, ("message",)), - (glade.get_widget("summary_hash"), str, ("hash",)) + (glade.get_widget("summary_hash"), str, ("hash",)), + (glade.get_widget("summary_comments"), str, ("comment",)) ] def update(self): @@ -67,7 +68,7 @@ class DetailsTab(Tab): # Get the torrent status status_keys = ["name", "total_size", "num_files", - "tracker", "save_path", "message", "hash"] + "tracker", "save_path", "message", "hash", "comment"] client.get_torrent_status( self._on_get_torrent_status, selected, status_keys) @@ -98,4 +99,3 @@ class DetailsTab(Tab): def clear(self): for widget in self.label_widgets: widget[0].set_text("") - diff --git a/deluge/ui/gtkui/glade/main_window.glade b/deluge/ui/gtkui/glade/main_window.glade index a2d934321..4e3ad2772 100644 --- a/deluge/ui/gtkui/glade/main_window.glade +++ b/deluge/ui/gtkui/glade/main_window.glade @@ -317,7 +317,7 @@ - False + True @@ -329,17 +329,13 @@ - False + True True - - False - False - @@ -352,7 +348,7 @@ - False + True @@ -366,17 +362,13 @@ - False + True True - - False - False - @@ -389,7 +381,7 @@ - False + True @@ -403,7 +395,7 @@ - False + True @@ -411,10 +403,6 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - False - False - @@ -426,7 +414,7 @@ - False + True @@ -439,7 +427,7 @@ - False + True @@ -675,290 +663,165 @@ 10 5 - - True - 0 - - - 5 - 6 - 3 - 4 - GTK_FILL - - - - - True - 0 - <b>Auto Managed:</b> - True - - - 4 - 5 - 3 - 4 - GTK_FILL - - - - + True 0 7 8 - 2 - 3 - GTK_FILL - - - - - True - 0 - - - 7 - 8 - 1 - 2 - GTK_FILL - - - - - True - 0 - <b>Seed Rank:</b> - True - - - 6 - 7 - 2 - 3 - GTK_FILL - - - - - True - 0 - <b>Seeding Time:</b> - True - - - 6 - 7 - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 7 - 8 - GTK_FILL - - - - - True - 0 - <b>Active Time:</b> - True - - - 6 - 7 - GTK_FILL - - - - - True - 0 - True - - - 1 - 2 3 4 GTK_FILL - + True 0 + <b>Date Added:</b> + True - 3 - 4 + 6 + 7 3 4 GTK_FILL - - True - 0 - True - PANGO_WRAP_CHAR - True - - - 1 - 8 - 4 - 5 - GTK_FILL - - - - - True - 0 - 0 - <b>Tracker Status:</b> - True - - - 4 - 5 - GTK_FILL - GTK_FILL - - - - - True - 0 - True - PANGO_WRAP_WORD_CHAR - - - 5 - 6 - 2 - 3 - GTK_FILL - - - - - True - 0 - 1 - <b>Availability:</b> - True - - - 4 - 5 - 2 - 3 - GTK_FILL - - - - - True - 0 - - - 3 - 4 - 2 - 3 - GTK_FILL - - - - + True 0 1 2 + GTK_FILL + + + + + True + 0 + + + 3 + 4 + GTK_FILL + + + + + True + 0 + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + 0 + + + 3 + 4 + 1 + 2 + GTK_FILL + + + + + True + 5 + + + True + 0 + <b>Downloaded:</b> + True + + + + + GTK_FILL + + + + + True + 5 + + + True + 0 + <b>Uploaded:</b> + True + + + + + 1 + 2 + GTK_FILL + + + + + True + 5 + + + True + 0 + <b>Share Ratio:</b> + True + + + + 2 3 GTK_FILL - + True - 0 + 5 + + + True + 0 + <b>Next Announce:</b> + True + + - 5 - 6 - 1 - 2 + 3 + 4 GTK_FILL - - True - 0 - <b>Peers:</b> - True - - - 4 - 5 - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 5 - 6 - GTK_FILL - - - - - True - 0 - <b>Seeders:</b> - True - - - 4 - 5 - GTK_FILL - - - - + True 15 5 - + True 0 - <b>Pieces:</b> + <b>Speed:</b> True @@ -966,30 +829,6 @@ 2 3 - 3 - 4 - GTK_FILL - - - - - True - 15 - 5 - - - True - 0 - <b>ETA:</b> - True - - - - - 2 - 3 - 2 - 3 GTK_FILL @@ -1016,15 +855,15 @@ - + True 15 5 - + True 0 - <b>Speed:</b> + <b>ETA:</b> True @@ -1032,154 +871,303 @@ 2 3 - GTK_FILL - - - - - True - 5 - - - True - 0 - <b>Next Announce:</b> - True - - - - - 3 - 4 - GTK_FILL - - - - - True - 5 - - - True - 0 - <b>Share Ratio:</b> - True - - - - 2 3 GTK_FILL - + True + 15 5 - + True 0 - <b>Uploaded:</b> + <b>Pieces:</b> True - 1 - 2 - GTK_FILL - - - - - True - 5 - - - True - 0 - <b>Downloaded:</b> - True - - - - - GTK_FILL - - - - - True - 0 - - - 3 - 4 - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 3 - 4 - GTK_FILL - - - - - True - 0 - - - 1 - 2 - GTK_FILL - - - - - True - 0 - <b>Date Added:</b> - True - - - 6 - 7 + 2 + 3 3 4 GTK_FILL - + + True + 0 + <b>Seeders:</b> + True + + + 4 + 5 + GTK_FILL + + + + + True + 0 + + + 5 + 6 + GTK_FILL + + + + + True + 0 + <b>Peers:</b> + True + + + 4 + 5 + 1 + 2 + GTK_FILL + + + + + True + 0 + + + 5 + 6 + 1 + 2 + GTK_FILL + + + + + True + 0 + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + 0 + + + 3 + 4 + 2 + 3 + GTK_FILL + + + + + True + 0 + 1 + <b>Availability:</b> + True + + + 4 + 5 + 2 + 3 + GTK_FILL + + + + + True + 0 + True + PANGO_WRAP_WORD_CHAR + + + 5 + 6 + 2 + 3 + GTK_FILL + + + + + True + 0 + 0 + <b>Tracker Status:</b> + True + + + 4 + 5 + GTK_FILL + GTK_FILL + + + + + True + 0 + True + PANGO_WRAP_CHAR + True + + + 1 + 8 + 4 + 5 + GTK_FILL + + + + + True + 0 + + + 3 + 4 + 3 + 4 + GTK_FILL + + + + + True + 0 + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + True + 0 + <b>Active Time:</b> + True + + + 6 + 7 + GTK_FILL + + + + True 0 7 8 + GTK_FILL + + + + + True + 0 + <b>Seeding Time:</b> + True + + + 6 + 7 + 1 + 2 + GTK_FILL + + + + + True + 0 + <b>Seed Rank:</b> + True + + + 6 + 7 + 2 + 3 + GTK_FILL + + + + + True + 0 + + + 7 + 8 + 1 + 2 + GTK_FILL + + + + + True + 0 + + + 7 + 8 + 2 + 3 + GTK_FILL + + + + + True + 0 + <b>Auto Managed:</b> + True + + + 4 + 5 + 3 + 4 + GTK_FILL + + + + + True + 0 + + + 5 + 6 3 4 GTK_FILL @@ -1253,8 +1241,9 @@ True - 7 + 8 4 + 5 2 @@ -1269,7 +1258,37 @@ - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + + + 1 + 4 + 5 + 6 + + + + + + True + 0 + 1 + <b>Comments:</b> + True + + + 5 + 6 + GTK_FILL + + + + + True 0 True @@ -1277,114 +1296,45 @@ 1 2 - 4 - 5 - - - - - - True - 0 - 1 - <b># of files:</b> - True - - - 4 - 5 - GTK_FILL - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - True - PANGO_WRAP_CHAR - True - - - 1 - 4 - 1 - 2 - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - <b>Hash:</b> - True - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - PANGO_WRAP_CHAR - True - - - 1 - 4 - 6 - 7 - - - - - - True - 0 - 1 - <b>Tracker:</b> - True - - - 6 - 7 - GTK_FILL - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - - True - 0 - 1 - <b>Total Size:</b> - True - - - - 3 4 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + + + 1 + 4 + 6 + 7 + + + + + + True + 0 + 1 + <b>Status:</b> + True + + + 6 + 7 GTK_FILL - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_STRUCTURE_MASK + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 True PANGO_WRAP_CHAR @@ -1393,27 +1343,8 @@ 1 4 - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - - True - 0 - 0 - 1 - <b>Name:</b> - True - - - - - GTK_FILL + 2 + 3 @@ -1440,7 +1371,110 @@ - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + 0 + 0 + 1 + <b>Name:</b> + True + + + + + GTK_FILL + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_STRUCTURE_MASK + 0 + True + PANGO_WRAP_CHAR + True + + + 1 + 4 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + 0 + 1 + <b>Total Size:</b> + True + + + + + 3 + 4 + GTK_FILL + + + + + + True + 0 + 1 + <b>Tracker:</b> + True + + + 7 + 8 + GTK_FILL + + + + + + True + 0 + PANGO_WRAP_CHAR + True + + + 1 + 4 + 7 + 8 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + <b>Hash:</b> + True + + + 1 + 2 + GTK_FILL + + + + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 @@ -1451,43 +1485,28 @@ 1 4 - 2 - 3 + 1 + 2 - + True 0 1 - <b>Status:</b> + <b># of files:</b> True - 5 - 6 + 4 + 5 GTK_FILL - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - True - - - 1 - 4 - 5 - 6 - - - - - + True 0 True @@ -1495,8 +1514,8 @@ 1 2 - 3 - 4 + 4 + 5 @@ -1677,7 +1696,7 @@ - + True True 6 @@ -1687,8 +1706,100 @@ 1 2 + 3 + 4 + + + + + + + True + 0 + Max Upload Slots: + + + 3 + 4 + GTK_FILL + + + + + + True + KiB/s + + + 2 + 3 + 1 + 2 + + + + + + + True + KiB/s + + + 2 + 3 + + + + + + + True + 0 + Max Download Speed: + + + GTK_FILL + + + + + + True + 0 + Max Upload Speed: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Max Connections: + + 2 3 + GTK_FILL + + + + + + True + True + 6 + 1 + -1 -1 999999 1 10 0 + 1 + + + 1 + 2 @@ -1712,110 +1823,18 @@ - + True True 6 1 -1 -1 999999 1 10 0 - 1 1 2 - - - - - - - True - 0 - Max Connections: - - 2 3 - GTK_FILL - - - - - - True - 0 - Max Upload Speed: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Max Download Speed: - - - GTK_FILL - - - - - - True - KiB/s - - - 2 - 3 - - - - - - - True - KiB/s - - - 2 - 3 - 1 - 2 - - - - - - - True - 0 - Max Upload Slots: - - - 3 - 4 - GTK_FILL - - - - - - True - True - 6 - 1 - -1 -1 999999 1 10 0 - - - 1 - 2 - 3 - 4 @@ -2454,14 +2473,23 @@ 10 2 - + + True + 0 + <i>Current Version:</i> + True + + + GTK_FILL + + + + True 1 2 - 1 - 2 @@ -2479,26 +2507,17 @@ - + True 1 2 + 1 + 2 - - - True - 0 - <i>Current Version:</i> - True - - - GTK_FILL - -