[#2772] [GTKUI] Fix GtkWarning with unknown pango markup

This commit is contained in:
Calum Lind 2015-10-18 18:24:53 +01:00
parent 4b9dcf377c
commit 86b1b75fb8

View File

@ -35,6 +35,7 @@
import gtk, gtk.glade
from xml.sax.saxutils import escape as xml_escape
from deluge.ui.client import client
import deluge.component as component
@ -103,12 +104,13 @@ class DetailsTab(Tab):
txt = widget[1](*args)
else:
txt = status[widget[2][0]]
txt = xml_escape(txt)
if widget[0].get_text() != txt:
if widget[2][0] == 'comment' and is_url(txt):
widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt.replace('&', '&amp;')))
widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt))
else:
widget[0].set_markup(txt.replace('&', '&amp;'))
widget[0].set_markup(txt)
def clear(self):
for widget in self.label_widgets: