Add 'Comments' field to the Details tab

This commit is contained in:
Andrew Resch 2009-03-15 01:35:20 +00:00
parent f787e013ee
commit f5db9d3534
4 changed files with 62 additions and 33 deletions

View File

@ -2,6 +2,7 @@
==== Core ====
* Implement new RPC protocol DelugeRPC replacing XMLRPC
* Move to a twisted framework
* Add an 'Error' filter for Trackers to show trackers that currently have a tracker error
==== GtkUI ====
* Remove SignalReceiver
@ -12,7 +13,7 @@
* Move over to using Twisted-Web for the webserver.
* Move to only AJAX interface built upon Ext-JS.
=== Deluge 1.1.0 (Released) ===
=== Deluge 1.1.0 - "Time gas!" (10 January 2009) ===
==== Core ====
* Implement #79 ability to change outgoing port range
* Implement #296 ability to change peer TOS byte

View File

@ -600,6 +600,14 @@ class Torrent:
"upload_payload_rate": self.status.upload_payload_rate
}
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:
@ -630,6 +638,7 @@ class Torrent:
return 0
fns = {
"comment": ti_comment,
"eta": self.get_eta,
"file_progress": self.get_file_progress,
"is_seed": self.handle.is_seed,

View File

@ -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.core.get_torrent_status(selected, status_keys).addCallback(self._on_get_torrent_status)

View File

@ -317,7 +317,7 @@
<signal name="clicked" handler="on_toolbutton_add_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
@ -329,17 +329,13 @@
<signal name="clicked" handler="on_toolbutton_remove_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkSeparatorToolItem" id="separatortoolitem1">
<property name="visible">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="toolbutton_pause">
@ -352,7 +348,7 @@
<signal name="clicked" handler="on_toolbutton_pause_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
@ -366,17 +362,13 @@
<signal name="clicked" handler="on_toolbutton_resume_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkSeparatorToolItem" id="separatortoolitem2">
<property name="visible">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="toolbutton_queue_up">
@ -389,7 +381,7 @@
<signal name="clicked" handler="on_toolbutton_queue_up_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
@ -403,7 +395,7 @@
<signal name="clicked" handler="on_toolbutton_queue_down_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
@ -411,10 +403,6 @@
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="toolbutton_preferences">
@ -426,7 +414,7 @@
<signal name="clicked" handler="on_toolbutton_preferences_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
@ -439,7 +427,7 @@
<signal name="clicked" handler="on_toolbutton_connectionmanager_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</widget>
@ -482,7 +470,6 @@
<widget class="GtkTreeView" id="torrent_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="reorderable">True</property>
<property name="rules_hint">True</property>
<property name="enable_search">False</property>
</widget>
@ -1253,8 +1240,9 @@
<child>
<widget class="GtkTable" id="table9">
<property name="visible">True</property>
<property name="n_rows">7</property>
<property name="n_rows">8</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">2</property>
<child>
<placeholder/>
@ -1268,6 +1256,36 @@
<child>
<placeholder/>
</child>
<child>
<widget class="GtkLabel" id="summary_comments">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="wrap_mode">PANGO_WRAP_CHAR</property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">4</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="ypad">1</property>
<property name="label" translatable="yes">&lt;b&gt;Comments:&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="summary_num_files">
<property name="visible">True</property>
@ -1339,8 +1357,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">4</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="y_options"></property>
</packing>
</child>
@ -1353,8 +1371,8 @@
<property name="use_markup">True</property>
</widget>
<packing>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@ -1465,8 +1483,8 @@
<property name="use_markup">True</property>
</widget>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@ -1481,8 +1499,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">4</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="y_options"></property>
</packing>
</child>