All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/20] Hob fixes and cleanups
@ 2012-04-08 10:20 Shane Wang
  2012-04-08 10:21 ` [PATCH 01/20] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
                   ` (19 more replies)
  0 siblings, 20 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:20 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
  - change the logic after recipe/package are populated
  - 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 (3):
  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

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: handle some steps for build-succeeded and build-failed by hob
    event handler itself
  Hob: tooltip change for "Build image" button
  Hob: add tooltips into image details screen
  Hob: change the logic for rcppkglist_populated()

 bitbake/lib/bb/ui/crumbs/builder.py                |  212 +++++++++++++-------
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py        |   14 +-
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py           |   35 +++-
 bitbake/lib/bb/ui/crumbs/hobwidget.py              |  155 ++++++++++++---
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   32 +---
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py       |   18 +-
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py   |   54 +++++-
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |   58 +++++-
 bitbake/lib/bb/ui/hob.py                           |    2 +-
 9 files changed, 421 insertions(+), 159 deletions(-)

-- 
1.7.6




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

* [PATCH 01/20] Hob: fix version check - Hob can run on pygtk 2.21.0
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 02/20] Hob: add fadeout display effection for recipe view include page Shane Wang
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 02/20] Hob: add fadeout display effection for recipe view include page
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
  2012-04-08 10:21 ` [PATCH 01/20] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 03/20] Hob: add fadeout display effection for package " Shane Wang
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 03/20] Hob: add fadeout display effection for package view include page
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
  2012-04-08 10:21 ` [PATCH 01/20] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
  2012-04-08 10:21 ` [PATCH 02/20] Hob: add fadeout display effection for recipe view include page Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 04/20] Hob: Add the tooltips for recipe view page as request Shane Wang
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 04/20] Hob: Add the tooltips for recipe view page as request
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (2 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 03/20] Hob: add fadeout display effection for package " Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 05/20] Hob: correct indent Shane Wang
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 05/20] Hob: correct indent
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (3 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 04/20] Hob: Add the tooltips for recipe view page as request Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 06/20] Hob: clean up and unify the steps for new build to call initiate_new_build_async() Shane Wang
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 06/20] Hob: clean up and unify the steps for new build to call initiate_new_build_async()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (4 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 05/20] Hob: correct indent Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 07/20] Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async() Shane Wang
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 07/20] Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (5 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 06/20] Hob: clean up and unify the steps for new build to call initiate_new_build_async() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 08/20] Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async() Shane Wang
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 08/20] Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (6 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 07/20] Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 09/20] 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
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 09/20] 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-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (7 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 08/20] Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 10/20] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async() Shane Wang
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 10/20] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (8 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 09/20] 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-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 11/20] Hob: clean up to call clear_busy() in hobeventhandler.py Shane Wang
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 11/20] Hob: clean up to call clear_busy() in hobeventhandler.py
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (9 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 10/20] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 12/20] Hob: clean up and unify get_parameters() to be get_parameters_sync() Shane Wang
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 12/20] Hob: clean up and unify get_parameters() to be get_parameters_sync()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (10 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 11/20] Hob: clean up to call clear_busy() in hobeventhandler.py Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 13/20] Hob: clean up request_package_info_async() Shane Wang
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 13/20] Hob: clean up request_package_info_async()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (11 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 12/20] Hob: clean up and unify get_parameters() to be get_parameters_sync() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 14/20] Hob: clean up cancel_build() Shane Wang
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 14/20] Hob: clean up cancel_build()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (12 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 13/20] Hob: clean up request_package_info_async() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 15/20] Hob: clean up generate_configuration() Shane Wang
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 15/20] Hob: clean up generate_configuration()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (13 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 14/20] Hob: clean up cancel_build() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 16/20] Hob: clean up and reword stop_parse() Shane Wang
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 16/20] Hob: clean up and reword stop_parse()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (14 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 15/20] Hob: clean up generate_configuration() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 17/20] Hob: handle some steps for build-succeeded and build-failed by hob event handler itself Shane Wang
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 17/20] Hob: handle some steps for build-succeeded and build-failed by hob event handler itself
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (15 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 16/20] Hob: clean up and reword stop_parse() Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 18/20] Hob: tooltip change for "Build image" button Shane Wang
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 UTC (permalink / raw)
  To: bitbake-devel

Changing the state of building, clearing the commands_async queue, and resetting
initcmd should be the behaviours of hob event handler rather that builder,
because those are the members of hob event handler. So, the patch is to put those
steps from the builder into the hob event handler by adding two callback functions
in it.

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

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index afd1d1b..4997cd4 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -668,7 +668,6 @@ class Builder(gtk.Window):
         elif self.current_step == self.PACKAGE_GENERATING:
             fraction = 1.0
         self.build_details_page.update_progress_bar("Build Completed: ", fraction)
-        self.handler.build_succeeded_async()
         self.stopping = False
 
     def build_failed(self):
@@ -688,7 +687,6 @@ class Builder(gtk.Window):
         self.build_details_page.update_progress_bar(message, fraction, status)
         self.build_details_page.show_back_button()
         self.build_details_page.hide_stop_button()
-        self.handler.build_failed_async()
         self.stopping = False
 
     def handler_build_succeeded_cb(self, running_build):
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 1a7427a..41ab593 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -81,6 +81,9 @@ class HobHandler(gobject.GObject):
         self.error_msg = ""
         self.initcmd = None
 
+        self.build.connect("build-succeeded", self.build_succeeded_cb)
+        self.build.connect("build-failed",    self.build_failed_cb)
+
     def set_busy(self):
         if not self.generating:
             self.emit("generating-data")
@@ -359,10 +362,10 @@ class HobHandler(gobject.GObject):
         self.commands_async.append(self.SUB_BUILD_IMAGE)
         self.run_next_command(self.GENERATE_IMAGE)
 
-    def build_succeeded_async(self):
+    def build_succeeded_cb(self, running_build):
         self.building = False
 
-    def build_failed_async(self):
+    def build_failed_cb(self, running_build):
         self.initcmd = None
         self.commands_async = []
         self.building = False
-- 
1.7.6




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

* [PATCH 18/20] Hob: tooltip change for "Build image" button
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (16 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 17/20] Hob: handle some steps for build-succeeded and build-failed by hob event handler itself Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 19/20] Hob: add tooltips into image details screen Shane Wang
  2012-04-08 10:21 ` [PATCH 20/20] Hob: change the logic for rcppkglist_populated() Shane Wang
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 19/20] Hob: add tooltips into image details screen
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (17 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 18/20] Hob: tooltip change for "Build image" button Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-08 10:21 ` [PATCH 20/20] Hob: change the logic for rcppkglist_populated() Shane Wang
  19 siblings, 0 replies; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 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] 22+ messages in thread

* [PATCH 20/20] Hob: change the logic for rcppkglist_populated()
  2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
                   ` (18 preceding siblings ...)
  2012-04-08 10:21 ` [PATCH 19/20] Hob: add tooltips into image details screen Shane Wang
@ 2012-04-08 10:21 ` Shane Wang
  2012-04-09  4:40   ` Wang, Shane
  19 siblings, 1 reply; 22+ messages in thread
From: Shane Wang @ 2012-04-08 10:21 UTC (permalink / raw)
  To: bitbake-devel

There are some bugs in the previous log of rcppkglist_populated. [Yocto #2255]
is one of them.

Once more, when the user loads a template, changes the base image to the other
one which is not the same as the one in the template, changes the machine, and
then you will find the base image specified in the template disappears.

This patch changes the logic as follows:
- If any template is loaded into this Hob session, its base image will be
  remembered always. After the recipe list and the package list are populated,
  the template base image will be appended.
  That is to fix the above bug.
- If the reason for reparsing recipes is any settings are changed, Hob will
  remember selected_recipes and selected_packages. The behaviour is the same
  as before, because we don't want to clear the user selection.
- If the reason for reparsing recipes is the machine is changed, including a
  template is loaded (which causes the machine is changed), Hob will forget
  selected_recipes and selected_packages the user selects. (see [Yocto #2255]
  for details)
- Again, we reuse the code for rcppkglist_populated() for any base image changing.
  I.e., when the user changes any base image, Hob will forget the previous
  selected_recipes and selected_packages.

In Hob code, two places will cause recipe parsing. One is settings are changed.
The other is machine is changed.

[Yocto #2255]

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

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 4997cd4..849a1f0 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -26,6 +26,7 @@ import copy
 import os
 import subprocess
 import shlex
+import glib
 from bb.ui.crumbs.template import TemplateMgr
 from bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage
 from bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage
@@ -259,6 +260,7 @@ class Builder(gtk.Window):
         self.handler = hobHandler
 
         self.template = None
+        self.loaded_images = []
 
         # build step
         self.current_step = None
@@ -339,7 +341,8 @@ class Builder(gtk.Window):
         self.set_user_config()
         self.handler.parse_generate_configuration()
 
-    def populate_recipe_package_info_async(self):
+    def populate_recipe_package_info_async(self, mach_changed = True):
+        self.mach_changed = mach_changed
         self.switch_page(self.RCPPKGINFO_POPULATING)
         # Parse recipes
         self.set_user_config()
@@ -395,6 +398,12 @@ class Builder(gtk.Window):
         self.template.load(path)
         self.configuration.load(self.template)
 
+        entry = {}
+        entry["image"] = self.configuration.selected_image
+        entry["recipes"] = self.configuration.selected_recipes[:]
+        entry["packages"] = self.configuration.selected_packages[:]
+        self.loaded_images.append(entry)
+
         for layer in self.configuration.layers:
             if not os.path.exists(layer+'/conf/layer.conf'):
                 return False
@@ -589,17 +598,57 @@ class Builder(gtk.Window):
         self.window_sensitive(True)
 
     def rcppkglist_populated(self):
+        # remember those images loaded previously in this Hob session
+        for entry in self.loaded_images:
+            self.recipe_model.image_list_append(entry["image"],
+                " ".join(entry["recipes"]),
+                " ".join(entry["packages"]))
+
+        if self.mach_changed:
+            self.update_rcppkglist_forgotten(self.configuration.selected_image)
+        else:
+            self.update_rcppkglist_remembered()
+
+    def update_rcppkglist_idle(self, selected_image, selected_recipes, selected_packages):
+        self.update_recipe_model(selected_image, selected_recipes)
+        self.update_package_model(selected_packages)
+        self.window_sensitive(True)
+
+    def update_rcppkglist_forgotten(self, selected_image = None):
+        self.window_sensitive(False)
+
+        selected_recipes = selected_packages = []
+        self.recipe_model.reset()
+        self.package_model.reset()
+
+        selected_image_desc = ""
+        if selected_image:
+            image_path = self.recipe_model.pn_path[selected_image]
+            image_iter = self.recipe_model.get_iter(image_path)
+            selected_packages = self.recipe_model.get_value(image_iter, self.recipe_model.COL_INSTALL).split()
+            selected_image_desc = self.recipe_model.get_value(image_iter, self.recipe_model.COL_DESC)
+
+        self.image_configuration_page.update_image_combo(self.recipe_model, selected_image, selected_image_desc)
+
+        glib.idle_add(self.update_rcppkglist_idle, selected_image, selected_recipes, selected_packages)
+
+
+    def update_rcppkglist_remembered(self):
+        self.window_sensitive(False)
+
         selected_image = self.configuration.selected_image
         selected_recipes = self.configuration.selected_recipes[:]
         selected_packages = self.configuration.selected_packages[:]
 
-        self.recipe_model.image_list_append(selected_image,
-                                            " ".join(selected_recipes),
-                                            " ".join(selected_packages))
+        selected_image_desc = ""
+        if selected_image:
+            image_path = self.recipe_model.pn_path[selected_image]
+            image_iter = self.recipe_model.get_iter(image_path)
+            selected_image_desc = self.recipe_model.get_value(image_iter, self.recipe_model.COL_DESC)
 
-        self.image_configuration_page.update_image_combo(self.recipe_model, selected_image)
-        self.update_recipe_model(selected_image, selected_recipes)
-        self.update_package_model(selected_packages)
+        self.image_configuration_page.update_image_combo(self.recipe_model, selected_image, selected_image_desc)
+
+        glib.idle_add(self.update_rcppkglist_idle, selected_image, selected_recipes, selected_packages)
 
     def recipelist_changed_cb(self, recipe_model):
         self.recipe_details_page.refresh_selection()
@@ -905,7 +954,7 @@ class Builder(gtk.Window):
         if not self.configuration.curr_mach:
             self.update_config_async()
         else:
-            self.populate_recipe_package_info_async()
+            self.populate_recipe_package_info_async(mach_changed = False)
 
     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 c2e0f5f..c63fc61 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -21,7 +21,6 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import gtk
-import glib
 from bb.ui.crumbs.progressbar import HobProgressBar
 from bb.ui.crumbs.hobcolor import HobColors
 from bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton, HobAltButton, HobButton
@@ -259,7 +258,7 @@ class ImageConfigurationPage (HobPage):
 
         self.builder.configuration.curr_mach = combo_item
         # Do reparse recipes
-        self.builder.populate_recipe_package_info_async()
+        self.builder.populate_recipe_package_info_async(mach_changed = True)
 
     def update_machine_combo(self):
         all_machines = self.builder.parameters.all_machines
@@ -280,32 +279,11 @@ class ImageConfigurationPage (HobPage):
             active += 1
         self.machine_combo.set_active(-1)
 
-    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)
-        self.builder.window_sensitive(True)
-
     def image_combo_changed_cb(self, combo):
-        self.builder.window_sensitive(False)
         selected_image = self.image_combo.get_active_text()
         if not selected_image:
             return
-
-        selected_recipes = []
-
-        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.builder.recipe_model.reset()
-        self.builder.package_model.reset()
-
-        self.show_baseimg_selected()
-
-        glib.idle_add(self.image_combo_changed_idle_cb, selected_image, selected_recipes, selected_packages)
+        self.builder.update_rcppkglist_forgotten(selected_image)
 
     def _image_combo_connect_signal(self):
         if not self.image_combo_id:
@@ -316,7 +294,7 @@ class ImageConfigurationPage (HobPage):
             self.image_combo.disconnect(self.image_combo_id)
             self.image_combo_id = None
 
-    def update_image_combo(self, recipe_model, selected_image):
+    def update_image_combo(self, recipe_model, selected_image, selected_image_desc):
         # Update the image combo according to the images in the recipe_model
         # populate image combo
         filter = {RecipeListModel.COL_TYPE : ['image']}
@@ -348,6 +326,8 @@ class ImageConfigurationPage (HobPage):
 
         if active != -1:
             self.show_baseimg_selected()
+            mark = "<span %s>%s</span>\n" % (self.span_tag('small'), selected_image_desc)
+            self.image_desc.set_markup(mark)
 
         self._image_combo_connect_signal()
 
-- 
1.7.6




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

* Re: [PATCH 20/20] Hob: change the logic for rcppkglist_populated()
  2012-04-08 10:21 ` [PATCH 20/20] Hob: change the logic for rcppkglist_populated() Shane Wang
@ 2012-04-09  4:40   ` Wang, Shane
  0 siblings, 0 replies; 22+ messages in thread
From: Wang, Shane @ 2012-04-09  4:40 UTC (permalink / raw)
  To: Wang, Shane, bitbake-devel@lists.openembedded.org

Skip this patch only, I am going to send another version to fix the bug.

--
Shane

Shane Wang wrote on 2012-04-08:

> There are some bugs in the previous log of rcppkglist_populated. [Yocto
> #2255] is one of them.
> 
> Once more, when the user loads a template, changes the base image to the
> other one which is not the same as the one in the template, changes the
> machine, and then you will find the base image specified in the template
> disappears.
> 
> This patch changes the logic as follows:
> - If any template is loaded into this Hob session, its base image will be
>   remembered always. After the recipe list and the package list are
>   populated, the template base image will be appended. That is to fix
>   the above bug. - If the reason for reparsing recipes is any settings
>   are changed, Hob will remember selected_recipes and selected_packages.
>   The behaviour is the same as before, because we don't want to clear
>   the user selection. - If the reason for reparsing recipes is the
>   machine is changed, including a template is loaded (which causes the
>   machine is changed), Hob will forget selected_recipes and
>   selected_packages the user selects. (see [Yocto #2255] for details)
> - Again, we reuse the code for rcppkglist_populated() for any base image
> changing.
>   I.e., when the user changes any base image, Hob will forget the previous
>   selected_recipes and selected_packages.
> In Hob code, two places will cause recipe parsing. One is settings are
> changed. The other is machine is changed.
> 
> [Yocto #2255]
> 
> Signed-off-by: Shane Wang <shane.wang@intel.com>
> ---
>  bitbake/lib/bb/ui/crumbs/builder.py                |   65
>  +++++++++++++++++--- bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
>  |   30 ++-------- 2 files changed, 62 insertions(+), 33 deletions(-)
> diff --git a/bitbake/lib/bb/ui/crumbs/builder.py
> b/bitbake/lib/bb/ui/crumbs/builder.py index 4997cd4..849a1f0 100755 ---
> a/bitbake/lib/bb/ui/crumbs/builder.py +++
> b/bitbake/lib/bb/ui/crumbs/builder.py @@ -26,6 +26,7 @@ import copy
>  import os import subprocess import shlex +import glib from
>  bb.ui.crumbs.template import TemplateMgr from
>  bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage from
>  bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage
> @@ -259,6 +260,7 @@ class Builder(gtk.Window):
>          self.handler = hobHandler
>          
>          self.template = None
> +        self.loaded_images = []
> 
>          # build step self.current_step = None @@ -339,7 +341,8 @@ class
>          Builder(gtk.Window): self.set_user_config()
>          self.handler.parse_generate_configuration()
> -    def populate_recipe_package_info_async(self):
> +    def populate_recipe_package_info_async(self, mach_changed = True):
> +        self.mach_changed = mach_changed
>          self.switch_page(self.RCPPKGINFO_POPULATING) # Parse recipes
>          self.set_user_config() @@ -395,6 +398,12 @@ class
>          Builder(gtk.Window): self.template.load(path)
>          self.configuration.load(self.template)
> +        entry = {}
> +        entry["image"] = self.configuration.selected_image
> +        entry["recipes"] = self.configuration.selected_recipes[:]
> +        entry["packages"] = self.configuration.selected_packages[:]
> +        self.loaded_images.append(entry)
> +
>          for layer in self.configuration.layers:
>              if not os.path.exists(layer+'/conf/layer.conf'):
>                  return False
> @@ -589,17 +598,57 @@ class Builder(gtk.Window):
>          self.window_sensitive(True)
>      def rcppkglist_populated(self):
> +        # remember those images loaded previously in this Hob session +
>        for entry in self.loaded_images: +           
> self.recipe_model.image_list_append(entry["image"], +                "
> ".join(entry["recipes"]), +                " ".join(entry["packages"]))
> + +        if self.mach_changed: +
> self.update_rcppkglist_forgotten(self.configuration.selected_image) +   
>     else: +            self.update_rcppkglist_remembered() + +    def
> update_rcppkglist_idle(self, selected_image, selected_recipes,
> selected_packages): +        self.update_recipe_model(selected_image,
> selected_recipes) +        self.update_package_model(selected_packages)
> +        self.window_sensitive(True) + +    def
> update_rcppkglist_forgotten(self, selected_image = None): +       
> self.window_sensitive(False) + +        selected_recipes =
> selected_packages = [] +        self.recipe_model.reset() +       
> self.package_model.reset() + +        selected_image_desc = "" +       
> if selected_image: +            image_path =
> self.recipe_model.pn_path[selected_image] +            image_iter =
> self.recipe_model.get_iter(image_path) +            selected_packages =
> self.recipe_model.get_value(image_iter,
> self.recipe_model.COL_INSTALL).split() +            selected_image_desc
> = self.recipe_model.get_value(image_iter, self.recipe_model.COL_DESC) +
> + self.image_configuration_page.update_image_combo(self.recipe_model,
> selected_image, selected_image_desc) + +       
> glib.idle_add(self.update_rcppkglist_idle, selected_image,
> selected_recipes, selected_packages) + + +    def
> update_rcppkglist_remembered(self): +       
> self.window_sensitive(False) +
>          selected_image = self.configuration.selected_image
>          selected_recipes = self.configuration.selected_recipes[:]
>          selected_packages = self.configuration.selected_packages[:]
> -        self.recipe_model.image_list_append(selected_image, -          
>                                  " ".join(selected_recipes), -          
>                                  " ".join(selected_packages)) +       
> selected_image_desc = "" +        if selected_image: +           
> image_path = self.recipe_model.pn_path[selected_image] +           
> image_iter = self.recipe_model.get_iter(image_path) +           
> selected_image_desc = self.recipe_model.get_value(image_iter,
> self.recipe_model.COL_DESC)
> 
> - self.image_configuration_page.update_image_combo(self.recipe_model,
> selected_image) -        self.update_recipe_model(selected_image,
> selected_recipes) -        self.update_package_model(selected_packages)
> + self.image_configuration_page.update_image_combo(self.recipe_model,
> selected_image, selected_image_desc) + +       
> glib.idle_add(self.update_rcppkglist_idle, selected_image,
> selected_recipes, selected_packages)
> 
>      def recipelist_changed_cb(self, recipe_model):
>          self.recipe_details_page.refresh_selection() @@ -905,7 +954,7
>          @@ class Builder(gtk.Window): if not
>          self.configuration.curr_mach:
>              self.update_config_async()
>          else:
> -            self.populate_recipe_package_info_async() +           
> self.populate_recipe_package_info_async(mach_changed = False)
> 
>      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
> c2e0f5f..c63fc61 100644 ---
> a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +++
> b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py @@ -21,7 +21,6 @@
>  # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
>  
>  import gtk -import glib from bb.ui.crumbs.progressbar import
>  HobProgressBar from bb.ui.crumbs.hobcolor import HobColors from
>  bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton,
> HobAltButton, HobButton
> @@ -259,7 +258,7 @@ class ImageConfigurationPage (HobPage):
> 
>          self.builder.configuration.curr_mach = combo_item
>          # Do reparse recipes
> -        self.builder.populate_recipe_package_info_async()
> +        self.builder.populate_recipe_package_info_async(mach_changed
> = True)
> 
>      def update_machine_combo(self):
>          all_machines = self.builder.parameters.all_machines
> @@ -280,32 +279,11 @@ class ImageConfigurationPage (HobPage):
>              active += 1
>          self.machine_combo.set_active(-1)
> -    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) -       
> self.builder.window_sensitive(True) -
>      def image_combo_changed_cb(self, combo):
> -        self.builder.window_sensitive(False)
>          selected_image = self.image_combo.get_active_text()
>          if not selected_image:
>              return
> - -        selected_recipes = [] - -        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.builder.recipe_model.reset() -       
> self.builder.package_model.reset() - -       
> self.show_baseimg_selected() - -       
> glib.idle_add(self.image_combo_changed_idle_cb, selected_image,
> selected_recipes, selected_packages) +       
> self.builder.update_rcppkglist_forgotten(selected_image)
> 
>      def _image_combo_connect_signal(self):
>          if not self.image_combo_id:
> @@ -316,7 +294,7 @@ class ImageConfigurationPage (HobPage):
>              self.image_combo.disconnect(self.image_combo_id)
>              self.image_combo_id = None
> -    def update_image_combo(self, recipe_model, selected_image):
> +    def update_image_combo(self, recipe_model, selected_image,
> selected_image_desc):
>          # Update the image combo according to the images in the
>          recipe_model # populate image combo filter =
>          {RecipeListModel.COL_TYPE : ['image']}
> @@ -348,6 +326,8 @@ class ImageConfigurationPage (HobPage):
> 
>          if active != -1:
>              self.show_baseimg_selected()
> +            mark = "<span %s>%s</span>\n" % (self.span_tag('small'),
> selected_image_desc) +            self.image_desc.set_markup(mark)
> 
>          self._image_combo_connect_signal()





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

end of thread, other threads:[~2012-04-09  4:49 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-08 10:20 [PATCH 00/20] Hob fixes and cleanups Shane Wang
2012-04-08 10:21 ` [PATCH 01/20] Hob: fix version check - Hob can run on pygtk 2.21.0 Shane Wang
2012-04-08 10:21 ` [PATCH 02/20] Hob: add fadeout display effection for recipe view include page Shane Wang
2012-04-08 10:21 ` [PATCH 03/20] Hob: add fadeout display effection for package " Shane Wang
2012-04-08 10:21 ` [PATCH 04/20] Hob: Add the tooltips for recipe view page as request Shane Wang
2012-04-08 10:21 ` [PATCH 05/20] Hob: correct indent Shane Wang
2012-04-08 10:21 ` [PATCH 06/20] Hob: clean up and unify the steps for new build to call initiate_new_build_async() Shane Wang
2012-04-08 10:21 ` [PATCH 07/20] Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async() Shane Wang
2012-04-08 10:21 ` [PATCH 08/20] Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async() Shane Wang
2012-04-08 10:21 ` [PATCH 09/20] 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-08 10:21 ` [PATCH 10/20] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async() Shane Wang
2012-04-08 10:21 ` [PATCH 11/20] Hob: clean up to call clear_busy() in hobeventhandler.py Shane Wang
2012-04-08 10:21 ` [PATCH 12/20] Hob: clean up and unify get_parameters() to be get_parameters_sync() Shane Wang
2012-04-08 10:21 ` [PATCH 13/20] Hob: clean up request_package_info_async() Shane Wang
2012-04-08 10:21 ` [PATCH 14/20] Hob: clean up cancel_build() Shane Wang
2012-04-08 10:21 ` [PATCH 15/20] Hob: clean up generate_configuration() Shane Wang
2012-04-08 10:21 ` [PATCH 16/20] Hob: clean up and reword stop_parse() Shane Wang
2012-04-08 10:21 ` [PATCH 17/20] Hob: handle some steps for build-succeeded and build-failed by hob event handler itself Shane Wang
2012-04-08 10:21 ` [PATCH 18/20] Hob: tooltip change for "Build image" button Shane Wang
2012-04-08 10:21 ` [PATCH 19/20] Hob: add tooltips into image details screen Shane Wang
2012-04-08 10:21 ` [PATCH 20/20] Hob: change the logic for rcppkglist_populated() Shane Wang
2012-04-09  4:40   ` Wang, Shane

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.