diff options
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/persistenttooltip.py | 19 |
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 | ||