summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
diff options
context:
space:
mode:
authorLiming An <limingx.l.an@intel.com>2012-05-08 19:48:06 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-09 21:56:46 +0100
commita75562aa8b62247d09c52c92a620b947d19bbb95 (patch)
tree4c51d56761ead0f7b86f4c5edd6665e25e7387d0 /bitbake/lib/bb/ui/crumbs/persistenttooltip.py
parentcb9be923505f36d006631cb44b0af63af2365589 (diff)
downloadpoky-a75562aa8b62247d09c52c92a620b947d19bbb95.tar.gz
Hob: add original url show function with the tooltip hyperlink for user
When case about No browser, such as running in 'Build Appliance', user can't open the hyper link, so add this work around for user. (Checking the browser is avaiable or not is hard by different system and browser type) [YOCTO #2340] (Bitbake rev: 02cc701869bceb2d0e11fe3cf51fb0582cda01b0) Signed-off-by: Liming An <limingx.l.an@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/persistenttooltip.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/persistenttooltip.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/persistenttooltip.py b/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
index b43d297bf7..927c194292 100644
--- a/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
+++ b/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
@@ -125,11 +125,17 @@ class PersistentTooltip(gtk.Window):
125 style.fg[gtk.STATE_NORMAL] = gtk.gdk.color_parse(val) 125 style.fg[gtk.STATE_NORMAL] = gtk.gdk.color_parse(val)
126 self.label.set_style(style) 126 self.label.set_style(style)
127 break # we only care for the tooltip_fg_color 127 break # we only care for the tooltip_fg_color
128
128 self.label.set_markup(markup) 129 self.label.set_markup(markup)
129 self.label.show() 130 self.label.show()
130 bin.add(self.label) 131 bin.add(self.label)
131 hbox.pack_end(bin, True, True, 6) 132 hbox.pack_end(bin, True, True, 6)
132 133
134 # add the original URL display for user reference
135 if 'a href' in markup:
136 hbox.set_tooltip_text(self.get_markup_url(markup))
137 hbox.show()
138
133 self.connect("key-press-event", self._catch_esc_cb) 139 self.connect("key-press-event", self._catch_esc_cb)
134 140
135 """ 141 """
@@ -165,3 +171,16 @@ class PersistentTooltip(gtk.Window):
165 def hide(self): 171 def hide(self):
166 self.shown = False 172 self.shown = False
167 gtk.Window.hide(self) 173 gtk.Window.hide(self)
174
175 """
176 Called to get the hyperlink URL from markup text.
177 """
178 def get_markup_url(self, markup):
179 url = "http:"
180 if markup and type(markup) == str:
181 s = markup
182 if 'http:' in s:
183 import re
184 url = re.search('(http:[^,\\ "]+)', s).group(0)
185
186 return url