Hob fixes and cleanups
cover Hob fixes and cleanups
Those patches fix the following:
- the UI bug to fade out the entry in the "Included" page when it is removed
- add and correct tooltips reviewed by Scott
- clean up the code and maximize reusage, for exception handling
- misc
The following changes since commit 190f6d791d51aaa4cfb9f1cf932bc205ff674fb5:
runqemu-internal: Add console=tty for qemuppc and NFS (2012-04-06 01:12:47 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib shane/hob-fixes-continue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob-fixes-continue
Liming An (4):
Hob: add fadeout display effection for recipe view include page
Hob: add fadeout display effection for package view include page
Hob: Add the tooltips for recipe view page as request Hob:Fixed some incorrect values of Build configuration tab
Shane Wang (17):
Hob: fix version check - Hob can run on pygtk 2.21.0
Hob: correct indent
Hob: clean up and unify the steps for new build to call
initiate_new_build_async()
Hob: clean up and unify the steps for CONFIG_UPDATE to call
update_config_async()
Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call
populate_recipe_package_info_async()
Hob: clean up and unify the steps for PACKAGE_GENERATING and
FAST_IMAGE_GENERATING to call generate_packages_async() and fast_generate_image_async()
Hob: clean up and unify the steps for IMAGE_GENERATING to call
generate_image_async()
Hob: clean up to call clear_busy() in hobeventhandler.py
Hob: clean up and unify get_parameters() to be get_parameters_sync()
Hob: clean up request_package_info_async()
Hob: clean up cancel_build()
Hob: clean up generate_configuration()
Hob: clean up and reword stop_parse()
Hob: tooltip change for "Build image" button
Hob: add tooltips into image details screen
Hob: forget selected_recipes and selected_packages after users change
the machine
Hob: show those appliable buttons on the image details page only
bitbake/lib/bb/ui/crumbs/builddetailspage.py | 20 ++- bitbake/lib/bb/ui/crumbs/builder.py | 164 +++++++++++--------- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 7 +- bitbake/lib/bb/ui/crumbs/hoblistmodel.py | 35 ++++- bitbake/lib/bb/ui/crumbs/hobwidget.py | 155 ++++++++++++++++--- bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 30 +++- bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 136 +++++++++++----- bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 54 ++++++- bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | 58 ++++++- bitbake/lib/bb/ui/hob.py | 2 +- 10 files changed, 482 insertions(+), 179 deletions(-)
Signature · 1 line
1.7.6
PATCH 1/21 Hob: fix version check - Hob can run on pygtk 2.21.0
--- bitbake/lib/bb/ui/hob.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
bitbake/lib/bb/ui/hob.py +1 -1
@@ -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)))
Signature · 1 line
1.7.6
PATCH 2/21 Hob: add fadeout display effection for recipe view include page
From: Liming An <[email protected]>
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]
--- 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(-)
bitbake/lib/bb/ui/crumbs/hoblistmodel.py +16 -6
@@ -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):
bitbake/lib/bb/ui/crumbs/hobwidget.py +106 -23
214 lines not on this page · raw message
bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +44 -6
72 lines not on this page · raw message
Signature · 1 line
1.7.6
PATCH 3/21 Hob: add fadeout display effection for package view include page
In reply to Shane WangFrom: Liming An <[email protected]>
[YOCTO #2100]
--- 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(-)
bitbake/lib/bb/ui/crumbs/hoblistmodel.py +15 -2
@@ -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)
bitbake/lib/bb/ui/crumbs/hobwidget.py +5 -1
@@ -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)
bitbake/lib/bb/ui/crumbs/packageselectionpage.py +46 -6
74 lines not on this page · raw message
bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +1 -1
@@ -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):
Signature · 1 line
1.7.6
PATCH 4/21 Hob: Add the tooltips for recipe view page as request
In reply to Shane WangFrom: Liming An <[email protected]>
[YOCTO #2229]
--- bitbake/lib/bb/ui/crumbs/hobwidget.py | 22 ++++++++++++++++++++-- bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | 8 ++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)
bitbake/lib/bb/ui/crumbs/hobwidget.py +20 -2
@@ -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:
bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +8 -0
@@ -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
Signature · 1 line
1.7.6
PATCH 5/21 Hob: correct indent
In reply to Shane Wang--- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/bb/ui/crumbs/hobeventhandler.py +2 -2
@@ -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 ""
Signature · 1 line
1.7.6
PATCH 6/21 Hob: clean up and unify the steps for new build to call initiate_new_build_async()
In reply to Shane Wanginitiate_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().
--- bitbake/lib/bb/ui/crumbs/builder.py | 19 +++++++------------ bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +7 -12
@@ -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)
bitbake/lib/bb/ui/crumbs/imagedetailspage.py +1 -1
@@ -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()
Signature · 1 line
1.7.6
PATCH 7/21 Hob: clean up and unify the steps for CONFIG_UPDATE to call update_config_async()
In reply to Shane WangFor the steps in CONFIG_UPDATE, the patch consolidates them into update_config_async() to call.
consequently remove CONFIG_UPDATE since MACHINE_SELECTION covers it.
--- bitbake/lib/bb/ui/crumbs/builder.py | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +9 -12
@@ -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)
Signature · 1 line
1.7.6
PATCH 8/21 Hob: clean up and unify the steps for RCPPKGINFO_POPULATING to call populate_recipe_package_info_async()
In reply to Shane WangFor the steps in RCPPKGINFO_POPULATING, This patch consolidates them into populate_recipe_package_info_async() to call.
--- bitbake/lib/bb/ui/crumbs/builder.py | 14 +++++++------- bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +7 -7
@@ -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:
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +1 -1
@@ -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
Signature · 1 line
1.7.6
PATCH 9/21 Hob: clean up and unify the steps for PACKAGE_GENERATING and FAST_IMAGE_GENERATING to call generate_packages_async() and fast_generate_image_async()
In reply to Shane WangFor 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.
--- bitbake/lib/bb/ui/crumbs/builder.py | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +19 -11
@@ -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:
Signature · 1 line
1.7.6
PATCH 10/21 Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async()
In reply to Shane WangFor the steps in IMAGE_GENERATING, the patch consolidates them into generate_image_async() to call.
--- bitbake/lib/bb/ui/crumbs/builder.py | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +16 -16
@@ -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()
Signature · 1 line
1.7.6
PATCH 11/21 Hob: clean up to call clear_busy() in hobeventhandler.py
In reply to Shane Wang--- bitbake/lib/bb/ui/crumbs/builder.py | 1 - bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 1 + 2 files changed, 1 insertions(+), 1 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +0 -1
@@ -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)
bitbake/lib/bb/ui/crumbs/hobeventhandler.py +1 -0
@@ -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,
Signature · 1 line
1.7.6
PATCH 12/21 Hob: clean up and unify get_parameters() to be get_parameters_sync()
In reply to Shane Wang--- bitbake/lib/bb/ui/crumbs/builder.py | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +6 -3
@@ -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:
Signature · 1 line
1.7.6
PATCH 13/21 Hob: clean up request_package_info_async()
In reply to Shane Wang--- bitbake/lib/bb/ui/crumbs/builder.py | 5 ++++- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +4 -1
@@ -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)
bitbake/lib/bb/ui/crumbs/hobeventhandler.py +1 -1
@@ -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)
Signature · 1 line
1.7.6
PATCH 14/21 Hob: clean up cancel_build()
In reply to Shane Wang--- bitbake/lib/bb/ui/crumbs/builder.py | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +5 -2
@@ -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)
Signature · 1 line
1.7.6
PATCH 16/21 Hob: clean up and reword stop_parse()
In reply to Shane Wang--- bitbake/lib/bb/ui/crumbs/builder.py | 6 +++--- bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +3 -3
@@ -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,"
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +1 -1
@@ -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()
Signature · 1 line
1.7.6
PATCH 15/21 Hob: clean up generate_configuration()
In reply to Shane Wang--- bitbake/lib/bb/ui/crumbs/builder.py | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +4 -1
@@ -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)
Signature · 1 line
1.7.6
PATCH 17/21 Hob: tooltip change for "Build image" button
In reply to Shane Wang[Yocto #2242]
--- bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
bitbake/lib/bb/ui/crumbs/packageselectionpage.py +1 -1
@@ -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)
Signature · 1 line
1.7.6
PATCH 18/21 Hob: add tooltips into image details screen
In reply to Shane Wang[Yocto #2243]
--- bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-)
bitbake/lib/bb/ui/crumbs/imagedetailspage.py +11 -5
@@ -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)
Signature · 1 line
1.7.6
PATCH 19/21 Hob: forget selected_recipes and selected_packages after users change the machine
In reply to Shane WangThe patch is to fix [Yocto #2255]. Now the logic is:
- If users change the machine, the image combo is empty for users to select.
- If users load the template, the image combo should set the value of selected_image specified in the template.
- After loading a template, if users change the machine, the selected_image specified in the template should be removed from the image combo because it is probably invalid for a new machine.
- If users customize the recipe/package list, and change the settings which causes reparsing, selected_recipes and selected_packages should be remembered.
- If users add more layers, selected_recipes and selected_packages should be remembered.
--- bitbake/lib/bb/ui/crumbs/builder.py | 1 + bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 26 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +1 -0
@@ -598,6 +598,7 @@ class Builder(gtk.Window): " ".join(selected_packages)) self.image_configuration_page.update_image_combo(self.recipe_model, selected_image) + self.image_configuration_page.update_image_desc(selected_image) self.update_recipe_model(selected_image, selected_recipes) self.update_package_model(selected_packages)
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +23 -3
@@ -37,6 +37,10 @@ class ImageConfigurationPage (HobPage): super(ImageConfigurationPage, self).__init__(builder, "Image configuration") self.image_combo_id = None + # we use machine_combo_changed_by_manual to identify the machine is changed by code + # or by manual. If by manual, all user's recipe selection and package selection are + # cleared. + self.machine_combo_changed_by_manual = True self.create_visual_elements() def create_visual_elements(self):
@@ -258,6 +262,13 @@ class ImageConfigurationPage (HobPage): return self.builder.configuration.curr_mach = combo_item + if self.machine_combo_changed_by_manual: + self.builder.configuration.selected_image = None + self.builder.configuration.selected_recipes = [] + self.builder.configuration.selected_packages = [] + # reset machine_combo_changed_by_manual + self.machine_combo_changed_by_manual = True + # Do reparse recipes self.builder.populate_recipe_package_info_async()
@@ -271,6 +282,7 @@ class ImageConfigurationPage (HobPage): self.machine_combo.set_active(-1) def switch_machine_combo(self): + self.machine_combo_changed_by_manual = False model = self.machine_combo.get_model() active = 0 while active < len(model):
@@ -280,6 +292,16 @@ class ImageConfigurationPage (HobPage): active += 1 self.machine_combo.set_active(-1) + def update_image_desc(self, selected_image): + desc = "" + if selected_image and selected_image in self.builder.recipe_model.pn_path.keys(): + image_path = self.builder.recipe_model.pn_path[selected_image] + image_iter = self.builder.recipe_model.get_iter(image_path) + desc = self.builder.recipe_model.get_value(image_iter, self.builder.recipe_model.COL_DESC) + + mark = ("<span %s>%s</span>\n") % (self.span_tag('small'), desc) + self.image_desc.set_markup(mark) + def image_combo_changed_idle_cb(self, selected_image, selected_recipes, selected_packages): self.builder.update_recipe_model(selected_image, selected_recipes) self.builder.update_package_model(selected_packages)
@@ -296,9 +318,7 @@ class ImageConfigurationPage (HobPage): image_path = self.builder.recipe_model.pn_path[selected_image] image_iter = self.builder.recipe_model.get_iter(image_path) selected_packages = self.builder.recipe_model.get_value(image_iter, self.builder.recipe_model.COL_INSTALL).split() - - mark = ("<span %s>%s</span>\n") % (self.span_tag('small'), self.builder.recipe_model.get_value(image_iter, self.builder.recipe_model.COL_DESC)) - self.image_desc.set_markup(mark) + self.update_image_desc(selected_image) self.builder.recipe_model.reset() self.builder.package_model.reset()
Signature · 1 line
1.7.6
PATCH 20/21 Hob: show those appliable buttons on the image details page only
In reply to Shane WangWe don't use "grayed out" but use "show/hide" for those appliable buttons in the image details page.
[Yocto #2143]
--- bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 122 ++++++++++++++++++-------- 1 files changed, 84 insertions(+), 38 deletions(-)
bitbake/lib/bb/ui/crumbs/imagedetailspage.py +84 -38
@@ -113,6 +113,8 @@ class ImageDetailsPage (HobPage): super(ImageDetailsPage, self).__init__(builder, "Image details") self.image_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_BOOLEAN) + self.button_ids = {} + self.details_bottom_buttons = gtk.HBox(False, 6) self.create_visual_elements() def create_visual_elements(self):
@@ -150,6 +152,9 @@ class ImageDetailsPage (HobPage): children = self.box_group_area.get_children() or [] for child in children: self.box_group_area.remove(child) + children = self.details_bottom_buttons.get_children() or [] + for child in children: + self.details_bottom_buttons.remove(child) def show_page(self, step): build_succeeded = (step == self.builder.IMAGE_GENERATED)
@@ -163,10 +168,15 @@ class ImageDetailsPage (HobPage): else: pkg_num = "N/A" + # remove + for button_id, button in self.button_ids.items(): + button.disconnect(button_id) self._remove_all_widget() + # repack self.pack_start(self.details_top_buttons, expand=False, fill=False) self.pack_start(self.group_align, expand=True, fill=True) + self.build_result = None if build_succeeded: # building is the previous step icon = gtk.Image()
@@ -176,43 +186,48 @@ class ImageDetailsPage (HobPage): icon.set_from_pixbuf(pix_buffer) varlist = [""] vallist = ["Your image is ready"] - build_result = self.DetailBox(varlist=varlist, vallist=vallist, icon=icon, color=color) - self.box_group_area.pack_start(build_result, expand=False, fill=False) + self.build_result = self.DetailBox(varlist=varlist, vallist=vallist, icon=icon, color=color) + self.box_group_area.pack_start(self.build_result, expand=False, fill=False) # create the buttons at the bottom first because the buttons are used in apply_button_per_image() if build_succeeded: - buttonlist = ["Build new image", "Save as template", "Run image", "Deploy image"] + self.buttonlist = ["Build new image", "Save as template", "Run image", "Deploy image"] else: # get to this page from "My images" - buttonlist = ["Build new image", "Run image", "Deploy image"] - details_bottom_buttons = self.create_bottom_buttons(buttonlist) + self.buttonlist = ["Build new image", "Run image", "Deploy image"] # Name self.image_store.clear() default_toggled = False default_image_size = 0 + i = 0 for image_name in image_names: image_size = HobPage._size_to_string(os.stat(os.path.join(image_addr, image_name)).st_size) if not default_toggled: default_toggled = (self.test_type_runnable(image_name) and self.test_mach_runnable(image_name)) \ or self.test_deployable(image_name) + if i == (len(image_names) - 1): + default_toggled = True self.image_store.set(self.image_store.append(), 0, image_name, 1, image_size, 2, default_toggled) if default_toggled: default_image_size = image_size - self.apply_buttons_per_image(image_name) + self.create_bottom_buttons(self.buttonlist, image_name) else: self.image_store.set(self.image_store.append(), 0, image_name, 1, image_size, 2, False) + i = i + 1 image_table = HobViewTable(self.__columns__) image_table.set_model(self.image_store) image_table.connect("toggled", self.toggled_cb) view_files_button = HobAltButton("View files") view_files_button.connect("clicked", self.view_files_clicked_cb, image_addr) view_files_button.set_tooltip_text("Open the directory containing the image files") - self.box_group_area.pack_start(self.DetailBox(widget=image_table, button=view_files_button), expand=True, fill=True) + self.image_detail = self.DetailBox(widget=image_table, button=view_files_button) + self.box_group_area.pack_start(self.image_detail, expand=True, fill=True) # Machine, Base image and Layers layer_num_limit = 15 varlist = ["Machine: ", "Base image: ", "Layers: "] vallist = [] + self.setting_detail = None if build_succeeded: vallist.append(machine) vallist.append(base_image)
@@ -236,8 +251,8 @@ class ImageDetailsPage (HobPage): edit_config_button = HobAltButton("Edit configuration") edit_config_button.set_tooltip_text("Edit machine, base image and recipes") edit_config_button.connect("clicked", self.edit_config_button_clicked_cb) - setting_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=edit_config_button) - self.box_group_area.pack_start(setting_detail, expand=False, fill=False) + self.setting_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=edit_config_button) + self.box_group_area.pack_start(self.setting_detail, expand=False, fill=False) # Packages included, and Total image size varlist = ["Packages included: ", "Total image size: "]
@@ -254,7 +269,7 @@ class ImageDetailsPage (HobPage): self.box_group_area.pack_start(self.package_detail, expand=False, fill=False) # pack the buttons at the bottom, at this time they are already created. - self.box_group_area.pack_end(details_bottom_buttons, expand=False, fill=False) + self.box_group_area.pack_end(self.details_bottom_buttons, expand=False, fill=False) self.show_all()
@@ -289,10 +304,6 @@ class ImageDetailsPage (HobPage): break return deployable - def apply_buttons_per_image(self, image_name): - self.run_button.set_sensitive(self.test_type_runnable(image_name) and self.test_mach_runnable(image_name)) - self.deploy_button.set_sensitive(self.test_deployable(image_name)) - def toggled_cb(self, table, cell, path, columnid, tree): model = tree.get_model() if not model:
@@ -307,50 +318,86 @@ class ImageDetailsPage (HobPage): self.refresh_package_detail_box(model[path][1]) image_name = model[path][0] - self.apply_buttons_per_image(image_name) - def create_bottom_buttons(self, buttonlist): + # remove + for button_id, button in self.button_ids.items(): + button.disconnect(button_id) + self._remove_all_widget() + # repack + self.pack_start(self.details_top_buttons, expand=False, fill=False) + self.pack_start(self.group_align, expand=True, fill=True) + if self.build_result: + self.box_group_area.pack_start(self.build_result, expand=False, fill=False) + self.box_group_area.pack_start(self.image_detail, expand=True, fill=True) + if self.setting_detail: + self.box_group_area.pack_start(self.setting_detail, expand=False, fill=False) + self.box_group_area.pack_start(self.package_detail, expand=False, fill=False) + self.create_bottom_buttons(self.buttonlist, image_name) + self.box_group_area.pack_end(self.details_bottom_buttons, expand=False, fill=False) + self.show_all() + + def create_bottom_buttons(self, buttonlist, image_name): # Create the buttons at the bottom - bottom_buttons = gtk.HBox(False, 6) created = False + packed = False + self.button_ids = {} # create button "Deploy image" name = "Deploy image" - if name in buttonlist: - self.deploy_button = HobButton('Deploy image') - self.deploy_button.set_size_request(205, 49) - self.deploy_button.set_tooltip_text("Burn a live image to a USB drive or flash memory") - self.deploy_button.set_flags(gtk.CAN_DEFAULT) - self.deploy_button.connect("clicked", self.deploy_button_clicked_cb) - bottom_buttons.pack_end(self.deploy_button, expand=False, fill=False) + if name in buttonlist and self.test_deployable(image_name): + deploy_button = HobButton('Deploy image') + deploy_button.set_size_request(205, 49) + deploy_button.set_tooltip_text("Burn a live image to a USB drive or flash memory") + deploy_button.set_flags(gtk.CAN_DEFAULT) + button_id = deploy_button.connect("clicked", self.deploy_button_clicked_cb) + self.button_ids[button_id] = deploy_button + self.details_bottom_buttons.pack_end(deploy_button, expand=False, fill=False) created = True + packed = True name = "Run image" - if name in buttonlist: + if name in buttonlist and self.test_type_runnable(image_name) and self.test_mach_runnable(image_name): if created == True: # separator label = gtk.Label(" or ") - bottom_buttons.pack_end(label, expand=False, fill=False) + self.details_bottom_buttons.pack_end(label, expand=False, fill=False) - # create button "Run image" - self.run_button = HobAltButton("Run image") - self.run_button.set_tooltip_text("Start up an image with qemu emulator") - self.run_button.connect("clicked", self.run_button_clicked_cb) - bottom_buttons.pack_end(self.run_button, expand=False, fill=False) + # create button "Run image" + run_button = HobAltButton("Run image") + else: + # create button "Run image" as the primary button + run_button = HobButton("Run image") + run_button.set_size_request(205, 49) + run_button.set_flags(gtk.CAN_DEFAULT) + packed = True + run_button.set_tooltip_text("Start up an image with qemu emulator") + button_id = run_button.connect("clicked", self.run_button_clicked_cb) + self.button_ids[button_id] = run_button + self.details_bottom_buttons.pack_end(run_button, expand=False, fill=False) created = True + if not packed: + box = gtk.HBox(False, 6) + box.show() + subbox = gtk.HBox(False, 0) + subbox.set_size_request(205, 49) + subbox.show() + box.add(subbox) + self.details_bottom_buttons.pack_end(box, False, False) + name = "Save as template" if name in buttonlist: if created == True: # separator label = gtk.Label(" or ") - bottom_buttons.pack_end(label, expand=False, fill=False) + self.details_bottom_buttons.pack_end(label, expand=False, fill=False) # create button "Save as template" save_button = HobAltButton("Save as template") save_button.set_tooltip_text("Save the image configuration for reuse") - save_button.connect("clicked", self.save_button_clicked_cb) - bottom_buttons.pack_end(save_button, expand=False, fill=False) + button_id = save_button.connect("clicked", self.save_button_clicked_cb) + self.button_ids[button_id] = save_button + self.details_bottom_buttons.pack_end(save_button, expand=False, fill=False) create = True name = "Build new image"
@@ -358,10 +405,9 @@ class ImageDetailsPage (HobPage): # create button "Build new image" build_new_button = HobAltButton("Build new image") build_new_button.set_tooltip_text("Create a new image from scratch") - build_new_button.connect("clicked", self.build_new_button_clicked_cb) - bottom_buttons.pack_start(build_new_button, expand=False, fill=False) - - return bottom_buttons + button_id = build_new_button.connect("clicked", self.build_new_button_clicked_cb) + self.button_ids[button_id] = build_new_button + self.details_bottom_buttons.pack_start(build_new_button, expand=False, fill=False) def _get_selected_image(self): image_name = ""
Signature · 1 line
1.7.6
PATCH 21/21 Hob:Fixed some incorrect values of Build configuration tab
In reply to Shane WangFrom: Liming An <[email protected]>
Because some variables not be updated when building started, so add them to the updating function of configuration class, and add reset function of configurate treeview of building detail page
[YOCTO #2244]
--- bitbake/lib/bb/ui/crumbs/builddetailspage.py | 20 ++++++++++++-------- bitbake/lib/bb/ui/crumbs/builder.py | 14 +++++++------- 2 files changed, 19 insertions(+), 15 deletions(-)
bitbake/lib/bb/ui/crumbs/builddetailspage.py +12 -8
@@ -81,16 +81,16 @@ class BuildConfigurationTreeView(gtk.TreeView): # renew the tree model after get the configuration messages self.set_model(listmodel) - def show(self, src_config_info, src_params): + def show(self, src_config_info): vars = [] - vars.append(self.set_vars("BB version:", src_params.bb_version)) - vars.append(self.set_vars("Target arch:", src_params.target_arch)) - vars.append(self.set_vars("Target OS:", src_params.target_os)) + vars.append(self.set_vars("BB version:", src_config_info.bb_version)) + vars.append(self.set_vars("Target arch:", src_config_info.target_arch)) + vars.append(self.set_vars("Target OS:", src_config_info.target_os)) vars.append(self.set_vars("Machine:", src_config_info.curr_mach)) vars.append(self.set_vars("Distro:", src_config_info.curr_distro)) - vars.append(self.set_vars("Distro version:", src_params.distro_version)) + vars.append(self.set_vars("Distro version:", src_config_info.distro_version)) vars.append(self.set_vars("SDK machine:", src_config_info.curr_sdk_machine)) - vars.append(self.set_vars("Tune feature:", src_params.tune_pkgarch)) + vars.append(self.set_vars("Tune feature:", src_config_info.tune_pkgarch)) vars.append(self.set_vars("Layers:", src_config_info.layers)) for path in src_config_info.layers:
@@ -105,6 +105,9 @@ class BuildConfigurationTreeView(gtk.TreeView): self.set_config_model(vars) + def reset(self): + self.set_model(None) + # # BuildDetailsPage #
@@ -208,6 +211,7 @@ class BuildDetailsPage (HobPage): self.box_group_area.pack_start(self.vbox, expand=True, fill=True) self.progress_bar.reset() + self.config_tv.reset() self.vbox.pack_start(self.progress_box, expand=False, fill=False) self.vbox.pack_start(self.notebook, expand=True, fill=True)
@@ -244,5 +248,5 @@ class BuildDetailsPage (HobPage): if (v_adj.upper <= v_adj.page_size) or (v_adj.value == v_adj.upper - v_adj.page_size): treeview.scroll_to_cell(path) - def show_configurations(self, configurations, params): - self.config_tv.show(configurations, params) + def show_configurations(self, configurations): + self.config_tv.show(configurations)
bitbake/lib/bb/ui/crumbs/builder.py +7 -7
@@ -96,6 +96,12 @@ class Configuration: self.conf_version = params["conf_version"] self.lconf_version = params["lconf_version"] self.image_fstypes = params["image_fstypes"] + self.tune_arch = params["tune_arch"] + self.bb_version = params["bb_version"] + self.target_arch = params["target_arch"] + self.target_os = params["target_os"] + self.distro_version = params["distro_version"] + self.tune_pkgarch = params["tune_pkgarch"] # bblayers.conf self.layers = params["layer"].split()
@@ -201,12 +207,6 @@ class Parameters: self.runnable_machine_patterns = params["runnable_machine_patterns"].split() self.deployable_image_types = params["deployable_image_types"].split() self.tmpdir = params["tmpdir"] - self.distro_version = params["distro_version"] - self.target_os = params["target_os"] - self.target_arch = params["target_arch"] - self.tune_pkgarch = params["tune_pkgarch"] - self.bb_version = params["bb_version"] - self.tune_arch = params["tune_arch"] self.enable_proxy = False class Builder(gtk.Window):
@@ -653,7 +653,7 @@ class Builder(gtk.Window): elif self.current_step == self.PACKAGE_GENERATING: fraction = 0 self.build_details_page.update_progress_bar("Build Started: ", fraction) - self.build_details_page.show_configurations(self.configuration, self.parameters) + self.build_details_page.show_configurations(self.configuration) def build_succeeded(self): if self.current_step == self.FAST_IMAGE_GENERATING:
Signature · 1 line
1.7.6
Re: [PATCH 01/21] Hob: fix version check - Hob can run on pygtk 2.21.0
In reply to Shane WangQuoted 10 lines · Shane Wang
Signed-off-by Shane Wang<[email protected]>--- bitbake/lib/bb/ui/hob.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)bitbake/lib/bb/ui/hob.py +0
-0
bitbake/lib/bb/ui/hob.py try: · line 32
Quoted 5 lines
bitbake/lib/bb/ui/hob.py +1
-1@@ -29,7 +29,7 @@ try: import pygtk pygtk.require('2.0') # to be certain we don't have gtk+ 1.x !?! ver = gtk.pygtk_version - if ver< (2, 22, 0): + if ver< (2, 21, 0):
I've already sent a patch to lower this requirement.
bitbake/lib/bb/ui/hob.py try: · line 35
Quoted 3 lines
bitbake/lib/bb/ui/hob.py +0
-0sys.exit("%s (you have pygtk %s.%s.%s)." % (requirements, ver[0], ver[1], ver[2])) except ImportError as exc: sys.exit("%s (%s)." % (requirements, str(exc)))
Joshua
Signature · 3 lines
Joshua '贾詡' Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology CentreQuoted 37 lines · Shane Wang
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
- miscThe 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-contribshane/hob-fixes-continue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob-fixes-continueLiming An (4):
Hob: add fadeout display effection for recipe view include page
Hob: add fadeout display effection for package view include page
Hob: Add the tooltips for recipe view page as request Hob:Fixed some incorrect values of Build configuration tabShane 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 forCONFIG_UPDATEto call
update_config_async()
Hob: clean up and unify the steps forRCPPKGINFO_POPULATINGto call
populate_recipe_package_info_async()
Hob: clean up and unify the steps forPACKAGE_GENERATINGand
FAST_IMAGE_GENERATINGto callgenerate_packages_async()andfast_generate_image_async()
Hob: clean up and unify the steps forIMAGE_GENERATINGto call
generate_image_async()
Hob: clean up to callclear_busy()inhobeventhandler.py
Hob: clean up and unifyget_parameters()to beget_parameters_sync()
Hob: clean uprequest_package_info_async()
Quoted 8 lines
Hob: clean up
cancel_build()
Hob: clean upgenerate_configuration()
Hob: clean up and rewordstop_parse()
Hob: tooltip change for "Build image" button
Hob: add tooltips into image details screen
Hob: forgetselected_recipesandselected_packagesafter users change
the machine
Hob: show those appliable buttons on the image details page only
I've merged these apart from the version change for which I took Joshua's patches.
I have to say that cleanups at this point in the cycle are less than ideal, I've only taken them since they were unit tested with the rest of this and I can't really take one without the other.
Also, there were patch rejects on the fadeout patches and I had to merge things due to taking other patches so please check the final result.
Cheers,
Richard