summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/hig.py
diff options
context:
space:
mode:
authorShane Wang <shane.wang@intel.com>2012-02-29 22:15:10 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-01 15:51:33 +0000
commitae9539f2f466b90954eb7baab0980f23448fd6bf (patch)
tree118ac336407aff7fdf3a634f84673fd1a885b974 /bitbake/lib/bb/ui/crumbs/hig.py
parent5090837991af49732857dffaa596b7bdb9418e80 (diff)
downloadpoky-ae9539f2f466b90954eb7baab0980f23448fd6bf.tar.gz
crumbs: Factor common dialogue configuration out
Factor out the base dialogue configuration into CrumbsDialog and create a new CrumbsMessageDialog which acts as the CrumbsDialog did to handle dialogues with buttons. Adopt CrumbsMessageDialog wherever CrumbsDialog was used. (Bitbake rev: d8c62f54d9f2421cfe7f1083b9d0acfe0373d38a) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hig.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
index cbad899ae0..85efbe6908 100644
--- a/bitbake/lib/bb/ui/crumbs/hig.py
+++ b/bitbake/lib/bb/ui/crumbs/hig.py
@@ -45,11 +45,24 @@ class CrumbsDialog(gtk.Dialog):
45 A GNOME HIG compliant dialog widget. 45 A GNOME HIG compliant dialog widget.
46 Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons 46 Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons
47 """ 47 """
48 def __init__(self, title="", parent=None, flags=0, buttons=None):
49 super(CrumbsDialog, self).__init__(title, parent, flags, buttons)
50
51 self.set_property("has-separator", False) # note: deprecated in 2.22
52
53 self.set_border_width(6)
54 self.vbox.set_property("spacing", 12)
55 self.action_area.set_property("spacing", 12)
56 self.action_area.set_property("border-width", 6)
57
58class CrumbsMessageDialog(CrumbsDialog):
59 """
60 A GNOME HIG compliant dialog widget.
61 Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons
62 """
48 def __init__(self, parent=None, label="", icon=gtk.STOCK_INFO): 63 def __init__(self, parent=None, label="", icon=gtk.STOCK_INFO):
49 super(CrumbsDialog, self).__init__("", parent, gtk.DIALOG_DESTROY_WITH_PARENT) 64 super(CrumbsMessageDialog, self).__init__("", parent, gtk.DIALOG_DESTROY_WITH_PARENT)
50 65
51 #self.set_property("has-separator", False) # note: deprecated in 2.22
52
53 self.set_border_width(6) 66 self.set_border_width(6)
54 self.vbox.set_property("spacing", 12) 67 self.vbox.set_property("spacing", 12)
55 self.action_area.set_property("spacing", 12) 68 self.action_area.set_property("spacing", 12)
@@ -839,7 +852,7 @@ class LayerSelectionDialog (gtk.Dialog):
839 else: 852 else:
840 layer_store.append([path]) 853 layer_store.append([path])
841 return 854 return
842 dialog = CrumbsDialog(parent, lbl) 855 dialog = CrumbsMessageDialog(parent, lbl)
843 dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) 856 dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
844 response = dialog.run() 857 response = dialog.run()
845 dialog.destroy() 858 dialog.destroy()