summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/hig.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hig.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig.py59
1 files changed, 44 insertions, 15 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
index bdb3702e29..3c8c1c9e8a 100644
--- a/bitbake/lib/bb/ui/crumbs/hig.py
+++ b/bitbake/lib/bb/ui/crumbs/hig.py
@@ -21,6 +21,7 @@
21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 22
23import glob 23import glob
24import glib
24import gtk 25import gtk
25import gobject 26import gobject
26import hashlib 27import hashlib
@@ -236,18 +237,18 @@ class CrumbsMessageDialog(CrumbsDialog):
236 A GNOME HIG compliant dialog widget. 237 A GNOME HIG compliant dialog widget.
237 Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons 238 Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons
238 """ 239 """
239 def __init__(self, parent=None, label="", icon=gtk.STOCK_INFO): 240 def __init__(self, parent=None, label="", icon=gtk.STOCK_INFO, msg=""):
240 super(CrumbsMessageDialog, self).__init__("", parent, gtk.DIALOG_DESTROY_WITH_PARENT) 241 super(CrumbsMessageDialog, self).__init__("", parent, gtk.DIALOG_MODAL)
241 242
242 self.set_border_width(6) 243 self.set_border_width(6)
243 self.vbox.set_property("spacing", 12) 244 self.vbox.set_property("spacing", 12)
244 self.action_area.set_property("spacing", 12) 245 self.action_area.set_property("spacing", 12)
245 self.action_area.set_property("border-width", 6) 246 self.action_area.set_property("border-width", 6)
246 247
247 first_row = gtk.HBox(spacing=12) 248 first_column = gtk.HBox(spacing=12)
248 first_row.set_property("border-width", 6) 249 first_column.set_property("border-width", 6)
249 first_row.show() 250 first_column.show()
250 self.vbox.add(first_row) 251 self.vbox.add(first_column)
251 252
252 self.icon = gtk.Image() 253 self.icon = gtk.Image()
253 # We have our own Info icon which should be used in preference of the stock icon 254 # We have our own Info icon which should be used in preference of the stock icon
@@ -255,15 +256,43 @@ class CrumbsMessageDialog(CrumbsDialog):
255 self.icon.set_from_stock(self.icon_chk.check_stock_icon(icon), gtk.ICON_SIZE_DIALOG) 256 self.icon.set_from_stock(self.icon_chk.check_stock_icon(icon), gtk.ICON_SIZE_DIALOG)
256 self.icon.set_property("yalign", 0.00) 257 self.icon.set_property("yalign", 0.00)
257 self.icon.show() 258 self.icon.show()
258 first_row.add(self.icon) 259 first_column.pack_start(self.icon, expand=False, fill=True, padding=0)
259 260
260 self.label = gtk.Label() 261 if 0 <= len(msg) < 200:
261 self.label.set_use_markup(True) 262 lbl = label + "%s" % glib.markup_escape_text(msg)
262 self.label.set_line_wrap(True) 263 self.label_short = gtk.Label()
263 self.label.set_markup(label) 264 self.label_short.set_use_markup(True)
264 self.label.set_property("yalign", 0.00) 265 self.label_short.set_line_wrap(True)
265 self.label.show() 266 self.label_short.set_markup(lbl)
266 first_row.add(self.label) 267 self.label_short.set_property("yalign", 0.00)
268 self.label_short.show()
269 first_column.add(self.label_short)
270 else:
271 second_row = gtk.VBox(spacing=12)
272 second_row.set_property("border-width", 6)
273 self.label_long = gtk.Label()
274 self.label_long.set_use_markup(True)
275 self.label_long.set_line_wrap(True)
276 self.label_long.set_markup(label)
277 self.label_long.set_alignment(0.0, 0.0)
278 second_row.pack_start(self.label_long, expand=False, fill=False, padding=0)
279 self.label_long.show()
280 self.textWindow = gtk.ScrolledWindow()
281 self.textWindow.set_shadow_type(gtk.SHADOW_IN)
282 self.msgView = gtk.TextView()
283 self.msgView.set_editable(False)
284 self.msgView.set_wrap_mode(gtk.WRAP_WORD)
285 self.msgView.set_cursor_visible(False)
286 self.msgView.set_size_request(300, 300)
287 self.buf = gtk.TextBuffer()
288 self.buf.set_text(msg)
289 self.msgView.set_buffer(self.buf)
290 self.textWindow.add(self.msgView)
291 self.msgView.show()
292 second_row.add(self.textWindow)
293 self.textWindow.show()
294 first_column.add(second_row)
295 second_row.show()
267 296
268# 297#
269# SimpleSettings Dialog 298# SimpleSettings Dialog