summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorLiming An <limingx.l.an@intel.com>2012-06-04 14:00:23 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-05 23:09:59 +0100
commit75e32007effd06af5f902295de4f4b875267d26f (patch)
tree8e24d9a6eb052b1e69081ee2dec8abad52a4f221 /bitbake
parentd52e74cee9745b497296fa7d2b6cbc6f1a903aa7 (diff)
downloadpoky-75e32007effd06af5f902295de4f4b875267d26f.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')
-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