Patchwork [bitbake-devel,10/14] Hob: Remember user settings when reparse config

login
register
mail settings
Submitter Dongxiao Xu
Date March 29, 2012, 12:01 p.m.
Message ID <f8822788449d71fe690517650923a8e12223bd43.1333022081.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/24837/
State Accepted
Commit 8a1f6953a082d8002585bfd9e8a67d2a7f69d6aa
Headers show

Comments

Dongxiao Xu - March 29, 2012, 12:01 p.m.
When config reparse is issued (e.x, adding a layer), we will firstly
remember the past user settings by setting them to bitbake server,
and then do the reparse.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/builder.py         |   13 +++++++------
 lib/bb/ui/crumbs/hobeventhandler.py |    8 +++-----
 2 files changed, 10 insertions(+), 11 deletions(-)

Patch

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 924529f..3ea9448 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -198,7 +198,7 @@  class Parameters:
 class Builder(gtk.Window):
 
     (MACHINE_SELECTION,
-     LAYER_CHANGED,
+     CONFIG_UPDATED,
      RCPPKGINFO_POPULATING,
      RCPPKGINFO_POPULATED,
      BASEIMG_SELECTED,
@@ -222,7 +222,7 @@  class Builder(gtk.Window):
 
     __step2page__ = {
         MACHINE_SELECTION     : IMAGE_CONFIGURATION,
-        LAYER_CHANGED         : IMAGE_CONFIGURATION,
+        CONFIG_UPDATED        : IMAGE_CONFIGURATION,
         RCPPKGINFO_POPULATING : IMAGE_CONFIGURATION,
         RCPPKGINFO_POPULATED  : IMAGE_CONFIGURATION,
         BASEIMG_SELECTED      : IMAGE_CONFIGURATION,
@@ -329,7 +329,7 @@  class Builder(gtk.Window):
             if not os.path.exists(layer+'/conf/layer.conf'):
                 return False
 
-        self.switch_page(self.LAYER_CHANGED)
+        self.switch_page(self.CONFIG_UPDATED)
 
         self.template.destroy()
         self.template = None
@@ -357,10 +357,11 @@  class Builder(gtk.Window):
         if next_step == self.MACHINE_SELECTION: # init step
             self.image_configuration_page.show_machine()
 
-        elif next_step == self.LAYER_CHANGED:
+        elif next_step == self.CONFIG_UPDATED:
             # after layers is changd by users
             self.image_configuration_page.show_machine()
-            self.handler.refresh_layers(self.configuration.layers)
+            self.set_user_config()
+            self.handler.parse_generate_configuration()
 
         elif next_step == self.RCPPKGINFO_POPULATING:
             # MACHINE CHANGED action or SETTINGS CHANGED
@@ -766,7 +767,7 @@  class Builder(gtk.Window):
             self.configuration.layers = dialog.layers
             # DO refresh layers
             if dialog.layers_changed:
-                self.switch_page(self.LAYER_CHANGED)
+                self.switch_page(self.CONFIG_UPDATED)
         dialog.destroy()
 
     def show_load_template_dialog(self):
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index 6efb9b0..d1f36e62 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -243,11 +243,9 @@  class HobHandler(gobject.GObject):
         self.commands_async.append(self.SUB_PARSE_CONFIG)
         self.run_next_command(self.PARSE_CONFIG)
 
-    def refresh_layers(self, bblayers):
-        self.init_cooker()
-        self.set_bblayers(bblayers)
-        self.commands_async.append(self.SUB_PARSE_CONFIG)
-        self.generate_configuration()
+    def parse_generate_configuration(self):
+         self.commands_async.append(self.SUB_PARSE_CONFIG)
+         self.generate_configuration()
 
     def set_extra_inherit(self, bbclass):
         inherits = self.server.runCommand(["getVariable", "INHERIT"]) or ""