All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/21] [Resend] Hob fixes and cleanups
@ 2012-04-09 14:09 Shane Wang
  2012-04-09 14:13 ` [PATCH 01/21] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
                   ` (21 more replies)
  0 siblings, 22 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:09 UTC (permalink / raw)
  To: bitbake-devel

Those patches fix the following:
  - the UI bug to fade out the entry in the "Included" page when it is removed
  - add and correct tooltips reviewed by Scott
  - clean up the code and maximize reusage, for exception handling
  - misc

The following changes since commit 190f6d791d51aaa4cfb9f1cf932bc205ff674fb5:

  runqemu-internal: Add console=tty for qemuppc and NFS (2012-04-06 01:12:47 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib shane/hob-fixes-continue
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob-fixes-continue

Liming An (4):
  Hob: add fadeout display effection for recipe view include page
  Hob: add fadeout display effection for package view include page
  Hob: Add the tooltips for recipe view page as request
  Hob:Fixed some incorrect values of Build configuration tab

Shane Wang (17):
  Hob: fix version check - Hob can run on pygtk 2.21.0
  Hob: correct indent
  Hob: clean up and unify the steps for new build to call
    initiate_new_build_async()
  Hob: clean up and unify the steps for CONFIG_UPDATE to call
    update_config_async()
  Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call
    populate_recipe_package_info_async()
  Hob: clean up and unify the steps for PACKAGE_GENERATING and
    FAST_IMAGE_GENERATING to call generate_packages_async() and
    fast_generate_image_async()
  Hob: clean up and unify the steps for IMAGE_GENERATING to call
    generate_image_async()
  Hob: clean up to call clear_busy() in hobeventhandler.py
  Hob: clean up and unify get_parameters() to be get_parameters_sync()
  Hob: clean up request_package_info_async()
  Hob: clean up cancel_build()
  Hob: clean up generate_configuration()
  Hob: clean up and reword stop_parse()
  Hob: tooltip change for "Build image" button
  Hob: add tooltips into image details screen
  Hob: forget selected_recipes and selected_packages after users change
    the machine
  Hob: show those appliable buttons on the image details page only

 bitbake/lib/bb/ui/crumbs/builddetailspage.py       |   20 ++-
 bitbake/lib/bb/ui/crumbs/builder.py                |  164 +++++++++++---------
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py        |    7 +-
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py           |   35 ++++-
 bitbake/lib/bb/ui/crumbs/hobwidget.py              |  155 ++++++++++++++++---
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   30 +++-
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py       |  136 +++++++++++-----
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py   |   54 ++++++-
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |   58 ++++++-
 bitbake/lib/bb/ui/hob.py                           |    2 +-
 10 files changed, 482 insertions(+), 179 deletions(-)

-- 
1.7.6




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 01/21] Hob: fix version check - Hob can run on pygtk 2.21.0
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 16:47   ` Joshua Lock
  2012-04-09 14:13 ` [PATCH 02/21] Hob: add fadeout display effection for recipe view include page Shane Wang
                   ` (20 subsequent siblings)
  21 siblings, 1 reply; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/hob.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index 1321ebb..61df300 100755
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -29,7 +29,7 @@ try:
     import pygtk
     pygtk.require('2.0') # to be certain we don't have gtk+ 1.x !?!
     ver = gtk.pygtk_version
-    if ver  < (2, 22, 0):
+    if ver  < (2, 21, 0):
         sys.exit("%s (you have pygtk %s.%s.%s)." % (requirements, ver[0], ver[1], ver[2]))
 except ImportError as exc:
     sys.exit("%s (%s)." % (requirements, str(exc)))
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 02/21] Hob: add fadeout display effection for recipe view include page
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
  2012-04-09 14:13 ` [PATCH 01/21] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 03/21] Hob: add fadeout display effection for package " Shane Wang
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

From: Liming An <limingx.l.an@intel.com>

As UI request, in recipes selection page, if user exclude a item,
the related depends recipes will be excluded together,so the view
clearly to add it.

[YOCTO #2100]

Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py        |   22 +++-
 bitbake/lib/bb/ui/crumbs/hobwidget.py           |  129 +++++++++++++++++++----
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py |   50 ++++++++-
 3 files changed, 166 insertions(+), 35 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 4934ba8..523a591 100644
--- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
@@ -34,7 +34,7 @@ class PackageListModel(gtk.TreeStore):
     providing convenience functions to access gtk.TreeModel subclasses which
     provide filtered views of the data.
     """
-    (COL_NAME, COL_VER, COL_REV, COL_RNM, COL_SEC, COL_SUM, COL_RDEP, COL_RPROV, COL_SIZE, COL_BINB, COL_INC) = range(11)
+    (COL_NAME, COL_VER, COL_REV, COL_RNM, COL_SEC, COL_SUM, COL_RDEP, COL_RPROV, COL_SIZE, COL_BINB, COL_INC, COL_FADE_INC) = range(12)
 
     __gsignals__ = {
         "package-selection-changed" : (gobject.SIGNAL_RUN_LAST,
@@ -62,6 +62,7 @@ class PackageListModel(gtk.TreeStore):
                                 gobject.TYPE_STRING,
                                 gobject.TYPE_STRING,
                                 gobject.TYPE_STRING,
+                                gobject.TYPE_BOOLEAN,
                                 gobject.TYPE_BOOLEAN)
 
 
@@ -437,7 +438,7 @@ class RecipeListModel(gtk.ListStore):
     providing convenience functions to access gtk.TreeModel subclasses which
     provide filtered views of the data.
     """
-    (COL_NAME, COL_DESC, COL_LIC, COL_GROUP, COL_DEPS, COL_BINB, COL_TYPE, COL_INC, COL_IMG, COL_INSTALL, COL_PN) = range(11)
+    (COL_NAME, COL_DESC, COL_LIC, COL_GROUP, COL_DEPS, COL_BINB, COL_TYPE, COL_INC, COL_IMG, COL_INSTALL, COL_PN, COL_FADE_INC) = range(12)
 
     __dummy_image__ = "Create your own image"
 
@@ -461,7 +462,8 @@ class RecipeListModel(gtk.ListStore):
                                 gobject.TYPE_BOOLEAN,
                                 gobject.TYPE_BOOLEAN,
                                 gobject.TYPE_STRING,
-                                gobject.TYPE_STRING)
+                                gobject.TYPE_STRING,
+                                gobject.TYPE_BOOLEAN)
 
     """
     Find the model path for the item_name
@@ -498,17 +500,25 @@ class RecipeListModel(gtk.ListStore):
 
         return True
 
+    def exclude_item_sort_func(self, model, iter1, iter2):
+        val1 = model.get_value(iter1, RecipeListModel.COL_FADE_INC)
+        val2 = model.get_value(iter2, RecipeListModel.COL_INC)
+        return ((val1 == True) and (val2 == False))
+
     """
     Create, if required, and return a filtered gtk.TreeModelSort
     containing only the items which are items specified by filter
     """
-    def tree_model(self, filter):
+    def tree_model(self, filter, excluded_items_head=False):
         model = self.filter_new()
         model.set_visible_func(self.tree_model_filter, filter)
 
         sort = gtk.TreeModelSort(model)
-        sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING)
-        sort.set_default_sort_func(None)
+        if excluded_items_head:
+            sort.set_default_sort_func(self.exclude_item_sort_func)
+        else:
+            sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING)
+            sort.set_default_sort_func(None)
         return sort
 
     def convert_vpath_to_path(self, view_model, view_path):
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py
index edb85db..41a59bd 100644
--- a/bitbake/lib/bb/ui/crumbs/hobwidget.py
+++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py
@@ -105,6 +105,11 @@ class HobViewTable (gtk.VBox):
                             gobject.TYPE_NONE,
                            (gobject.TYPE_PYOBJECT,
                             gobject.TYPE_PYOBJECT,)),
+         "cell-fadeinout-stopped" : (gobject.SIGNAL_RUN_LAST,
+                            gobject.TYPE_NONE,
+                           (gobject.TYPE_PYOBJECT,
+                            gobject.TYPE_PYOBJECT,
+                            gobject.TYPE_PYOBJECT,)),
     }
 
     def __init__(self, columns):
@@ -134,9 +139,10 @@ class HobViewTable (gtk.VBox):
                 col.pack_start(cell, True)
                 col.set_attributes(cell, text=column['col_id'])
             elif column['col_style'] == 'check toggle':
-                cell = gtk.CellRendererToggle()
+                cell = HobCellRendererToggle()
                 cell.set_property('activatable', True)
                 cell.connect("toggled", self.toggled_cb, i, self.table_tree)
+                cell.connect_render_state_changed(self.stop_cell_fadeinout_cb, self.table_tree)
                 self.toggle_id = i
                 col.pack_end(cell, True)
                 col.set_attributes(cell, active=column['col_id'])
@@ -180,6 +186,9 @@ class HobViewTable (gtk.VBox):
         if not view_column.get_title() in self.toggle_columns:
             self.emit("row-activated", tree.get_model(), path)
 
+    def stop_cell_fadeinout_cb(self, ctrl, cell, tree):
+        self.emit("cell-fadeinout-stopped", ctrl, cell, tree)
+
 """
 A method to calculate a softened value for the colour of widget when in the
 provided state.
@@ -843,14 +852,23 @@ class HobIconChecker(hic):
 
         return valid_stock_id
 
-class RefreshRuningController(gobject.GObject):
-    def __init__(self, widget=None, iter=None):
+class HobCellRendererController(gobject.GObject):
+    (MODE_CYCLE_RUNNING, MODE_ONE_SHORT) = range(2)
+    __gsignals__ = {
+        "run-timer-stopped" : (gobject.SIGNAL_RUN_LAST,
+                                gobject.TYPE_NONE,
+                                ()),
+    }
+    def __init__(self, runningmode=MODE_CYCLE_RUNNING, is_draw_row=False):
         gobject.GObject.__init__(self)
         self.timeout_id = None
         self.current_angle_pos = 0.0
         self.step_angle = 0.0
         self.tree_headers_height = 0
         self.running_cell_areas = []
+        self.running_mode = runningmode
+        self.is_queue_draw_row_area = is_draw_row
+        self.force_stop_enable = False
 
     def is_active(self):
         if self.timeout_id:
@@ -858,10 +876,10 @@ class RefreshRuningController(gobject.GObject):
         else:
             return False
 
-    def reset(self):
-        self.force_stop(True)
+    def reset_run(self):
+        self.force_stop()
+        self.running_cell_areas = []
         self.current_angle_pos = 0.0
-        self.timeout_id = None
         self.step_angle = 0.0
 
     ''' time_iterval: (1~1000)ms, which will be as the basic interval count for timer
@@ -881,15 +899,16 @@ class RefreshRuningController(gobject.GObject):
         self.timeout_id = gobject.timeout_add(int(time_iterval),
         self.make_image_on_progressing_cb, tree)
         self.tree_headers_height = self.get_treeview_headers_height(tree)
+        self.force_stop_enable = False
 
-    def force_stop(self, after_hide_or_not=False):
+    def force_stop(self):
+        self.emit("run-timer-stopped")
+        self.force_stop_enable = True
         if self.timeout_id:
-            gobject.source_remove(self.timeout_id)
-            self.timeout_id = None
-        if self.running_cell_areas:
-            self.running_cell_areas = []
+            if gobject.source_remove(self.timeout_id):
+                self.timeout_id = None
 
-    def on_draw_cb(self, pixbuf, cr, x, y, img_width, img_height, do_refresh=True):
+    def on_draw_pixbuf_cb(self, pixbuf, cr, x, y, img_width, img_height, do_refresh=True):
         if pixbuf:
             r = max(img_width/2, img_height/2)
             cr.translate(x + r, y + r)
@@ -899,6 +918,16 @@ class RefreshRuningController(gobject.GObject):
             cr.set_source_pixbuf(pixbuf, -img_width/2, -img_height/2)
             cr.paint()
 
+    def on_draw_fadeinout_cb(self, cr, color, x, y, width, height, do_fadeout=True):
+        if do_fadeout:
+            alpha = self.current_angle_pos * 0.8
+        else:
+            alpha = (1.0 - self.current_angle_pos) * 0.8
+
+        cr.set_source_rgba(color.red, color.green, color.blue, alpha)
+        cr.rectangle(x, y, width, height)
+        cr.fill()
+
     def get_treeview_headers_height(self, tree):
         if tree and (tree.get_property("headers-visible") == True):
             height = tree.get_allocation().height - tree.get_bin_window().get_size()[1]
@@ -908,13 +937,24 @@ class RefreshRuningController(gobject.GObject):
 
     def make_image_on_progressing_cb(self, tree):
         self.current_angle_pos += self.step_angle
-        if (self.current_angle_pos >= 1):
-            self.current_angle_pos = self.step_angle
-
-        for rect in self.running_cell_areas:
-            tree.queue_draw_area(rect.x, rect.y + self.tree_headers_height, rect.width, rect.height)
+        if self.running_mode == self.MODE_CYCLE_RUNNING:
+            if (self.current_angle_pos >= 1):
+                self.current_angle_pos = self.step_angle
+        else:
+            if self.current_angle_pos > 1:
+                self.force_stop()
+                return False
+
+        if self.is_queue_draw_row_area:
+            for path in self.running_cell_areas:
+                rect = tree.get_cell_area(path, tree.get_column(0))
+                row_x, _, row_width, _ = tree.get_visible_rect()
+                tree.queue_draw_area(row_x, rect.y + self.tree_headers_height, row_width, rect.height)
+        else:
+            for rect in self.running_cell_areas:
+                tree.queue_draw_area(rect.x, rect.y + self.tree_headers_height, rect.width, rect.height)
 
-        return True
+        return (not self.force_stop_enable)
 
     def append_running_cell_area(self, cell_area):
         if cell_area and (cell_area not in self.running_cell_areas):
@@ -924,14 +964,14 @@ class RefreshRuningController(gobject.GObject):
         if cell_area in self.running_cell_areas:
             self.running_cell_areas.remove(cell_area)
         if not self.running_cell_areas:
-            self.reset()
+            self.reset_run()
 
-gobject.type_register(RefreshRuningController)
+gobject.type_register(HobCellRendererController)
 
 class HobCellRendererPixbuf(gtk.CellRendererPixbuf):
     def __init__(self):
         gtk.CellRendererPixbuf.__init__(self)
-        self.control = RefreshRuningController()
+        self.control = HobCellRendererController()
         # add icon checker for make the gtk-icon transfer to hob-icon
         self.checker = HobIconChecker()
         self.set_property("stock-size", gtk.ICON_SIZE_DND)
@@ -982,12 +1022,12 @@ class HobCellRendererPixbuf(gtk.CellRendererPixbuf):
         if stock_id == 'hic-task-refresh':
             self.control.append_running_cell_area(cell_area)
             if self.control.is_active():
-                self.control.on_draw_cb(pix, window.cairo_create(), x, y, w, h, True)
+                self.control.on_draw_pixbuf_cb(pix, window.cairo_create(), x, y, w, h, True)
             else:
                 self.control.start_run(200, 0, 0, 1000, 200, tree)
         else:
             self.control.remove_running_cell_area(cell_area)
-            self.control.on_draw_cb(pix, window.cairo_create(), x, y, w, h, False)
+            self.control.on_draw_pixbuf_cb(pix, window.cairo_create(), x, y, w, h, False)
 
     def on_get_size(self, widget, cell_area):
         if self.props.icon_name or self.props.pixbuf or self.props.stock_id:
@@ -1005,3 +1045,46 @@ class HobCellRendererPixbuf(gtk.CellRendererPixbuf):
         return 0, 0, 0, 0
 
 gobject.type_register(HobCellRendererPixbuf)
+
+class HobCellRendererToggle(gtk.CellRendererToggle):
+    def __init__(self):
+        gtk.CellRendererToggle.__init__(self)
+        self.ctrl = HobCellRendererController(is_draw_row=True)
+        self.ctrl.running_mode = self.ctrl.MODE_ONE_SHORT
+        self.cell_attr = {"fadeout": False}
+
+    def do_render(self, window, widget, background_area, cell_area, expose_area, flags):
+        if (not self.ctrl) or (not widget):
+            return
+        if self.ctrl.is_active():
+            path = widget.get_path_at_pos(cell_area.x + cell_area.width/2, cell_area.y + cell_area.height/2)[0]
+            if path in self.ctrl.running_cell_areas:
+                cr = window.cairo_create()
+                color = gtk.gdk.Color(HobColors.WHITE)
+
+                row_x, _, row_width, _ = widget.get_visible_rect()
+                border_y = self.get_property("ypad")
+                self.ctrl.on_draw_fadeinout_cb(cr, color, row_x, cell_area.y - border_y, row_width, \
+                                               cell_area.height + border_y * 2, self.cell_attr["fadeout"])
+
+        return gtk.CellRendererToggle.do_render(self, window, widget, background_area, cell_area, expose_area, flags)
+
+    '''delay: normally delay time is 1000ms
+       cell_list: whilch cells need to be render
+    '''
+    def fadeout(self, tree, delay, cell_list=None):
+        if (delay < 200) or (not tree):
+            return
+        self.cell_attr["fadeout"] = True
+        self.ctrl.running_cell_areas = cell_list
+        self.ctrl.start_run(200, 0, 0, delay, (delay * 200 / 1000), tree)
+
+    def connect_render_state_changed(self, func, usrdata=None):
+        if not func:
+            return
+        if usrdata:
+            self.ctrl.connect("run-timer-stopped", func, self, usrdata)
+        else:
+            self.ctrl.connect("run-timer-stopped", func, self)
+
+gobject.type_register(HobCellRendererToggle)
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index e4616a8..0568032 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -132,10 +132,10 @@ class RecipeSelectionPage (HobPage):
             tab = HobViewTable(columns)
             filter = page['filter']
             tab.set_model(self.recipe_model.tree_model(filter))
-            tab.connect("toggled", self.table_toggled_cb)
+            tab.connect("toggled", self.table_toggled_cb, page['name'])
             if page['name'] == "Included":
                 tab.connect("row-activated", self.tree_row_activated_cb)
-
+                tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
             label = gtk.Label(page['name'])
             self.ins.append_page(tab, label)
             self.tables.append(tab)
@@ -180,18 +180,56 @@ class RecipeSelectionPage (HobPage):
         self.label.set_text("Recipes included: %s" % len(self.builder.configuration.selected_recipes))
         self.ins.show_indicator_icon("Included", len(self.builder.configuration.selected_recipes))
 
-    def toggle_item_idle_cb(self, path):
+    def toggle_item_idle_cb(self, path, view_tree, cell, pagename):
         if not self.recipe_model.path_included(path):
             self.recipe_model.include_item(item_path=path, binb="User Selected", image_contents=False)
         else:
-            self.recipe_model.exclude_item(item_path=path)
+            if pagename == "Included":
+                self.pre_fadeout_checkout_include(view_tree)
+                self.recipe_model.exclude_item(item_path=path)
+                self.render_fadeout(view_tree, cell)
+            else:
+                self.recipe_model.exclude_item(item_path=path)
 
         self.refresh_selection()
         self.builder.window_sensitive(True)
 
-    def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree):
+    def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename):
         # Click to include a recipe
         self.builder.window_sensitive(False)
         view_model = view_tree.get_model()
         path = self.recipe_model.convert_vpath_to_path(view_model, view_path)
-        glib.idle_add(self.toggle_item_idle_cb, path)
+        glib.idle_add(self.toggle_item_idle_cb, path, view_tree, cell, pagename)
+
+    def pre_fadeout_checkout_include(self, tree):
+        #resync the included items to a backup fade include column
+        it = self.recipe_model.get_iter_first()
+        while it:
+            active = self.recipe_model.get_value(it, self.recipe_model.COL_INC)
+            self.recipe_model.set(it, self.recipe_model.COL_FADE_INC, active)
+            it = self.recipe_model.iter_next(it)
+        # Check out a model which base on the column COL_FADE_INC,
+        # it's save the prev state of column COL_INC before do exclude_item
+        filter = { RecipeListModel.COL_FADE_INC  : [True],
+                   RecipeListModel.COL_TYPE      : ['recipe', 'task'] }
+        new_model = self.recipe_model.tree_model(filter, excluded_items_head=True)
+        tree.set_model(new_model)
+
+    def render_fadeout(self, tree, cell):
+        if (not cell) or (not tree):
+            return
+        to_render_cells = []
+        model = tree.get_model()
+        it = model.get_iter_first()
+        while it:
+            path = model.get_path(it)
+            prev_cell_is_active = model.get_value(it, RecipeListModel.COL_FADE_INC)
+            curr_cell_is_active = model.get_value(it, RecipeListModel.COL_INC)
+            if (prev_cell_is_active == True) and (curr_cell_is_active == False):
+                to_render_cells.append(path)
+            it = model.iter_next(it)
+
+        cell.fadeout(tree, 1000, to_render_cells)
+
+    def after_fadeout_checkin_include(self, table, ctrl, cell, tree):
+        tree.set_model(self.recipe_model.tree_model(self.pages[0]['filter']))
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 03/21] Hob: add fadeout display effection for package view include page
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
  2012-04-09 14:13 ` [PATCH 01/21] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
  2012-04-09 14:13 ` [PATCH 02/21] Hob: add fadeout display effection for recipe view include page Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 04/21] Hob: Add the tooltips for recipe view page as request Shane Wang
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

From: Liming An <limingx.l.an@intel.com>

[YOCTO #2100]

Signed-off-by: Liming An <limingx.l.an@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py         |   17 ++++++-
 bitbake/lib/bb/ui/crumbs/hobwidget.py            |    6 ++-
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py |   52 +++++++++++++++++++---
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py  |    2 +-
 4 files changed, 67 insertions(+), 10 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 523a591..f5e3740 100644
--- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
@@ -428,6 +428,19 @@ class PackageListModel(gtk.TreeStore):
 
         self.selection_change_notification()
 
+    """
+    Resync the state of included items to a backup column before performing the fadeout visible effect
+    """
+    def resync_fadeout_column(self, model_first_iter=None):
+        it = model_first_iter
+        while it:
+            active = self.get_value(it, self.COL_INC)
+            self.set(it, self.COL_FADE_INC, active)
+            if self.iter_has_child(it):
+                self.resync_fadeout_column(self.iter_children(it))
+
+            it = self.iter_next(it)
+
 #
 # RecipeListModel
 #
@@ -509,12 +522,12 @@ class RecipeListModel(gtk.ListStore):
     Create, if required, and return a filtered gtk.TreeModelSort
     containing only the items which are items specified by filter
     """
-    def tree_model(self, filter, excluded_items_head=False):
+    def tree_model(self, filter, excluded_items_ahead=False):
         model = self.filter_new()
         model.set_visible_func(self.tree_model_filter, filter)
 
         sort = gtk.TreeModelSort(model)
-        if excluded_items_head:
+        if excluded_items_ahead:
             sort.set_default_sort_func(self.exclude_item_sort_func)
         else:
             sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING)
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py
index 41a59bd..21836f7 100644
--- a/bitbake/lib/bb/ui/crumbs/hobwidget.py
+++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py
@@ -1057,7 +1057,11 @@ class HobCellRendererToggle(gtk.CellRendererToggle):
         if (not self.ctrl) or (not widget):
             return
         if self.ctrl.is_active():
-            path = widget.get_path_at_pos(cell_area.x + cell_area.width/2, cell_area.y + cell_area.height/2)[0]
+            path = widget.get_path_at_pos(cell_area.x + cell_area.width/2, cell_area.y + cell_area.height/2)
+            # sometimes the parameters of cell_area will be a negative number,such as pull up down the scroll bar
+            # it's over the tree container range, so the path will be bad
+            if not path: return
+            path = path[0]
             if path in self.ctrl.running_cell_areas:
                 cr = window.cairo_create()
                 color = gtk.gdk.Color(HobColors.WHITE)
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index 7926636..8391e29 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -110,10 +110,10 @@ class PackageSelectionPage (HobPage):
             tab = HobViewTable(columns)
             filter = page['filter']
             tab.set_model(self.package_model.tree_model(filter))
-            tab.connect("toggled", self.table_toggled_cb)
+            tab.connect("toggled", self.table_toggled_cb, page['name'])
             if page['name'] == "Included":
                 tab.connect("row-activated", self.tree_row_activated_cb)
-
+                tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
             label = gtk.Label(page['name'])
             self.ins.append_page(tab, label)
             self.tables.append(tab)
@@ -176,18 +176,58 @@ class PackageSelectionPage (HobPage):
                             (selected_packages_num, selected_packages_size_str, image_total_size_str))
         self.ins.show_indicator_icon("Included", selected_packages_num)
 
-    def toggle_item_idle_cb(self, path):
+    def toggle_item_idle_cb(self, path, view_tree, cell, pagename):
         if not self.package_model.path_included(path):
             self.package_model.include_item(item_path=path, binb="User Selected")
         else:
-            self.package_model.exclude_item(item_path=path)
+            if pagename == "Included":
+                self.pre_fadeout_checkout_include(view_tree)
+                self.package_model.exclude_item(item_path=path)
+                self.render_fadeout(view_tree, cell)
+            else:
+                self.package_model.exclude_item(item_path=path)
 
         self.refresh_selection()
         self.builder.window_sensitive(True)
 
-    def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree):
+    def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename):
         # Click to include a package
         self.builder.window_sensitive(False)
         view_model = view_tree.get_model()
         path = self.package_model.convert_vpath_to_path(view_model, view_path)
-        glib.idle_add(self.toggle_item_idle_cb, path)
+        glib.idle_add(self.toggle_item_idle_cb, path, view_tree, cell, pagename)
+
+    def pre_fadeout_checkout_include(self, tree):
+        self.package_model.resync_fadeout_column(self.package_model.get_iter_first())
+        # Check out a model which base on the column COL_FADE_INC,
+        # it's save the prev state of column COL_INC before do exclude_item
+        filter = { PackageListModel.COL_FADE_INC  : [True]}
+        new_model = self.package_model.tree_model(filter)
+        tree.set_model(new_model)
+        tree.expand_all()
+
+    def get_excluded_rows(self, to_render_cells, model, it):
+        while it:
+            path = model.get_path(it)
+            prev_cell_is_active = model.get_value(it, PackageListModel.COL_FADE_INC)
+            curr_cell_is_active = model.get_value(it, PackageListModel.COL_INC)
+            if (prev_cell_is_active == True) and (curr_cell_is_active == False):
+                to_render_cells.append(path)
+            if model.iter_has_child(it):
+                self.get_excluded_rows(to_render_cells, model, model.iter_children(it))
+            it = model.iter_next(it)
+
+        return to_render_cells
+
+    def render_fadeout(self, tree, cell):
+        if (not cell) or (not tree):
+            return
+        to_render_cells = []
+        view_model = tree.get_model()
+        self.get_excluded_rows(to_render_cells, view_model, view_model.get_iter_first())
+
+        cell.fadeout(tree, 1000, to_render_cells)
+
+    def after_fadeout_checkin_include(self, table, ctrl, cell, tree):
+        tree.set_model(self.package_model.tree_model(self.pages[0]['filter']))
+        tree.expand_all()
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index 0568032..a2f7982 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -212,7 +212,7 @@ class RecipeSelectionPage (HobPage):
         # it's save the prev state of column COL_INC before do exclude_item
         filter = { RecipeListModel.COL_FADE_INC  : [True],
                    RecipeListModel.COL_TYPE      : ['recipe', 'task'] }
-        new_model = self.recipe_model.tree_model(filter, excluded_items_head=True)
+        new_model = self.recipe_model.tree_model(filter, excluded_items_ahead=True)
         tree.set_model(new_model)
 
     def render_fadeout(self, tree, cell):
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 04/21] Hob: Add the tooltips for recipe view page as request
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (2 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 03/21] Hob: add fadeout display effection for package " Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 05/21] Hob: correct indent Shane Wang
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

From: Liming An <limingx.l.an@intel.com>

[YOCTO #2229]

Signed-off-by: Liming An <limingx.l.an@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hobwidget.py           |   22 ++++++++++++++++++++--
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py |    8 ++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py
index 21836f7..b79edce 100644
--- a/bitbake/lib/bb/ui/crumbs/hobwidget.py
+++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py
@@ -410,6 +410,7 @@ class HobTabBar(gtk.DrawingArea):
         self.connect("expose-event", self.on_draw)
         self.connect("button-press-event", self.button_pressed_cb)
         self.connect("button-release-event", self.button_released_cb)
+        self.connect("query-tooltip", self.query_tooltip_cb)
         self.show_all()
 
     def button_released_cb(self, widget, event):
@@ -473,7 +474,7 @@ class HobTabBar(gtk.DrawingArea):
             child["g"] = color.green
             child["b"] = color.blue
 
-    def append_tab_child(self, title, page):
+    def append_tab_child(self, title, page, tooltip=""):
         num = len(self.children) + 1
         self.tab_width = self.tab_width * len(self.children) / num
 
@@ -498,8 +499,11 @@ class HobTabBar(gtk.DrawingArea):
             "title"        : title,
             "indicator_show"   : False,
             "indicator_number" : 0,
+            "tooltip_markup"   : tooltip,
         }
         self.children.append(new_one)
+        if tooltip and (not self.props.has_tooltip):
+            self.props.has_tooltip = True
         # set the default current child
         if not self.current_child:
             self.current_child = new_one
@@ -668,6 +672,18 @@ class HobTabBar(gtk.DrawingArea):
 
         return gtk.gdk.Rectangle(x, y, w, h)
 
+    def query_tooltip_cb(self, widget, x, y, keyboardtip, tooltip):
+        if keyboardtip or (not tooltip):
+            return False
+        # check which tab be clicked
+        for child in self.children:
+           if      (child["x"] < x) and (x < child["x"] + self.tab_width) \
+               and (child["y"] < y) and (y < child["y"] + self.tab_height):
+               tooltip.set_markup(child["tooltip_markup"])
+               return True
+
+        return False
+
 class HobNotebook(gtk.VBox):
 
     def __init__(self):
@@ -752,13 +768,15 @@ class HobNotebook(gtk.VBox):
         if not notebook:
             return
         title = notebook.get_tab_label_text(notebook_child)
+        label = notebook.get_tab_label(notebook_child)
+        tooltip_markup = label.get_tooltip_markup()
         if not title:
             return
         for child in self.tabbar.children:
             if child["title"] == title:
                 child["toggled_page"] = page
                 return
-        self.tabbar.append_tab_child(title, page)
+        self.tabbar.append_tab_child(title, page, tooltip_markup)
 
     def page_removed_cb(self, notebook, notebook_child, page, title=""):
         for child in self.tabbar.children:
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index a2f7982..ea32fb0 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -34,6 +34,7 @@ class RecipeSelectionPage (HobPage):
     pages = [
         {
          'name'    : 'Included',
+         'tooltip' : 'The recipes currently included for your image',
          'filter'  : { RecipeListModel.COL_INC  : [True],
                        RecipeListModel.COL_TYPE : ['recipe', 'task'] },
          'columns' : [{
@@ -57,6 +58,7 @@ class RecipeSelectionPage (HobPage):
                       }]
         }, {
          'name'    : 'All recipes',
+         'tooltip' : 'All recipes available in the Yocto Project',
          'filter'  : { RecipeListModel.COL_TYPE : ['recipe'] },
          'columns' : [{
                        'col_name' : 'Recipe name',
@@ -85,6 +87,7 @@ class RecipeSelectionPage (HobPage):
                       }]
         }, {
          'name'    : 'Tasks',
+         'tooltip' : 'All tasks availabel in the Yocto Project',
          'filter'  : { RecipeListModel.COL_TYPE : ['task'] },
          'columns' : [{
                        'col_name' : 'Task name',
@@ -137,12 +140,17 @@ class RecipeSelectionPage (HobPage):
                 tab.connect("row-activated", self.tree_row_activated_cb)
                 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
             label = gtk.Label(page['name'])
+            label.set_selectable(False)
+            label.set_tooltip_text(page['tooltip'])
             self.ins.append_page(tab, label)
             self.tables.append(tab)
 
         self.ins.set_entry("Search recipes:")
         # set the search entry for each table
         for tab in self.tables:
+            search_tip = "Enter a recipe's or task's name to find it"
+            self.ins.search.set_tooltip_text(search_tip)
+            self.ins.search.props.has_tooltip = True
             tab.set_search_entry(0, self.ins.search)
 
         # add all into the window
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 05/21] Hob: correct indent
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (3 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 04/21] Hob: Add the tooltips for recipe view page as request Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 06/21] Hob: clean up and unify the steps for new build to call initiate_new_build_async() Shane Wang
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index dc2b1bb..d608b5f 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -243,8 +243,8 @@ class HobHandler(gobject.GObject):
         self.run_next_command(self.PARSE_CONFIG)
 
     def parse_generate_configuration(self):
-         self.commands_async.append(self.SUB_PARSE_CONFIG)
-         self.generate_configuration()
+        self.commands_async.append(self.SUB_PARSE_CONFIG)
+        self.generate_configuration()
 
     def set_extra_inherit(self, bbclass):
         inherits = self.server.runCommand(["getVariable", "INHERIT"]) or ""
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 06/21] Hob: clean up and unify the steps for new build to call initiate_new_build_async()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (4 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 05/21] Hob: correct indent Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 07/21] Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async() Shane Wang
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

initiate_new_build() (changed the function name into initiate_new_build_async()
to indicate it is an async function) or the similar sub-functions are called at
different places.

This patch is unify to call initiate_new_build_async().

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py          |   19 +++++++------------
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py |    2 +-
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index a3410d4..ef6f182 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -294,11 +294,7 @@ class Builder(gtk.Window):
         self.handler.connect("command-succeeded",        self.handler_command_succeeded_cb)
         self.handler.connect("command-failed",           self.handler_command_failed_cb)
 
-        self.handler.init_cooker()
-        self.handler.set_extra_inherit("image_types")
-        self.handler.parse_config()
-
-        self.switch_page(self.MACHINE_SELECTION)
+        self.initiate_new_build_async()
 
     def create_visual_elements(self):
         self.set_title("Hob")
@@ -334,6 +330,12 @@ class Builder(gtk.Window):
         self.show_all()
         self.nb.set_current_page(0)
 
+    def initiate_new_build_async(self):
+        self.switch_page(self.MACHINE_SELECTION)
+        self.handler.init_cooker()
+        self.handler.set_extra_inherit("image_types")
+        self.handler.parse_config()
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -987,13 +989,6 @@ class Builder(gtk.Window):
     def show_recipes(self):
         self.switch_page(self.RECIPE_SELECTION)
 
-    def initiate_new_build(self):
-        self.handler.init_cooker()
-        self.handler.set_extra_inherit("image_types")
-        self.handler.parse_config()
-        self.image_configuration_page.switch_machine_combo()
-        self.switch_page(self.MACHINE_SELECTION)
-
     def show_configuration(self):
         self.switch_page(self.BASEIMG_SELECTED)
 
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index b685d11..e550653 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -381,7 +381,7 @@ class ImageDetailsPage (HobPage):
         self.builder.runqemu_image(image_name)
 
     def build_new_button_clicked_cb(self, button):
-        self.builder.initiate_new_build()
+        self.builder.initiate_new_build_async()
 
     def edit_config_button_clicked_cb(self, button):
         self.builder.show_configuration()
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 07/21] Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (5 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 06/21] Hob: clean up and unify the steps for new build to call initiate_new_build_async() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 08/21] Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async() Shane Wang
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

For the steps in CONFIG_UPDATE, the patch consolidates them into
update_config_async() to call.
consequently remove CONFIG_UPDATE since MACHINE_SELECTION covers it.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index ef6f182..6b8e9f3 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -212,7 +212,6 @@ class Parameters:
 class Builder(gtk.Window):
 
     (MACHINE_SELECTION,
-     CONFIG_UPDATED,
      RCPPKGINFO_POPULATING,
      RCPPKGINFO_POPULATED,
      BASEIMG_SELECTED,
@@ -225,7 +224,7 @@ class Builder(gtk.Window):
      IMAGE_GENERATED,
      MY_IMAGE_OPENED,
      BACK,
-     END_NOOP) = range(15)
+     END_NOOP) = range(14)
 
     (IMAGE_CONFIGURATION,
      RECIPE_DETAILS,
@@ -236,7 +235,6 @@ class Builder(gtk.Window):
 
     __step2page__ = {
         MACHINE_SELECTION     : IMAGE_CONFIGURATION,
-        CONFIG_UPDATED        : IMAGE_CONFIGURATION,
         RCPPKGINFO_POPULATING : IMAGE_CONFIGURATION,
         RCPPKGINFO_POPULATED  : IMAGE_CONFIGURATION,
         BASEIMG_SELECTED      : IMAGE_CONFIGURATION,
@@ -336,6 +334,11 @@ class Builder(gtk.Window):
         self.handler.set_extra_inherit("image_types")
         self.handler.parse_config()
 
+    def update_config_async(self):
+        self.switch_page(self.MACHINE_SELECTION)
+        self.set_user_config()
+        self.handler.parse_generate_configuration()
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -345,7 +348,7 @@ class Builder(gtk.Window):
             if not os.path.exists(layer+'/conf/layer.conf'):
                 return False
 
-        self.switch_page(self.CONFIG_UPDATED)
+        self.update_config_async()
 
         self.template.destroy()
         self.template = None
@@ -373,12 +376,6 @@ class Builder(gtk.Window):
         if next_step == self.MACHINE_SELECTION: # init step
             self.image_configuration_page.show_machine()
 
-        elif next_step == self.CONFIG_UPDATED:
-            # after layers is changd by users
-            self.image_configuration_page.show_machine()
-            self.set_user_config()
-            self.handler.parse_generate_configuration()
-
         elif next_step == self.RCPPKGINFO_POPULATING:
             # MACHINE CHANGED action or SETTINGS CHANGED
             # show the progress bar
@@ -795,7 +792,7 @@ class Builder(gtk.Window):
             self.configuration.layers = dialog.layers
             # DO refresh layers
             if dialog.layers_changed:
-                self.switch_page(self.CONFIG_UPDATED)
+                self.update_config_async()
         dialog.destroy()
 
     def show_load_template_dialog(self):
@@ -886,7 +883,7 @@ class Builder(gtk.Window):
     def reparse_post_adv_settings(self):
         # DO reparse recipes
         if not self.configuration.curr_mach:
-            self.switch_page(self.CONFIG_UPDATED)
+            self.update_config_async()
         else:
             self.switch_page(self.RCPPKGINFO_POPULATING)
 
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 08/21] Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (6 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 07/21] Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 09/21] Hob: clean up and unify the steps for PACKAGE_GENERATING and FAST_IMAGE_GENERATING to call generate_packages_async() and fast_generate_image_async() Shane Wang
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

For the steps in RCPPKGINFO_POPULATING, This patch consolidates them into
populate_recipe_package_info_async() to call.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py                |   14 +++++++-------
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 6b8e9f3..a0ad5a0 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -339,6 +339,12 @@ class Builder(gtk.Window):
         self.set_user_config()
         self.handler.parse_generate_configuration()
 
+    def populate_recipe_package_info_async(self):
+        self.switch_page(self.RCPPKGINFO_POPULATING)
+        # Parse recipes
+        self.set_user_config()
+        self.handler.generate_recipes()
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -380,7 +386,6 @@ class Builder(gtk.Window):
             # MACHINE CHANGED action or SETTINGS CHANGED
             # show the progress bar
             self.image_configuration_page.show_info_populating()
-            self.generate_recipes()
 
         elif next_step == self.RCPPKGINFO_POPULATED:
             self.image_configuration_page.show_info_populated()
@@ -462,11 +467,6 @@ class Builder(gtk.Window):
         self.handler.reset_build()
         self.handler.generate_packages(all_recipes)
 
-    def generate_recipes(self):
-        # Parse recipes
-        self.set_user_config()
-        self.handler.generate_recipes()
-
     def generate_image(self):
         # Build image
         self.set_user_config()
@@ -885,7 +885,7 @@ class Builder(gtk.Window):
         if not self.configuration.curr_mach:
             self.update_config_async()
         else:
-            self.switch_page(self.RCPPKGINFO_POPULATING)
+            self.populate_recipe_package_info_async()
 
     def deploy_image(self, image_name):
         if not image_name:
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index d8cb752..204d1c6 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -259,7 +259,7 @@ class ImageConfigurationPage (HobPage):
 
         self.builder.configuration.curr_mach = combo_item
         # Do reparse recipes
-        self.builder.switch_page(self.builder.RCPPKGINFO_POPULATING)
+        self.builder.populate_recipe_package_info_async()
 
     def update_machine_combo(self):
         all_machines = self.builder.parameters.all_machines
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 09/21] Hob: clean up and unify the steps for PACKAGE_GENERATING and FAST_IMAGE_GENERATING to call generate_packages_async() and fast_generate_image_async()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (7 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 08/21] Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 10/21] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async() Shane Wang
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

For the steps in PACKAGE_GENERATING, the patch consolidates them into
generate_packages_async() to call.

For the steps in FAST_IMAGE_GENERATING, the patch also consolidates them
into fast_generate_image_async() to call.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index a0ad5a0..8a95b94 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -345,6 +345,22 @@ class Builder(gtk.Window):
         self.set_user_config()
         self.handler.generate_recipes()
 
+    def generate_packages_async(self):
+        self.switch_page(self.PACKAGE_GENERATING)
+        # Build packages
+        _, all_recipes = self.recipe_model.get_selected_recipes()
+        self.set_user_config()
+        self.handler.reset_build()
+        self.handler.generate_packages(all_recipes)
+
+    def fast_generate_image_async(self):
+        self.switch_page(self.FAST_IMAGE_GENERATING)
+        # Build packages
+        _, all_recipes = self.recipe_model.get_selected_recipes()
+        self.set_user_config()
+        self.handler.reset_build()
+        self.handler.generate_packages(all_recipes)
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -402,7 +418,6 @@ class Builder(gtk.Window):
         elif next_step == self.PACKAGE_GENERATING or next_step == self.FAST_IMAGE_GENERATING:
             # both PACKAGE_GENEATING and FAST_IMAGE_GENERATING share the same page
             self.build_details_page.show_page(next_step)
-            self.generate_packages()
 
         elif next_step == self.PACKAGE_GENERATED:
             pass
@@ -460,13 +475,6 @@ class Builder(gtk.Window):
         left = self.package_model.set_selected_packages(selected_packages)
         self.configuration.selected_packages += left
 
-    def generate_packages(self):
-        # Build packages
-        _, all_recipes = self.recipe_model.get_selected_recipes()
-        self.set_user_config()
-        self.handler.reset_build()
-        self.handler.generate_packages(all_recipes)
-
     def generate_image(self):
         # Build image
         self.set_user_config()
@@ -737,7 +745,7 @@ class Builder(gtk.Window):
             dialog.run()
             dialog.destroy()
             return
-        self.switch_page(self.PACKAGE_GENERATING)
+        self.generate_packages_async()
 
     def build_image(self):
         selected_packages = self.package_model.get_selected_packages()
@@ -767,7 +775,7 @@ class Builder(gtk.Window):
             dialog.destroy()
             return
 
-        self.switch_page(self.FAST_IMAGE_GENERATING)
+        self.fast_generate_image_async()
 
     def show_binb_dialog(self, binb):
         markup = "<b>Brought in by:</b>\n%s" % binb
@@ -977,7 +985,7 @@ class Builder(gtk.Window):
             response = dialog.run()
             dialog.destroy()
             if response == gtk.RESPONSE_YES:
-                self.switch_page(self.PACKAGE_GENERATING)
+                self.generate_packages_async()
             else:
                 self.switch_page(self.PACKAGE_SELECTION)
         else:
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 10/21] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (8 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 09/21] Hob: clean up and unify the steps for PACKAGE_GENERATING and FAST_IMAGE_GENERATING to call generate_packages_async() and fast_generate_image_async() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 11/21] Hob: clean up to call clear_busy() in hobeventhandler.py Shane Wang
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

For the steps in IMAGE_GENERATING, the patch consolidates them into
generate_image_async() to call.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 8a95b94..959d8c1 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -361,6 +361,20 @@ class Builder(gtk.Window):
         self.handler.reset_build()
         self.handler.generate_packages(all_recipes)
 
+    def generate_image_async(self):
+        self.switch_page(self.IMAGE_GENERATING)
+        # Build image
+        self.set_user_config()
+        packages = self.package_model.get_selected_packages()
+        toolchain_packages = []
+        if self.configuration.toolchain_build:
+            toolchain_packages = self.package_model.get_selected_packages_toolchain()
+        self.handler.reset_build()
+        self.handler.generate_image(packages,
+                                    self.hob_image,
+                                    self.hob_toolchain,
+                                    toolchain_packages)
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -426,7 +440,6 @@ class Builder(gtk.Window):
             # after packages are generated, selected_packages need to
             # be updated in package_model per selected_image in recipe_model
             self.build_details_page.show_page(next_step)
-            self.generate_image()
 
         elif next_step == self.IMAGE_GENERATED:
             self.image_details_page.show_page(next_step)
@@ -475,19 +488,6 @@ class Builder(gtk.Window):
         left = self.package_model.set_selected_packages(selected_packages)
         self.configuration.selected_packages += left
 
-    def generate_image(self):
-        # Build image
-        self.set_user_config()
-        packages = self.package_model.get_selected_packages()
-        toolchain_packages = []
-        if self.configuration.toolchain_build:
-            toolchain_packages = self.package_model.get_selected_packages_toolchain()
-        self.handler.reset_build()
-        self.handler.generate_image(packages,
-                                    self.hob_image,
-                                    self.hob_toolchain,
-                                    toolchain_packages)
-
     # Callback Functions
     def handler_config_updated_cb(self, handler, which, values):
         if which == "distro":
@@ -526,7 +526,7 @@ class Builder(gtk.Window):
 
             self.rcppkglist_populated()
             if self.current_step == self.FAST_IMAGE_GENERATING:
-                self.switch_page(self.IMAGE_GENERATING)
+                self.generate_image_async()
             elif self.current_step == self.PACKAGE_GENERATING:
                 self.switch_page(self.PACKAGE_GENERATED)
             elif self.current_step == self.IMAGE_GENERATING:
@@ -758,7 +758,7 @@ class Builder(gtk.Window):
             dialog.run()
             dialog.destroy()
             return
-        self.switch_page(self.IMAGE_GENERATING)
+        self.generate_image_async()
 
     def just_bake(self):
         selected_image = self.recipe_model.get_selected_image()
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 11/21] Hob: clean up to call clear_busy() in hobeventhandler.py
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (9 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 10/21] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 12/21] Hob: clean up and unify get_parameters() to be get_parameters_sync() Shane Wang
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py         |    1 -
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 959d8c1..ddd93f6 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -542,7 +542,6 @@ class Builder(gtk.Window):
             HobButton.style_button(button)
             response = dialog.run()
             dialog.destroy()
-        self.handler.clear_busy()
         self.configuration.curr_mach = ""
         self.image_configuration_page.switch_machine_combo()
         self.switch_page(self.MACHINE_SELECTION)
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index d608b5f..dd85530 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -202,6 +202,7 @@ class HobHandler(gobject.GObject):
 
         elif isinstance(event, bb.command.CommandFailed):
             self.commands_async = []
+            self.clear_busy()
             self.emit("command-failed", self.error_msg)
             self.error_msg = ""
         elif isinstance(event, (bb.event.ParseStarted,
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 12/21] Hob: clean up and unify get_parameters() to be get_parameters_sync()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (10 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 11/21] Hob: clean up to call clear_busy() in hobeventhandler.py Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 13/21] Hob: clean up request_package_info_async() Shane Wang
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index ddd93f6..d8c420e 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -375,6 +375,9 @@ class Builder(gtk.Window):
                                     self.hob_toolchain,
                                     toolchain_packages)
 
+    def get_parameters_sync(self):
+        return self.handler.get_parameters()
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -504,18 +507,18 @@ class Builder(gtk.Window):
     def handler_command_succeeded_cb(self, handler, initcmd):
         if initcmd == self.handler.PARSE_CONFIG:
             # settings
-            params = self.handler.get_parameters()
+            params = self.get_parameters_sync()
             self.configuration = Configuration(params)
             self.parameters = Parameters(params)
             self.handler.generate_configuration()
         elif initcmd == self.handler.GENERATE_CONFIGURATION:
-            params = self.handler.get_parameters()
+            params = self.get_parameters_sync()
             self.configuration.update(params)
             self.image_configuration_page.switch_machine_combo()
         elif initcmd in [self.handler.GENERATE_RECIPES,
                          self.handler.GENERATE_PACKAGES,
                          self.handler.GENERATE_IMAGE]:
-            params = self.handler.get_parameters()
+            params = self.get_parameters_sync()
             self.configuration.update(params)
             self.handler.request_package_info_async()
         elif initcmd == self.handler.POPULATE_PACKAGEINFO:
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 13/21] Hob: clean up request_package_info_async()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (11 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 12/21] Hob: clean up and unify get_parameters() to be get_parameters_sync() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 14/21] Hob: clean up cancel_build() Shane Wang
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py         |    5 ++++-
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index d8c420e..f069215 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -378,6 +378,9 @@ class Builder(gtk.Window):
     def get_parameters_sync(self):
         return self.handler.get_parameters()
 
+    def request_package_info_async(self):
+        self.handler.request_package_info()
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -520,7 +523,7 @@ class Builder(gtk.Window):
                          self.handler.GENERATE_IMAGE]:
             params = self.get_parameters_sync()
             self.configuration.update(params)
-            self.handler.request_package_info_async()
+            self.request_package_info_async()
         elif initcmd == self.handler.POPULATE_PACKAGEINFO:
             if self.current_step == self.RCPPKGINFO_POPULATING:
                 self.switch_page(self.RCPPKGINFO_POPULATED)
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index dd85530..1a7427a 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -325,7 +325,7 @@ class HobHandler(gobject.GObject):
         self.server.runCommand(["setVariable", "CVS_PROXY_HOST", host])
         self.server.runCommand(["setVariable", "CVS_PROXY_PORT", port])
 
-    def request_package_info_async(self):
+    def request_package_info(self):
         self.commands_async.append(self.SUB_GENERATE_PKGINFO)
         self.run_next_command(self.POPULATE_PACKAGEINFO)
 
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 14/21] Hob: clean up cancel_build()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (12 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 13/21] Hob: clean up request_package_info_async() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 15/21] Hob: clean up generate_configuration() Shane Wang
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index f069215..26e202e 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -381,6 +381,9 @@ class Builder(gtk.Window):
     def request_package_info_async(self):
         self.handler.request_package_info()
 
+    def cancel_build_sync(self, force=False):
+        self.handler.cancel_build(force)
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -1038,6 +1041,6 @@ class Builder(gtk.Window):
         if response != gtk.RESPONSE_CANCEL:
             self.stopping = True
         if response == gtk.RESPONSE_OK:
-            self.handler.cancel_build()
+            self.cancel_build_sync()
         elif response == gtk.RESPONSE_YES:
-            self.handler.cancel_build(True)
+            self.cancel_build_sync(True)
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 15/21] Hob: clean up generate_configuration()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (13 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 14/21] Hob: clean up cancel_build() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 16/21] Hob: clean up and reword stop_parse() Shane Wang
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 26e202e..b052d99 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -384,6 +384,9 @@ class Builder(gtk.Window):
     def cancel_build_sync(self, force=False):
         self.handler.cancel_build(force)
 
+    def generate_configuration_async(self):
+        self.handler.generate_configuration()
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -516,7 +519,7 @@ class Builder(gtk.Window):
             params = self.get_parameters_sync()
             self.configuration = Configuration(params)
             self.parameters = Parameters(params)
-            self.handler.generate_configuration()
+            self.generate_configuration_async()
         elif initcmd == self.handler.GENERATE_CONFIGURATION:
             params = self.get_parameters_sync()
             self.configuration.update(params)
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 16/21] Hob: clean up and reword stop_parse()
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (14 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 15/21] Hob: clean up generate_configuration() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 17/21] Hob: tooltip change for "Build image" button Shane Wang
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py                |    6 +++---
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index b052d99..afd1d1b 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -387,6 +387,9 @@ class Builder(gtk.Window):
     def generate_configuration_async(self):
         self.handler.generate_configuration()
 
+    def cancel_parse_sync(self):
+        self.handler.cancel_parse()
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -1008,9 +1011,6 @@ class Builder(gtk.Window):
     def show_configuration(self):
         self.switch_page(self.BASEIMG_SELECTED)
 
-    def stop_parse(self):
-        self.handler.cancel_parse()
-
     def stop_build(self):
         if self.stopping:
             lbl = "<b>Force Stop build?</b>\nYou've already selected Stop once,"
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index 204d1c6..c2e0f5f 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -250,7 +250,7 @@ class ImageConfigurationPage (HobPage):
         return button_box
 
     def stop_button_clicked_cb(self, button):
-        self.builder.stop_parse()
+        self.builder.cancel_parse_sync()
 
     def machine_combo_changed_cb(self, machine_combo):
         combo_item = machine_combo.get_active_text()
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 17/21] Hob: tooltip change for "Build image" button
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (15 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 16/21] Hob: clean up and reword stop_parse() Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 18/21] Hob: add tooltips into image details screen Shane Wang
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

[Yocto #2242]

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index 8391e29..923f53b 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -131,7 +131,7 @@ class PackageSelectionPage (HobPage):
 
         self.build_image_button = HobButton('Build image')
         self.build_image_button.set_size_request(205, 49)
-        self.build_image_button.set_tooltip_text("Build image to get your target image")
+        self.build_image_button.set_tooltip_text("Build target image")
         self.build_image_button.set_flags(gtk.CAN_DEFAULT)
         self.build_image_button.grab_default()
         self.build_image_button.connect("clicked", self.build_image_clicked_cb)
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 18/21] Hob: add tooltips into image details screen
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (16 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 17/21] Hob: tooltip change for "Build image" button Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 19/21] Hob: forget selected_recipes and selected_packages after users change the machine Shane Wang
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

[Yocto #2243]

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index e550653..3eb6bcf 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -126,19 +126,19 @@ class ImageDetailsPage (HobPage):
             "Templates",
             hic.ICON_TEMPLATES_DISPLAY_FILE,
             hic.ICON_TEMPLATES_HOVER_FILE,
-            "Load a hob building template saved before",
+            "Load a previously saved template",
             self.template_button_clicked_cb)
         my_images_button = self.append_toolbar_button(self.toolbar,
-            "My images",
+            "Images",
             hic.ICON_IMAGES_DISPLAY_FILE,
             hic.ICON_IMAGES_HOVER_FILE,
-            "Open images built out previously for running or deployment",
+            "Open previously built images",
             self.my_images_button_clicked_cb)
         settings_button = self.append_toolbar_button(self.toolbar,
             "Settings",
             hic.ICON_SETTINGS_DISPLAY_FILE,
             hic.ICON_SETTINGS_HOVER_FILE,
-            "Other advanced settings for build",
+            "View additional build settings",
             self.settings_button_clicked_cb)
 
         self.details_top_buttons = self.add_onto_top_bar(self.toolbar)
@@ -206,6 +206,7 @@ class ImageDetailsPage (HobPage):
         image_table.connect("toggled", self.toggled_cb)
         view_files_button = HobAltButton("View files")
         view_files_button.connect("clicked", self.view_files_clicked_cb, image_addr)
+        view_files_button.set_tooltip_text("Open the directory containing the image files")
         self.box_group_area.pack_start(self.DetailBox(widget=image_table, button=view_files_button), expand=True, fill=True)
 
         # Machine, Base image and Layers
@@ -233,6 +234,7 @@ class ImageDetailsPage (HobPage):
                 i += 1
 
             edit_config_button = HobAltButton("Edit configuration")
+            edit_config_button.set_tooltip_text("Edit machine, base image and recipes")
             edit_config_button.connect("clicked", self.edit_config_button_clicked_cb)
             setting_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=edit_config_button)
             self.box_group_area.pack_start(setting_detail, expand=False, fill=False)
@@ -244,6 +246,7 @@ class ImageDetailsPage (HobPage):
         vallist.append(default_image_size)
         if build_succeeded:
             edit_packages_button = HobAltButton("Edit packages")
+            edit_packages_button.set_tooltip_text("Edit the packages included in your image")
             edit_packages_button.connect("clicked", self.edit_packages_button_clicked_cb)
         else: # get to this page from "My images"
             edit_packages_button = None
@@ -316,7 +319,7 @@ class ImageDetailsPage (HobPage):
         if name in buttonlist:
             self.deploy_button = HobButton('Deploy image')
             self.deploy_button.set_size_request(205, 49)
-            self.deploy_button.set_tooltip_text("Deploy image to get your target board")
+            self.deploy_button.set_tooltip_text("Burn a live image to a USB drive or flash memory")
             self.deploy_button.set_flags(gtk.CAN_DEFAULT)
             self.deploy_button.connect("clicked", self.deploy_button_clicked_cb)
             bottom_buttons.pack_end(self.deploy_button, expand=False, fill=False)
@@ -331,6 +334,7 @@ class ImageDetailsPage (HobPage):
 
             # create button "Run image"
             self.run_button = HobAltButton("Run image")
+            self.run_button.set_tooltip_text("Start up an image with qemu emulator")
             self.run_button.connect("clicked", self.run_button_clicked_cb)
             bottom_buttons.pack_end(self.run_button, expand=False, fill=False)
             created = True
@@ -344,6 +348,7 @@ class ImageDetailsPage (HobPage):
 
             # create button "Save as template"
             save_button = HobAltButton("Save as template")
+            save_button.set_tooltip_text("Save the image configuration for reuse")
             save_button.connect("clicked", self.save_button_clicked_cb)
             bottom_buttons.pack_end(save_button, expand=False, fill=False)
             create = True
@@ -352,6 +357,7 @@ class ImageDetailsPage (HobPage):
         if name in buttonlist:
             # create button "Build new image"
             build_new_button = HobAltButton("Build new image")
+            build_new_button.set_tooltip_text("Create a new image from scratch")
             build_new_button.connect("clicked", self.build_new_button_clicked_cb)
             bottom_buttons.pack_start(build_new_button, expand=False, fill=False)
 
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 19/21] Hob: forget selected_recipes and selected_packages after users change the machine
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (17 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 18/21] Hob: add tooltips into image details screen Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 20/21] Hob: show those appliable buttons on the image details page only Shane Wang
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

The patch is to fix [Yocto #2255]. Now the logic is:

- If users change the machine, the image combo is empty for users to select.
- If users load the template, the image combo should set the value of
  selected_image specified in the template.
- After loading a template, if users change the machine, the selected_image
  specified in the template should be removed from the image combo because
  it is probably invalid for a new machine.
- If users customize the recipe/package list, and change the settings which
  causes reparsing, selected_recipes and selected_packages should be remembered.
- If users add more layers, selected_recipes and selected_packages should be
  remembered.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py                |    1 +
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   26 +++++++++++++++++--
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index afd1d1b..9e2495a 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -598,6 +598,7 @@ class Builder(gtk.Window):
                                             " ".join(selected_packages))
 
         self.image_configuration_page.update_image_combo(self.recipe_model, selected_image)
+        self.image_configuration_page.update_image_desc(selected_image)
         self.update_recipe_model(selected_image, selected_recipes)
         self.update_package_model(selected_packages)
 
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index c2e0f5f..2385eb8 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -37,6 +37,10 @@ class ImageConfigurationPage (HobPage):
         super(ImageConfigurationPage, self).__init__(builder, "Image configuration")
 
         self.image_combo_id = None
+        # we use machine_combo_changed_by_manual to identify the machine is changed by code
+        # or by manual. If by manual, all user's recipe selection and package selection are
+        # cleared.
+        self.machine_combo_changed_by_manual = True
         self.create_visual_elements()
 
     def create_visual_elements(self):
@@ -258,6 +262,13 @@ class ImageConfigurationPage (HobPage):
             return
 
         self.builder.configuration.curr_mach = combo_item
+        if self.machine_combo_changed_by_manual:
+            self.builder.configuration.selected_image = None
+            self.builder.configuration.selected_recipes = []
+            self.builder.configuration.selected_packages = []
+        # reset machine_combo_changed_by_manual
+        self.machine_combo_changed_by_manual = True
+
         # Do reparse recipes
         self.builder.populate_recipe_package_info_async()
 
@@ -271,6 +282,7 @@ class ImageConfigurationPage (HobPage):
         self.machine_combo.set_active(-1)
 
     def switch_machine_combo(self):
+        self.machine_combo_changed_by_manual = False
         model = self.machine_combo.get_model()
         active = 0
         while active < len(model):
@@ -280,6 +292,16 @@ class ImageConfigurationPage (HobPage):
             active += 1
         self.machine_combo.set_active(-1)
 
+    def update_image_desc(self, selected_image):
+        desc = ""
+        if selected_image and selected_image in self.builder.recipe_model.pn_path.keys():
+            image_path = self.builder.recipe_model.pn_path[selected_image]
+            image_iter = self.builder.recipe_model.get_iter(image_path)
+            desc = self.builder.recipe_model.get_value(image_iter, self.builder.recipe_model.COL_DESC)
+
+        mark = ("<span %s>%s</span>\n") % (self.span_tag('small'), desc)
+        self.image_desc.set_markup(mark)
+
     def image_combo_changed_idle_cb(self, selected_image, selected_recipes, selected_packages):
         self.builder.update_recipe_model(selected_image, selected_recipes)
         self.builder.update_package_model(selected_packages)
@@ -296,9 +318,7 @@ class ImageConfigurationPage (HobPage):
         image_path = self.builder.recipe_model.pn_path[selected_image]
         image_iter = self.builder.recipe_model.get_iter(image_path)
         selected_packages = self.builder.recipe_model.get_value(image_iter, self.builder.recipe_model.COL_INSTALL).split()
-
-        mark = ("<span %s>%s</span>\n") % (self.span_tag('small'), self.builder.recipe_model.get_value(image_iter, self.builder.recipe_model.COL_DESC))
-        self.image_desc.set_markup(mark)
+        self.update_image_desc(selected_image)
 
         self.builder.recipe_model.reset()
         self.builder.package_model.reset()
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 20/21] Hob: show those appliable buttons on the image details page only
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (18 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 19/21] Hob: forget selected_recipes and selected_packages after users change the machine Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-09 14:13 ` [PATCH 21/21] Hob:Fixed some incorrect values of Build configuration tab Shane Wang
  2012-04-10 22:48 ` [PATCH 00/21] [Resend] Hob fixes and cleanups Richard Purdie
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

We don't use "grayed out" but use "show/hide" for those appliable buttons
in the image details page.

[Yocto #2143]

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py |  122 ++++++++++++++++++--------
 1 files changed, 84 insertions(+), 38 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index 3eb6bcf..1d1cb9e 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -113,6 +113,8 @@ class ImageDetailsPage (HobPage):
         super(ImageDetailsPage, self).__init__(builder, "Image details")
 
         self.image_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_BOOLEAN)
+        self.button_ids = {}
+        self.details_bottom_buttons = gtk.HBox(False, 6)
         self.create_visual_elements()
 
     def create_visual_elements(self):
@@ -150,6 +152,9 @@ class ImageDetailsPage (HobPage):
         children = self.box_group_area.get_children() or []
         for child in children:
             self.box_group_area.remove(child)
+        children = self.details_bottom_buttons.get_children() or []
+        for child in children:
+            self.details_bottom_buttons.remove(child)
 
     def show_page(self, step):
         build_succeeded = (step == self.builder.IMAGE_GENERATED)
@@ -163,10 +168,15 @@ class ImageDetailsPage (HobPage):
         else:
             pkg_num = "N/A"
 
+        # remove
+        for button_id, button in self.button_ids.items():
+            button.disconnect(button_id)
         self._remove_all_widget()
+        # repack
         self.pack_start(self.details_top_buttons, expand=False, fill=False)
         self.pack_start(self.group_align, expand=True, fill=True)
 
+        self.build_result = None
         if build_succeeded:
             # building is the previous step
             icon = gtk.Image()
@@ -176,43 +186,48 @@ class ImageDetailsPage (HobPage):
             icon.set_from_pixbuf(pix_buffer)
             varlist = [""]
             vallist = ["Your image is ready"]
-            build_result = self.DetailBox(varlist=varlist, vallist=vallist, icon=icon, color=color)
-            self.box_group_area.pack_start(build_result, expand=False, fill=False)
+            self.build_result = self.DetailBox(varlist=varlist, vallist=vallist, icon=icon, color=color)
+            self.box_group_area.pack_start(self.build_result, expand=False, fill=False)
 
         # create the buttons at the bottom first because the buttons are used in apply_button_per_image()
         if build_succeeded:
-            buttonlist = ["Build new image", "Save as template", "Run image", "Deploy image"]
+            self.buttonlist = ["Build new image", "Save as template", "Run image", "Deploy image"]
         else: # get to this page from "My images"
-            buttonlist = ["Build new image", "Run image", "Deploy image"]
-        details_bottom_buttons = self.create_bottom_buttons(buttonlist)
+            self.buttonlist = ["Build new image", "Run image", "Deploy image"]
 
         # Name
         self.image_store.clear()
         default_toggled = False
         default_image_size = 0
+        i = 0
         for image_name in image_names:
             image_size = HobPage._size_to_string(os.stat(os.path.join(image_addr, image_name)).st_size)
             if not default_toggled:
                 default_toggled = (self.test_type_runnable(image_name) and self.test_mach_runnable(image_name)) \
                     or self.test_deployable(image_name)
+                if i == (len(image_names) - 1):
+                    default_toggled = True
                 self.image_store.set(self.image_store.append(), 0, image_name, 1, image_size, 2, default_toggled)
                 if default_toggled:
                     default_image_size = image_size
-                self.apply_buttons_per_image(image_name)
+                    self.create_bottom_buttons(self.buttonlist, image_name)
             else:
                 self.image_store.set(self.image_store.append(), 0, image_name, 1, image_size, 2, False)
+            i = i + 1
         image_table = HobViewTable(self.__columns__)
         image_table.set_model(self.image_store)
         image_table.connect("toggled", self.toggled_cb)
         view_files_button = HobAltButton("View files")
         view_files_button.connect("clicked", self.view_files_clicked_cb, image_addr)
         view_files_button.set_tooltip_text("Open the directory containing the image files")
-        self.box_group_area.pack_start(self.DetailBox(widget=image_table, button=view_files_button), expand=True, fill=True)
+        self.image_detail = self.DetailBox(widget=image_table, button=view_files_button)
+        self.box_group_area.pack_start(self.image_detail, expand=True, fill=True)
 
         # Machine, Base image and Layers
         layer_num_limit = 15
         varlist = ["Machine: ", "Base image: ", "Layers: "]
         vallist = []
+        self.setting_detail = None
         if build_succeeded:
             vallist.append(machine)
             vallist.append(base_image)
@@ -236,8 +251,8 @@ class ImageDetailsPage (HobPage):
             edit_config_button = HobAltButton("Edit configuration")
             edit_config_button.set_tooltip_text("Edit machine, base image and recipes")
             edit_config_button.connect("clicked", self.edit_config_button_clicked_cb)
-            setting_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=edit_config_button)
-            self.box_group_area.pack_start(setting_detail, expand=False, fill=False)
+            self.setting_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=edit_config_button)
+            self.box_group_area.pack_start(self.setting_detail, expand=False, fill=False)
 
         # Packages included, and Total image size
         varlist = ["Packages included: ", "Total image size: "]
@@ -254,7 +269,7 @@ class ImageDetailsPage (HobPage):
         self.box_group_area.pack_start(self.package_detail, expand=False, fill=False)
 
         # pack the buttons at the bottom, at this time they are already created.
-        self.box_group_area.pack_end(details_bottom_buttons, expand=False, fill=False)
+        self.box_group_area.pack_end(self.details_bottom_buttons, expand=False, fill=False)
 
         self.show_all()
 
@@ -289,10 +304,6 @@ class ImageDetailsPage (HobPage):
                 break
         return deployable
 
-    def apply_buttons_per_image(self, image_name):
-        self.run_button.set_sensitive(self.test_type_runnable(image_name) and self.test_mach_runnable(image_name))
-        self.deploy_button.set_sensitive(self.test_deployable(image_name))
-
     def toggled_cb(self, table, cell, path, columnid, tree):
         model = tree.get_model()
         if not model:
@@ -307,50 +318,86 @@ class ImageDetailsPage (HobPage):
         self.refresh_package_detail_box(model[path][1])
 
         image_name = model[path][0]
-        self.apply_buttons_per_image(image_name)
 
-    def create_bottom_buttons(self, buttonlist):
+        # remove
+        for button_id, button in self.button_ids.items():
+            button.disconnect(button_id)
+        self._remove_all_widget()
+        # repack
+        self.pack_start(self.details_top_buttons, expand=False, fill=False)
+        self.pack_start(self.group_align, expand=True, fill=True)
+        if self.build_result:
+            self.box_group_area.pack_start(self.build_result, expand=False, fill=False)
+        self.box_group_area.pack_start(self.image_detail, expand=True, fill=True)
+        if self.setting_detail:
+            self.box_group_area.pack_start(self.setting_detail, expand=False, fill=False)
+        self.box_group_area.pack_start(self.package_detail, expand=False, fill=False)
+        self.create_bottom_buttons(self.buttonlist, image_name)
+        self.box_group_area.pack_end(self.details_bottom_buttons, expand=False, fill=False)
+        self.show_all()
+
+    def create_bottom_buttons(self, buttonlist, image_name):
         # Create the buttons at the bottom
-        bottom_buttons = gtk.HBox(False, 6)
         created = False
+        packed = False
+        self.button_ids = {}
 
         # create button "Deploy image"
         name = "Deploy image"
-        if name in buttonlist:
-            self.deploy_button = HobButton('Deploy image')
-            self.deploy_button.set_size_request(205, 49)
-            self.deploy_button.set_tooltip_text("Burn a live image to a USB drive or flash memory")
-            self.deploy_button.set_flags(gtk.CAN_DEFAULT)
-            self.deploy_button.connect("clicked", self.deploy_button_clicked_cb)
-            bottom_buttons.pack_end(self.deploy_button, expand=False, fill=False)
+        if name in buttonlist and self.test_deployable(image_name):
+            deploy_button = HobButton('Deploy image')
+            deploy_button.set_size_request(205, 49)
+            deploy_button.set_tooltip_text("Burn a live image to a USB drive or flash memory")
+            deploy_button.set_flags(gtk.CAN_DEFAULT)
+            button_id = deploy_button.connect("clicked", self.deploy_button_clicked_cb)
+            self.button_ids[button_id] = deploy_button
+            self.details_bottom_buttons.pack_end(deploy_button, expand=False, fill=False)
             created = True
+            packed = True
 
         name = "Run image"
-        if name in buttonlist:
+        if name in buttonlist and self.test_type_runnable(image_name) and self.test_mach_runnable(image_name):
             if created == True:
                 # separator
                 label = gtk.Label(" or ")
-                bottom_buttons.pack_end(label, expand=False, fill=False)
+                self.details_bottom_buttons.pack_end(label, expand=False, fill=False)
 
-            # create button "Run image"
-            self.run_button = HobAltButton("Run image")
-            self.run_button.set_tooltip_text("Start up an image with qemu emulator")
-            self.run_button.connect("clicked", self.run_button_clicked_cb)
-            bottom_buttons.pack_end(self.run_button, expand=False, fill=False)
+                # create button "Run image"
+                run_button = HobAltButton("Run image")
+            else:
+                # create button "Run image" as the primary button
+                run_button = HobButton("Run image")
+                run_button.set_size_request(205, 49)
+                run_button.set_flags(gtk.CAN_DEFAULT)
+                packed = True
+            run_button.set_tooltip_text("Start up an image with qemu emulator")
+            button_id = run_button.connect("clicked", self.run_button_clicked_cb)
+            self.button_ids[button_id] = run_button
+            self.details_bottom_buttons.pack_end(run_button, expand=False, fill=False)
             created = True
 
+        if not packed:
+            box = gtk.HBox(False, 6)
+            box.show()
+            subbox = gtk.HBox(False, 0)
+            subbox.set_size_request(205, 49)
+            subbox.show()
+            box.add(subbox)
+            self.details_bottom_buttons.pack_end(box, False, False)
+
         name = "Save as template"
         if name in buttonlist:
             if created == True:
                 # separator
                 label = gtk.Label(" or ")
-                bottom_buttons.pack_end(label, expand=False, fill=False)
+                self.details_bottom_buttons.pack_end(label, expand=False, fill=False)
 
             # create button "Save as template"
             save_button = HobAltButton("Save as template")
             save_button.set_tooltip_text("Save the image configuration for reuse")
-            save_button.connect("clicked", self.save_button_clicked_cb)
-            bottom_buttons.pack_end(save_button, expand=False, fill=False)
+            button_id = save_button.connect("clicked", self.save_button_clicked_cb)
+            self.button_ids[button_id] = save_button
+            self.details_bottom_buttons.pack_end(save_button, expand=False, fill=False)
             create = True
 
         name = "Build new image"
@@ -358,10 +405,9 @@ class ImageDetailsPage (HobPage):
             # create button "Build new image"
             build_new_button = HobAltButton("Build new image")
             build_new_button.set_tooltip_text("Create a new image from scratch")
-            build_new_button.connect("clicked", self.build_new_button_clicked_cb)
-            bottom_buttons.pack_start(build_new_button, expand=False, fill=False)
-
-        return bottom_buttons
+            button_id = build_new_button.connect("clicked", self.build_new_button_clicked_cb)
+            self.button_ids[button_id] = build_new_button
+            self.details_bottom_buttons.pack_start(build_new_button, expand=False, fill=False)
 
     def _get_selected_image(self):
         image_name = ""
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 21/21] Hob:Fixed some incorrect values of Build configuration tab
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (19 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 20/21] Hob: show those appliable buttons on the image details page only Shane Wang
@ 2012-04-09 14:13 ` Shane Wang
  2012-04-10 22:48 ` [PATCH 00/21] [Resend] Hob fixes and cleanups Richard Purdie
  21 siblings, 0 replies; 24+ messages in thread
From: Shane Wang @ 2012-04-09 14:13 UTC (permalink / raw)
  To: bitbake-devel

From: Liming An <limingx.l.an@intel.com>

Because some variables not be updated when building started, so add them
to the updating function of configuration class, and add reset function of
configurate treeview of building detail page

[YOCTO #2244]

Signed-off-by: Liming An <limingx.l.an@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builddetailspage.py |   20 ++++++++++++--------
 bitbake/lib/bb/ui/crumbs/builder.py          |   14 +++++++-------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index cd4413b..23aaacd 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -81,16 +81,16 @@ class BuildConfigurationTreeView(gtk.TreeView):
         # renew the tree model after get the configuration messages
         self.set_model(listmodel)
 
-    def show(self, src_config_info, src_params):
+    def show(self, src_config_info):
         vars = []
-        vars.append(self.set_vars("BB version:", src_params.bb_version))
-        vars.append(self.set_vars("Target arch:", src_params.target_arch))
-        vars.append(self.set_vars("Target OS:", src_params.target_os))
+        vars.append(self.set_vars("BB version:", src_config_info.bb_version))
+        vars.append(self.set_vars("Target arch:", src_config_info.target_arch))
+        vars.append(self.set_vars("Target OS:", src_config_info.target_os))
         vars.append(self.set_vars("Machine:", src_config_info.curr_mach))
         vars.append(self.set_vars("Distro:", src_config_info.curr_distro))
-        vars.append(self.set_vars("Distro version:", src_params.distro_version))
+        vars.append(self.set_vars("Distro version:", src_config_info.distro_version))
         vars.append(self.set_vars("SDK machine:", src_config_info.curr_sdk_machine))
-        vars.append(self.set_vars("Tune feature:", src_params.tune_pkgarch))
+        vars.append(self.set_vars("Tune feature:", src_config_info.tune_pkgarch))
         vars.append(self.set_vars("Layers:", src_config_info.layers))
 
         for path in src_config_info.layers:
@@ -105,6 +105,9 @@ class BuildConfigurationTreeView(gtk.TreeView):
 
         self.set_config_model(vars)
 
+    def reset(self):
+        self.set_model(None)
+
 #
 # BuildDetailsPage
 #
@@ -208,6 +211,7 @@ class BuildDetailsPage (HobPage):
         self.box_group_area.pack_start(self.vbox, expand=True, fill=True)
 
         self.progress_bar.reset()
+        self.config_tv.reset()
         self.vbox.pack_start(self.progress_box, expand=False, fill=False)
 
         self.vbox.pack_start(self.notebook, expand=True, fill=True)
@@ -244,5 +248,5 @@ class BuildDetailsPage (HobPage):
                 if (v_adj.upper <= v_adj.page_size) or (v_adj.value == v_adj.upper - v_adj.page_size):
                     treeview.scroll_to_cell(path)
 
-    def show_configurations(self, configurations, params):
-        self.config_tv.show(configurations, params)
+    def show_configurations(self, configurations):
+        self.config_tv.show(configurations)
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 9e2495a..c0f4873 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -96,6 +96,12 @@ class Configuration:
         self.conf_version = params["conf_version"]
         self.lconf_version = params["lconf_version"]
         self.image_fstypes = params["image_fstypes"]
+        self.tune_arch = params["tune_arch"]
+        self.bb_version = params["bb_version"]
+        self.target_arch = params["target_arch"]
+        self.target_os = params["target_os"]
+        self.distro_version = params["distro_version"]
+        self.tune_pkgarch = params["tune_pkgarch"]
         # bblayers.conf
         self.layers = params["layer"].split()
 
@@ -201,12 +207,6 @@ class Parameters:
         self.runnable_machine_patterns = params["runnable_machine_patterns"].split()
         self.deployable_image_types = params["deployable_image_types"].split()
         self.tmpdir = params["tmpdir"]
-        self.distro_version = params["distro_version"]
-        self.target_os = params["target_os"]
-        self.target_arch = params["target_arch"]
-        self.tune_pkgarch = params["tune_pkgarch"]
-        self.bb_version = params["bb_version"]
-        self.tune_arch = params["tune_arch"]
         self.enable_proxy = False
 
 class Builder(gtk.Window):
@@ -653,7 +653,7 @@ class Builder(gtk.Window):
         elif self.current_step == self.PACKAGE_GENERATING:
             fraction = 0
         self.build_details_page.update_progress_bar("Build Started: ", fraction)
-        self.build_details_page.show_configurations(self.configuration, self.parameters)
+        self.build_details_page.show_configurations(self.configuration)
 
     def build_succeeded(self):
         if self.current_step == self.FAST_IMAGE_GENERATING:
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 01/21] Hob: fix version check - Hob can run on pygtk 2.21.0
  2012-04-09 14:13 ` [PATCH 01/21] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
@ 2012-04-09 16:47   ` Joshua Lock
  0 siblings, 0 replies; 24+ messages in thread
From: Joshua Lock @ 2012-04-09 16:47 UTC (permalink / raw)
  To: bitbake-devel

On 09/04/12 07:13, Shane Wang wrote:
> Signed-off-by: Shane Wang<shane.wang@intel.com>
> ---
>   bitbake/lib/bb/ui/hob.py |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
> index 1321ebb..61df300 100755
> --- a/bitbake/lib/bb/ui/hob.py
> +++ b/bitbake/lib/bb/ui/hob.py
> @@ -29,7 +29,7 @@ try:
>       import pygtk
>       pygtk.require('2.0') # to be certain we don't have gtk+ 1.x !?!
>       ver = gtk.pygtk_version
> -    if ver<  (2, 22, 0):
> +    if ver<  (2, 21, 0):

I've already sent a patch to lower this requirement.

>           sys.exit("%s (you have pygtk %s.%s.%s)." % (requirements, ver[0], ver[1], ver[2]))
>   except ImportError as exc:
>       sys.exit("%s (%s)." % (requirements, str(exc)))


Joshua
-- 
Joshua '贾詡' Lock
         Yocto Project "Johannes factotum"
         Intel Open Source Technology Centre



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 00/21] [Resend] Hob fixes and cleanups
  2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
                   ` (20 preceding siblings ...)
  2012-04-09 14:13 ` [PATCH 21/21] Hob:Fixed some incorrect values of Build configuration tab Shane Wang
@ 2012-04-10 22:48 ` Richard Purdie
  21 siblings, 0 replies; 24+ messages in thread
From: Richard Purdie @ 2012-04-10 22:48 UTC (permalink / raw)
  To: Shane Wang; +Cc: bitbake-devel

On Mon, 2012-04-09 at 22:09 +0800, Shane Wang wrote:
> Those patches fix the following:
>   - the UI bug to fade out the entry in the "Included" page when it is removed
>   - add and correct tooltips reviewed by Scott
>   - clean up the code and maximize reusage, for exception handling
>   - misc
> 
> The following changes since commit 190f6d791d51aaa4cfb9f1cf932bc205ff674fb5:
> 
>   runqemu-internal: Add console=tty for qemuppc and NFS (2012-04-06 01:12:47 +0100)
> 
> are available in the git repository at:
>   git://git.pokylinux.org/poky-contrib shane/hob-fixes-continue
>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob-fixes-continue
> 
> Liming An (4):
>   Hob: add fadeout display effection for recipe view include page
>   Hob: add fadeout display effection for package view include page
>   Hob: Add the tooltips for recipe view page as request
>   Hob:Fixed some incorrect values of Build configuration tab
> 
> Shane Wang (17):
>   Hob: fix version check - Hob can run on pygtk 2.21.0
>   Hob: correct indent
>   Hob: clean up and unify the steps for new build to call
>     initiate_new_build_async()
>   Hob: clean up and unify the steps for CONFIG_UPDATE to call
>     update_config_async()
>   Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call
>     populate_recipe_package_info_async()
>   Hob: clean up and unify the steps for PACKAGE_GENERATING and
>     FAST_IMAGE_GENERATING to call generate_packages_async() and
>     fast_generate_image_async()
>   Hob: clean up and unify the steps for IMAGE_GENERATING to call
>     generate_image_async()
>   Hob: clean up to call clear_busy() in hobeventhandler.py
>   Hob: clean up and unify get_parameters() to be get_parameters_sync()
>   Hob: clean up request_package_info_async()
>   Hob: clean up cancel_build()
>   Hob: clean up generate_configuration()
>   Hob: clean up and reword stop_parse()
>   Hob: tooltip change for "Build image" button
>   Hob: add tooltips into image details screen
>   Hob: forget selected_recipes and selected_packages after users change
>     the machine
>   Hob: show those appliable buttons on the image details page only

I've merged these apart from the version change for which I took
Joshua's patches.

I have to say that cleanups at this point in the cycle are less than
ideal, I've only taken them since they were unit tested with the rest of
this and I can't really take one without the other.

Also, there were patch rejects on the fadeout patches and I had to merge
things due to taking other patches so please check the final result.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-04-10 22:57 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-09 14:09 [PATCH 00/21] [Resend] Hob fixes and cleanups Shane Wang
2012-04-09 14:13 ` [PATCH 01/21] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
2012-04-09 16:47   ` Joshua Lock
2012-04-09 14:13 ` [PATCH 02/21] Hob: add fadeout display effection for recipe view include page Shane Wang
2012-04-09 14:13 ` [PATCH 03/21] Hob: add fadeout display effection for package " Shane Wang
2012-04-09 14:13 ` [PATCH 04/21] Hob: Add the tooltips for recipe view page as request Shane Wang
2012-04-09 14:13 ` [PATCH 05/21] Hob: correct indent Shane Wang
2012-04-09 14:13 ` [PATCH 06/21] Hob: clean up and unify the steps for new build to call initiate_new_build_async() Shane Wang
2012-04-09 14:13 ` [PATCH 07/21] Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async() Shane Wang
2012-04-09 14:13 ` [PATCH 08/21] Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async() Shane Wang
2012-04-09 14:13 ` [PATCH 09/21] Hob: clean up and unify the steps for PACKAGE_GENERATING and FAST_IMAGE_GENERATING to call generate_packages_async() and fast_generate_image_async() Shane Wang
2012-04-09 14:13 ` [PATCH 10/21] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async() Shane Wang
2012-04-09 14:13 ` [PATCH 11/21] Hob: clean up to call clear_busy() in hobeventhandler.py Shane Wang
2012-04-09 14:13 ` [PATCH 12/21] Hob: clean up and unify get_parameters() to be get_parameters_sync() Shane Wang
2012-04-09 14:13 ` [PATCH 13/21] Hob: clean up request_package_info_async() Shane Wang
2012-04-09 14:13 ` [PATCH 14/21] Hob: clean up cancel_build() Shane Wang
2012-04-09 14:13 ` [PATCH 15/21] Hob: clean up generate_configuration() Shane Wang
2012-04-09 14:13 ` [PATCH 16/21] Hob: clean up and reword stop_parse() Shane Wang
2012-04-09 14:13 ` [PATCH 17/21] Hob: tooltip change for "Build image" button Shane Wang
2012-04-09 14:13 ` [PATCH 18/21] Hob: add tooltips into image details screen Shane Wang
2012-04-09 14:13 ` [PATCH 19/21] Hob: forget selected_recipes and selected_packages after users change the machine Shane Wang
2012-04-09 14:13 ` [PATCH 20/21] Hob: show those appliable buttons on the image details page only Shane Wang
2012-04-09 14:13 ` [PATCH 21/21] Hob:Fixed some incorrect values of Build configuration tab Shane Wang
2012-04-10 22:48 ` [PATCH 00/21] [Resend] Hob fixes and cleanups Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.