From ae9539f2f466b90954eb7baab0980f23448fd6bf Mon Sep 17 00:00:00 2001 From: Shane Wang Date: Wed, 29 Feb 2012 22:15:10 +0800 Subject: 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 Signed-off-by: Shane Wang Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/hig.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs/hig.py') 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 @@ -41,15 +41,28 @@ In summary: spacing = 12px, border-width = 6px # CrumbsDialog # class CrumbsDialog(gtk.Dialog): + """ + A GNOME HIG compliant dialog widget. + Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons + """ + def __init__(self, title="", parent=None, flags=0, buttons=None): + super(CrumbsDialog, self).__init__(title, parent, flags, buttons) + + self.set_property("has-separator", False) # note: deprecated in 2.22 + + self.set_border_width(6) + self.vbox.set_property("spacing", 12) + self.action_area.set_property("spacing", 12) + self.action_area.set_property("border-width", 6) + +class CrumbsMessageDialog(CrumbsDialog): """ A GNOME HIG compliant dialog widget. Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons """ def __init__(self, parent=None, label="", icon=gtk.STOCK_INFO): - super(CrumbsDialog, self).__init__("", parent, gtk.DIALOG_DESTROY_WITH_PARENT) + super(CrumbsMessageDialog, self).__init__("", parent, gtk.DIALOG_DESTROY_WITH_PARENT) - #self.set_property("has-separator", False) # note: deprecated in 2.22 - self.set_border_width(6) self.vbox.set_property("spacing", 12) self.action_area.set_property("spacing", 12) @@ -839,7 +852,7 @@ class LayerSelectionDialog (gtk.Dialog): else: layer_store.append([path]) return - dialog = CrumbsDialog(parent, lbl) + dialog = CrumbsMessageDialog(parent, lbl) dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) response = dialog.run() dialog.destroy() -- cgit v1.2.3-54-g00ecf