summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-27 17:08:12 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-01 16:49:09 +0100
commit990b587652e75154071f2b93e12b1149c545a2df (patch)
tree47c103bd904746ce09cdef5610338420b9ad116f
parent42fe3c613153c8abfa9cba4307919a69778fe739 (diff)
downloadpoky-990b587652e75154071f2b93e12b1149c545a2df.tar.gz
poky-990b587652e75154071f2b93e12b1149c545a2df.tar.bz2
poky-990b587652e75154071f2b93e12b1149c545a2df.zip
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 587a6ff129..e558c955b3 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):
else:
self.config['INCOMPATIBLE_LICENSE'] = ""
+ # Non-standard, namespaces, variables for GUI preferences
+ toolchain = getString('HOB_BUILD_TOOLCHAIN')
+ if toolchain and toolchain != self.config.get('HOB_BUILD_TOOLCHAIN', ''):
+ self.config['HOB_BUILD_TOOLCHAIN'] = toolchain
+ header = getString('HOB_BUILD_TOOLCHAIN_HEADERS')
+ if header and header != self.config.get('HOB_BUILD_TOOLCHAIN_HEADERS', ''):
+ self.config['HOB_BUILD_TOOLCHAIN_HEADERS'] = header
+
self.orig_config = copy.deepcopy(self.config)
def setLocalConfVar(self, var, val):
diff --git a/bitbake/lib/bb/ui/crumbs/hobprefs.py b/bitbake/lib/bb/ui/crumbs/hobprefs.py
index be094e7c93..8ebfba243c 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):
def toggle_toolchain_cb(self, check):
enabled = check.get_active()
+ toolchain = '0'
+ if enabled:
+ toolchain = '1'
self.handler.toggle_toolchain(enabled)
+ self.configurator.setLocalConfVar('HOB_BUILD_TOOLCHAIN', toolchain)
def toggle_headers_cb(self, check):
enabled = check.get_active()
+ headers = '0'
+ if enabled:
+ headers = '1'
self.handler.toggle_toolchain_headers(enabled)
+ self.configurator.setLocalConfVar('HOB_BUILD_TOOLCHAIN_HEADERS', headers)
def set_parent_window(self, parent):
self.set_transient_for(parent)
@@ -158,7 +166,7 @@ class HobPrefs(gtk.Dialog):
def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass,
cpu_cnt, pmake, bbthread, selected_image_types, all_image_types,
- gplv3disabled):
+ gplv3disabled, build_toolchain, build_toolchain_headers):
"""
"""
gtk.Dialog.__init__(self, "Preferences", None,
@@ -181,6 +189,8 @@ class HobPrefs(gtk.Dialog):
self.bbthread = bbthread
self.selected_image_types = selected_image_types.split(" ")
self.gplv3disabled = gplv3disabled
+ self.build_toolchain = build_toolchain
+ self.build_toolchain_headers = build_toolchain_headers
self.reload_required = False
self.distro_handler_id = None
@@ -304,6 +314,7 @@ class HobPrefs(gtk.Dialog):
pbox.pack_start(hbox, expand=False, fill=False, padding=6)
toolcheck = gtk.CheckButton("Build external development toolchain with image")
toolcheck.show()
+ toolcheck.set_active(self.build_toolchain)
toolcheck.connect("toggled", self.toggle_toolchain_cb)
hbox.pack_start(toolcheck, expand=False, fill=False, padding=6)
hbox = gtk.HBox(False, 12)
@@ -318,6 +329,7 @@ class HobPrefs(gtk.Dialog):
hbox.pack_start(self.sdk_machine_combo, expand=False, fill=False, padding=6)
headerscheck = gtk.CheckButton("Include development headers with toolchain")
headerscheck.show()
+ headerscheck.set_active(self.build_toolchain_headers)
headerscheck.connect("toggled", self.toggle_headers_cb)
hbox.pack_start(headerscheck, expand=False, fill=False, padding=6)
self.connect("response", self.prefs_response_cb)
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index a5a29603c5..305559f24e 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -937,9 +937,12 @@ def main (server, eventHandler):
if incompatible and incompatible.lower().find("gplv3"):
gplv3disabled = True
+ build_toolchain = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN"]))
+ build_headers = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN_HEADERS"]))
+
prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt,
pmake, bbthread, selected_image_types, all_image_types,
- gplv3disabled)
+ gplv3disabled, build_toolchain, build_headers)
layers = LayerEditor(configurator, None)
window = MainWindow(taskmodel, handler, configurator, prefs, layers, mach)
prefs.set_parent_window(window)