Ticket #850: clickable-url-in-comments-field.patch

File clickable-url-in-comments-field.patch, 1.4 KB (added by Ideal, 15 years ago)
  • deluge/ui/gtkui/details_tab.py

     
    3838
    3939from deluge.ui.client import client
    4040import deluge.component as component
    41 import deluge.common
     41from deluge.common import fsize, is_url
    4242from deluge.ui.gtkui.torrentdetails import Tab
    4343
    4444from deluge.log import LOG as log
     
    5656
    5757        self.label_widgets = [
    5858            (glade.get_widget("summary_name"), None, ("name",)),
    59             (glade.get_widget("summary_total_size"), deluge.common.fsize, ("total_size",)),
     59            (glade.get_widget("summary_total_size"), fsize, ("total_size",)),
    6060            (glade.get_widget("summary_num_files"), str, ("num_files",)),
    6161            (glade.get_widget("summary_tracker"), None, ("tracker",)),
    6262            (glade.get_widget("summary_torrent_path"), None, ("save_path",)),
     
    104104                txt = status[widget[2][0]]
    105105
    106106            if widget[0].get_text() != txt:
    107                 widget[0].set_text(txt)
     107                if widget[2][0] == 'comment' and is_url(txt):
     108                    widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt))
     109                else:
     110                    widget[0].set_markup(txt)
    108111
    109112    def clear(self):
    110113        for widget in self.label_widgets: