Patchwork [bitbake-devel,8/9] lib/bb/ui/crumbs: make use of HobButton for existing primary action buttons

login
register
mail settings
Submitter Joshua Lock
Date March 22, 2012, 11:31 p.m.
Message ID <e3d36acdee68f37cfd19cc6bb260434c6dc7597a.1332458487.git.josh@linux.intel.com>
Download mbox | patch
Permalink /patch/24217/
State Accepted
Commit f4dfdc23a6498fdaa164a1bfccf616ff8fcbd251
Headers show

Comments

Joshua Lock - March 22, 2012, 11:31 p.m.
Replace all gtk.Button instances that have the orange style applied with
HobButton.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/imageconfigurationpage.py |   12 +-----------
 lib/bb/ui/crumbs/imagedetailspage.py       |   11 ++---------
 lib/bb/ui/crumbs/packageselectionpage.py   |   11 ++---------
 lib/bb/ui/crumbs/recipeselectionpage.py    |   11 ++---------
 4 files changed, 7 insertions(+), 38 deletions(-)

Patch

diff --git a/lib/bb/ui/crumbs/imageconfigurationpage.py b/lib/bb/ui/crumbs/imageconfigurationpage.py
index 836bd0a..da758a3 100644
--- a/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -223,19 +223,9 @@  class ImageConfigurationPage (HobPage):
         button_box = gtk.HBox(False, 6)
 
         # create button "Just bake"
-        just_bake_button = gtk.Button()
-        label = gtk.Label()
-        mark = "<span %s>Just bake</span>" % self.span_tag('24px', 'bold')
-        label.set_markup(mark)
-
-        just_bake_button.set_image(label)
+        just_bake_button = HobButton("Just bake")
         just_bake_button.set_size_request(205, 49)
-        just_bake_button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.ORANGE))
-        just_bake_button.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.Color(HobColors.ORANGE))
-        just_bake_button.modify_bg(gtk.STATE_SELECTED, gtk.gdk.Color(HobColors.ORANGE))
         just_bake_button.set_tooltip_text("Build image to get your target image")
-        just_bake_button.set_flags(gtk.CAN_DEFAULT)
-        just_bake_button.grab_default()
         just_bake_button.connect("clicked", self.just_bake_button_clicked_cb)
         button_box.pack_end(just_bake_button, expand=False, fill=False)
 
diff --git a/lib/bb/ui/crumbs/imagedetailspage.py b/lib/bb/ui/crumbs/imagedetailspage.py
index 9213255..07a6eb0 100755
--- a/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/lib/bb/ui/crumbs/imagedetailspage.py
@@ -23,7 +23,7 @@ 
 import gobject
 import gtk
 from bb.ui.crumbs.hobcolor import HobColors
-from bb.ui.crumbs.hobwidget import hic, HobViewTable, HobAltButton
+from bb.ui.crumbs.hobwidget import hic, HobViewTable, HobAltButton, HobButton
 from bb.ui.crumbs.hobpages import HobPage
 
 #
@@ -264,15 +264,8 @@  class ImageDetailsPage (HobPage):
         # create button "Deploy image"
         name = "Deploy image"
         if name in buttonlist:
-            deploy_button = gtk.Button()
-            label = gtk.Label()
-            mark = "<span %s>Deploy image</span>" % self.span_tag('24px', 'bold')
-            label.set_markup(mark)
-            deploy_button.set_image(label)
+            deploy_button = HobButton('Deploy image')
             deploy_button.set_size_request(205, 49)
-            deploy_button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.ORANGE))
-            deploy_button.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.Color(HobColors.ORANGE))
-            deploy_button.modify_bg(gtk.STATE_SELECTED, gtk.gdk.Color(HobColors.ORANGE))
             deploy_button.set_tooltip_text("Deploy image to get your target board")
             deploy_button.set_flags(gtk.CAN_DEFAULT)
             deploy_button.grab_default()
diff --git a/lib/bb/ui/crumbs/packageselectionpage.py b/lib/bb/ui/crumbs/packageselectionpage.py
index cfec6d4..67ae5d1 100755
--- a/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/lib/bb/ui/crumbs/packageselectionpage.py
@@ -23,7 +23,7 @@ 
 import gtk
 import glib
 from bb.ui.crumbs.hobcolor import HobColors
-from bb.ui.crumbs.hobwidget import HobViewTable, HobNotebook, HobAltButton
+from bb.ui.crumbs.hobwidget import HobViewTable, HobNotebook, HobAltButton, HobButton
 from bb.ui.crumbs.hoblistmodel import PackageListModel
 from bb.ui.crumbs.hobpages import HobPage
 
@@ -129,15 +129,8 @@  class PackageSelectionPage (HobPage):
         button_box = gtk.HBox(False, 6)
         self.box_group_area.pack_start(button_box, expand=False, fill=False)
 
-        self.build_image_button = gtk.Button()
-        label = gtk.Label()
-        mark = "<span %s>Build image</span>" % self.span_tag('24px', 'bold')
-        label.set_markup(mark)
-        self.build_image_button.set_image(label)
+        self.build_image_button = HobButton('Build image')
         self.build_image_button.set_size_request(205, 49)
-        self.build_image_button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.ORANGE))
-        self.build_image_button.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.Color(HobColors.ORANGE))
-        self.build_image_button.modify_bg(gtk.STATE_SELECTED, gtk.gdk.Color(HobColors.ORANGE))
         self.build_image_button.set_tooltip_text("Build image to get your target image")
         self.build_image_button.set_flags(gtk.CAN_DEFAULT)
         self.build_image_button.grab_default()
diff --git a/lib/bb/ui/crumbs/recipeselectionpage.py b/lib/bb/ui/crumbs/recipeselectionpage.py
index 348dfec..881b2ec 100755
--- a/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -23,7 +23,7 @@ 
 import gtk
 import glib
 from bb.ui.crumbs.hobcolor import HobColors
-from bb.ui.crumbs.hobwidget import HobViewTable, HobNotebook, HobAltButton
+from bb.ui.crumbs.hobwidget import HobViewTable, HobNotebook, HobAltButton, HobButton
 from bb.ui.crumbs.hoblistmodel import RecipeListModel
 from bb.ui.crumbs.hobpages import HobPage
 
@@ -151,15 +151,8 @@  class RecipeSelectionPage (HobPage):
         button_box = gtk.HBox(False, 6)
         self.box_group_area.pack_end(button_box, expand=False, fill=False)
 
-        self.build_packages_button = gtk.Button()
-        label = gtk.Label()
-        mark = "<span %s>Build packages</span>" % self.span_tag('24px', 'bold')
-        label.set_markup(mark)
-        self.build_packages_button.set_image(label)
+        self.build_packages_button = HobButton('Build packages')
         self.build_packages_button.set_size_request(205, 49)
-        self.build_packages_button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.ORANGE))
-        self.build_packages_button.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.Color(HobColors.ORANGE))
-        self.build_packages_button.modify_bg(gtk.STATE_SELECTED, gtk.gdk.Color(HobColors.ORANGE))
         self.build_packages_button.set_tooltip_text("Build packages for customization")
         self.build_packages_button.set_flags(gtk.CAN_DEFAULT)
         self.build_packages_button.grab_default()