Author: andar

Revision: 5807

Log:
        Commit #850 make urls clickable in the comments field

Diff:
Modified: trunk/deluge/ui/gtkui/details_tab.py
===================================================================
--- trunk/deluge/ui/gtkui/details_tab.py        2009-10-04 19:09:06 UTC (rev 
5806)
+++ trunk/deluge/ui/gtkui/details_tab.py        2009-10-04 19:11:37 UTC (rev 
5807)
@@ -38,7 +38,7 @@
 
 from deluge.ui.client import client
 import deluge.component as component
-import deluge.common
+from deluge.common import fsize, is_url
 from deluge.ui.gtkui.torrentdetails import Tab
 
 from deluge.log import LOG as log
@@ -56,7 +56,7 @@
 
         self.label_widgets = [
             (glade.get_widget("summary_name"), None, ("name",)),
-            (glade.get_widget("summary_total_size"), deluge.common.fsize, 
("total_size",)),
+            (glade.get_widget("summary_total_size"), fsize, ("total_size",)),
             (glade.get_widget("summary_num_files"), str, ("num_files",)),
             (glade.get_widget("summary_tracker"), None, ("tracker",)),
             (glade.get_widget("summary_torrent_path"), None, ("save_path",)),
@@ -104,7 +104,10 @@
                 txt = status[widget[2][0]]
 
             if widget[0].get_text() != txt:
-                widget[0].set_text(txt)
+                if widget[2][0] == 'comment' and is_url(txt):
+                    widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt))
+                else:
+                    widget[0].set_markup(txt)
 
     def clear(self):
         for widget in self.label_widgets:



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to