lib/bb/hob: fix changing base image
The 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] (Bitbake rev: 737d1bc819b192b4c2caa0482bddb6921b5aac93) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
b2124617ab
commit
9c03094496
|
@ -50,7 +50,6 @@ class MainWindow (gtk.Window):
|
||||||
self.model = taskmodel
|
self.model = taskmodel
|
||||||
self.model.connect("tasklist-populated", self.update_model)
|
self.model.connect("tasklist-populated", self.update_model)
|
||||||
self.model.connect("image-changed", self.image_changed_string_cb)
|
self.model.connect("image-changed", self.image_changed_string_cb)
|
||||||
self.curr_image_path = None
|
|
||||||
self.handler = handler
|
self.handler = handler
|
||||||
self.configurator = configurator
|
self.configurator = configurator
|
||||||
self.prefs = prefs
|
self.prefs = prefs
|
||||||
|
@ -133,12 +132,13 @@ class MainWindow (gtk.Window):
|
||||||
if it:
|
if it:
|
||||||
path = model.get_path(it)
|
path = model.get_path(it)
|
||||||
# Firstly, deselect the previous image
|
# Firstly, deselect the previous image
|
||||||
if self.curr_image_path:
|
userp, _ = self.model.get_selected_packages()
|
||||||
self.toggle_package(self.curr_image_path, model)
|
self.model.reset()
|
||||||
# Now select the new image and save its path in case we
|
# Now select the new image and save its path in case we
|
||||||
# change the image later
|
# change the image later
|
||||||
self.curr_image_path = path
|
|
||||||
self.toggle_package(path, model, image=True)
|
self.toggle_package(path, model, image=True)
|
||||||
|
if len(userp):
|
||||||
|
self.model.set_selected_packages(userp)
|
||||||
|
|
||||||
def reload_triggered_cb(self, handler, image, packages):
|
def reload_triggered_cb(self, handler, image, packages):
|
||||||
if image:
|
if image:
|
||||||
|
@ -463,8 +463,8 @@ class MainWindow (gtk.Window):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def toggle_package(self, path, model, image=False):
|
def toggle_package(self, path, model, image=False):
|
||||||
# Warn user before removing packages
|
|
||||||
inc = model[path][self.model.COL_INC]
|
inc = model[path][self.model.COL_INC]
|
||||||
|
# Warn user before removing included packages
|
||||||
if inc:
|
if inc:
|
||||||
pn = model[path][self.model.COL_NAME]
|
pn = model[path][self.model.COL_NAME]
|
||||||
revdeps = self.model.find_reverse_depends(pn)
|
revdeps = self.model.find_reverse_depends(pn)
|
||||||
|
|
Loading…
Reference in New Issue