Behavioural bug fixes for Hob
cover Behavioural bug fixes for Hob
This is the first of no doubt many patch series to fix bugs in the hob ui now that people have started trying to use it.
The following changes since commit c7a9ef70ba91d47d53074e8d78cbc52f396144a7:
bitbake/process.py: Ensure queued UI events are queued right before we add our own handler (2011-07-07 10:57:05 +0100)
are available in the git repository at:
git://github.com/incandescant/bitbake hob
https://github.com/incandescant/bitbake/tree/hob
Joshua Lock (3):
ui/crumbs/tasklistmodel: fix reset method lib/bb/hob: fix changing base image lib/bb/ui/hob: don't error when dismissing save as dialog
lib/bb/ui/crumbs/tasklistmodel.py | 20 ++++++++++++++++---- lib/bb/ui/hob.py | 30 +++++++++++++++++++----------- 2 files changed, 35 insertions(+), 15 deletions(-)
Signature · 1 line
1.7.6
PATCH 1/3 ui/crumbs/tasklistmodel: fix reset method
The reset() method only touched the contents sub-model, which does not include the selected image(s). This patch ensures that reset correctly unsets any image selection when called.
Further we re-initialise the COL_IMG column when resetting packages.
--- lib/bb/ui/crumbs/tasklistmodel.py | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-)
lib/bb/ui/crumbs/tasklistmodel.py +16 -4
@@ -429,12 +429,24 @@ class TaskListModel(gtk.ListStore): Empty self.contents by setting the include of each entry to None """ def reset(self): + # Deselect images - slightly more complex logic so that we don't + # have to iterate all of the contents of the main model, instead + # just iterate the images model. + if self.selected_image: + iit = self.images.get_iter_first() + while iit: + pit = self.images.convert_iter_to_child_iter(iit) + self.set(pit, self.COL_INC, False) + iit = self.images.iter_next(iit) + self.selected_image = None + it = self.contents.get_iter_first() while it: - path = self.contents.get_path(it) - opath = self.contents.convert_path_to_child_path(path) - self[opath][self.COL_INC] = False - self[opath][self.COL_BINB] = "" + oit = self.contents.convert_iter_to_child_iter(it) + self.set(oit, + self.COL_INC, False, + self.COL_BINB, "", + self.COL_IMG, False) # As we've just removed the first item... it = self.contents.get_iter_first()
Signature · 1 line
1.7.6
PATCH 2/3 lib/bb/hob: fix changing base image
In reply to Joshua LockThe path is not guaranteed to always point to the same value so do not rely on it to change the image contents. Further, when changing the base image we should maintain user selections.
Addresses [YOCTO #1225] and fixes [YOCTO #1226]
--- lib/bb/ui/hob.py | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
lib/bb/ui/hob.py +5 -5
@@ -50,7 +50,6 @@ class MainWindow (gtk.Window): self.model = taskmodel self.model.connect("tasklist-populated", self.update_model) self.model.connect("image-changed", self.image_changed_string_cb) - self.curr_image_path = None self.handler = handler self.configurator = configurator self.prefs = prefs
@@ -133,12 +132,13 @@ class MainWindow (gtk.Window): if it: path = model.get_path(it) # Firstly, deselect the previous image - if self.curr_image_path: - self.toggle_package(self.curr_image_path, model) + userp, _ = self.model.get_selected_packages() + self.model.reset() # Now select the new image and save its path in case we # change the image later - self.curr_image_path = path self.toggle_package(path, model, image=True) + if len(userp): + self.model.set_selected_packages(userp) def reload_triggered_cb(self, handler, image, packages): if image:
@@ -463,8 +463,8 @@ class MainWindow (gtk.Window): return False def toggle_package(self, path, model, image=False): - # Warn user before removing packages inc = model[path][self.model.COL_INC] + # Warn user before removing included packages if inc: pn = model[path][self.model.COL_NAME] revdeps = self.model.find_reverse_depends(pn)
Signature · 1 line
1.7.6
PATCH 3/3 lib/bb/ui/hob: don't error when dismissing save as dialog
In reply to Joshua LockIf the user decides to cancel the save as dialog we should not try and save regardless.
Fixes [YOCTO #1220]
--- lib/bb/ui/hob.py | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-)
lib/bb/ui/hob.py +14 -6
@@ -99,12 +99,15 @@ class MainWindow (gtk.Window): dialog.add_buttons(gtk.STOCK_NO, gtk.RESPONSE_NO, gtk.STOCK_YES, gtk.RESPONSE_YES) resp = dialog.run() + dialog.destroy() if resp == gtk.RESPONSE_YES: if not self.save_path: self.get_save_path() - self.save_recipe_file() - rep = self.model.get_build_rep() - rep.writeRecipe(self.save_path, self.model) + + if self.save_path: + self.save_recipe_file() + rep = self.model.get_build_rep() + rep.writeRecipe(self.save_path, self.model) gtk.main_quit()
@@ -325,17 +328,22 @@ class MainWindow (gtk.Window): chooser.set_current_name("myimage.bb") response = chooser.run() if response == gtk.RESPONSE_OK: - self.save_path = chooser.get_filename() + save_path = chooser.get_filename() + else: + save_path = None chooser.destroy() + self.save_path = save_path def save_cb(self, action): if not self.save_path: self.get_save_path() - self.save_recipe_file() + if self.save_path: + self.save_recipe_file() def save_as_cb(self, action): self.get_save_path() - self.save_recipe_file() + if self.save_path: + self.save_recipe_file() def open_cb(self, action): chooser = gtk.FileChooserDialog(title=None, parent=self,
Signature · 1 line
1.7.6
Richard Purdie
AppliedQuoted 7 lines · Joshua Lock
This is the first of no doubt many patch series to fix bugs in the hob ui now that people have started trying to use it.
The following changes since commit
c7a9ef70ba91d47d53074e8d78cbc52f396144a7:
bitbake/process.py: Ensure queued UI events are queued right before we add our own handler (2011-07-07 10:57:05 +0100)
Quoted 8 lines
are available in the git repository at:
git://github.com/incandescant/bitbakehob
https://github.com/incandescant/bitbake/tree/hobJoshua Lock (3):
ui/crumbs/tasklistmodel: fix reset methodlib/bb/hob: fix changing base imagelib/bb/ui/hob: don't error when dismissing save as dialog
Merged to master, thanks.
Richard