summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-28 00:08:12 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-01 15:49:09 (GMT)
commit990b587652e75154071f2b93e12b1149c545a2df (patch)
tree47c103bd904746ce09cdef5610338420b9ad116f
parent42fe3c613153c8abfa9cba4307919a69778fe739 (diff)
downloadpoky-990b587652e75154071f2b93e12b1149c545a2df.tar.gz
hob: fix save/restore of toolchain preferences
Add some (namespaced) custom variables to the configuration file for sake of this UI. (Bitbake rev: c9dd2592434338bdddb3cc6f42e760c86fa9e6bb) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/crumbs/configurator.py8
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobprefs.py14
-rw-r--r--bitbake/lib/bb/ui/hob.py5
3 files changed, 25 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/configurator.py b/bitbake/lib/bb/ui/crumbs/configurator.py
index 587a6ff..e558c95 100644
--- a/bitbake/lib/bb/ui/crumbs/configurator.py
+++ b/bitbake/lib/bb/ui/crumbs/configurator.py
@@ -99,6 +99,14 @@ class Configurator(gobject.GObject):
99 else: 99 else:
100 self.config['INCOMPATIBLE_LICENSE'] = "" 100 self.config['INCOMPATIBLE_LICENSE'] = ""
101 101
102 # Non-standard, namespaces, variables for GUI preferences
103 toolchain = getString('HOB_BUILD_TOOLCHAIN')
104 if toolchain and toolchain != self.config.get('HOB_BUILD_TOOLCHAIN', ''):
105 self.config['HOB_BUILD_TOOLCHAIN'] = toolchain
106 header = getString('HOB_BUILD_TOOLCHAIN_HEADERS')
107 if header and header != self.config.get('HOB_BUILD_TOOLCHAIN_HEADERS', ''):
108 self.config['HOB_BUILD_TOOLCHAIN_HEADERS'] = header
109
102 self.orig_config = copy.deepcopy(self.config) 110 self.orig_config = copy.deepcopy(self.config)
103 111
104 def setLocalConfVar(self, var, val): 112 def setLocalConfVar(self, var, val):
diff --git a/bitbake/lib/bb/ui/crumbs/hobprefs.py b/bitbake/lib/bb/ui/crumbs/hobprefs.py
index be094e7..8ebfba2 100644
--- a/bitbake/lib/bb/ui/crumbs/hobprefs.py
+++ b/bitbake/lib/bb/ui/crumbs/hobprefs.py
@@ -140,11 +140,19 @@ class HobPrefs(gtk.Dialog):
140 140
141 def toggle_toolchain_cb(self, check): 141 def toggle_toolchain_cb(self, check):
142 enabled = check.get_active() 142 enabled = check.get_active()
143 toolchain = '0'
144 if enabled:
145 toolchain = '1'
143 self.handler.toggle_toolchain(enabled) 146 self.handler.toggle_toolchain(enabled)
147 self.configurator.setLocalConfVar('HOB_BUILD_TOOLCHAIN', toolchain)
144 148
145 def toggle_headers_cb(self, check): 149 def toggle_headers_cb(self, check):
146 enabled = check.get_active() 150 enabled = check.get_active()
151 headers = '0'
152 if enabled:
153 headers = '1'
147 self.handler.toggle_toolchain_headers(enabled) 154 self.handler.toggle_toolchain_headers(enabled)
155 self.configurator.setLocalConfVar('HOB_BUILD_TOOLCHAIN_HEADERS', headers)
148 156
149 def set_parent_window(self, parent): 157 def set_parent_window(self, parent):
150 self.set_transient_for(parent) 158 self.set_transient_for(parent)
@@ -158,7 +166,7 @@ class HobPrefs(gtk.Dialog):
158 166
159 def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass, 167 def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass,
160 cpu_cnt, pmake, bbthread, selected_image_types, all_image_types, 168 cpu_cnt, pmake, bbthread, selected_image_types, all_image_types,
161 gplv3disabled): 169 gplv3disabled, build_toolchain, build_toolchain_headers):
162 """ 170 """
163 """ 171 """
164 gtk.Dialog.__init__(self, "Preferences", None, 172 gtk.Dialog.__init__(self, "Preferences", None,
@@ -181,6 +189,8 @@ class HobPrefs(gtk.Dialog):
181 self.bbthread = bbthread 189 self.bbthread = bbthread
182 self.selected_image_types = selected_image_types.split(" ") 190 self.selected_image_types = selected_image_types.split(" ")
183 self.gplv3disabled = gplv3disabled 191 self.gplv3disabled = gplv3disabled
192 self.build_toolchain = build_toolchain
193 self.build_toolchain_headers = build_toolchain_headers
184 194
185 self.reload_required = False 195 self.reload_required = False
186 self.distro_handler_id = None 196 self.distro_handler_id = None
@@ -304,6 +314,7 @@ class HobPrefs(gtk.Dialog):
304 pbox.pack_start(hbox, expand=False, fill=False, padding=6) 314 pbox.pack_start(hbox, expand=False, fill=False, padding=6)
305 toolcheck = gtk.CheckButton("Build external development toolchain with image") 315 toolcheck = gtk.CheckButton("Build external development toolchain with image")
306 toolcheck.show() 316 toolcheck.show()
317 toolcheck.set_active(self.build_toolchain)
307 toolcheck.connect("toggled", self.toggle_toolchain_cb) 318 toolcheck.connect("toggled", self.toggle_toolchain_cb)
308 hbox.pack_start(toolcheck, expand=False, fill=False, padding=6) 319 hbox.pack_start(toolcheck, expand=False, fill=False, padding=6)
309 hbox = gtk.HBox(False, 12) 320 hbox = gtk.HBox(False, 12)
@@ -318,6 +329,7 @@ class HobPrefs(gtk.Dialog):
318 hbox.pack_start(self.sdk_machine_combo, expand=False, fill=False, padding=6) 329 hbox.pack_start(self.sdk_machine_combo, expand=False, fill=False, padding=6)
319 headerscheck = gtk.CheckButton("Include development headers with toolchain") 330 headerscheck = gtk.CheckButton("Include development headers with toolchain")
320 headerscheck.show() 331 headerscheck.show()
332 headerscheck.set_active(self.build_toolchain_headers)
321 headerscheck.connect("toggled", self.toggle_headers_cb) 333 headerscheck.connect("toggled", self.toggle_headers_cb)
322 hbox.pack_start(headerscheck, expand=False, fill=False, padding=6) 334 hbox.pack_start(headerscheck, expand=False, fill=False, padding=6)
323 self.connect("response", self.prefs_response_cb) 335 self.connect("response", self.prefs_response_cb)
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index a5a2960..305559f 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -937,9 +937,12 @@ def main (server, eventHandler):
937 if incompatible and incompatible.lower().find("gplv3"): 937 if incompatible and incompatible.lower().find("gplv3"):
938 gplv3disabled = True 938 gplv3disabled = True
939 939
940 build_toolchain = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN"]))
941 build_headers = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN_HEADERS"]))
942
940 prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt, 943 prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt,
941 pmake, bbthread, selected_image_types, all_image_types, 944 pmake, bbthread, selected_image_types, all_image_types,
942 gplv3disabled) 945 gplv3disabled, build_toolchain, build_headers)
943 layers = LayerEditor(configurator, None) 946 layers = LayerEditor(configurator, None)
944 window = MainWindow(taskmodel, handler, configurator, prefs, layers, mach) 947 window = MainWindow(taskmodel, handler, configurator, prefs, layers, mach)
945 prefs.set_parent_window(window) 948 prefs.set_parent_window(window)