# # BitBake Graphical GTK User Interface # # Copyright (C) 2011 Intel Corporation # # Authored by Joshua Lock <josh@linux.intel.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import gtk import glib from bb.ui.crumbs.configurator import Configurator class HobPrefs(gtk.Dialog): """ """ def empty_combo_text(self, combo_text): model = combo_text.get_model() if model: model.clear() def output_type_toggled_cb(self, check, handler): ot = check.get_label() enabled = check.get_active() if enabled: self.selected_image_types = handler.add_image_output_type(ot) else: self.selected_image_types = handler.remove_image_output_type(ot) self.configurator.setConfVar('IMAGE_FSTYPES', "%s" % " ".join(self.selected_image_types).lstrip(" ")) def sdk_machine_combo_changed_cb(self, combo, handler): sdk_mach = combo.get_active_text() if sdk_mach != self.curr_sdk_mach: self.curr_sdk_mach = sdk_mach self.configurator.setConfVar('SDKMACHINE', sdk_mach) handler.set_sdk_machine(sdk_mach) def update_sdk_machines(self, handler, sdk_machines): active = 0 # disconnect the signal handler before updating the combo model if self.sdk_machine_handler_id: self.sdk_machine_combo.disconnect(self.sdk_machine_handler_id) self.sdk_machine_handler_id = None self.empty_combo_text(self.sdk_machine_combo) for sdk_machine in sdk_machines: self.sdk_machine_combo.append_text(sdk_machine) if sdk_machine == self.curr_sdk_mach: self.sdk_machine_combo.set_active(active) active = active + 1 self.sdk_machine_handler_id = self.sdk_machine_combo.connect("changed", self.sdk_machine_combo_changed_cb, handler) def distro_combo_changed_cb(self, combo, handler): distro = combo.get_active_text() if distro != self.curr_distro: self.curr_distro = distro self.configurator.setConfVar('DISTRO', distro) handler.set_distro(distro) self.reload_required = True def update_distros(self, handler, distros): active = 0 # disconnect the signal handler before updating combo model if self.distro_handler_id: self.distro_combo.disconnect(self.distro_handler_id) self.distro_handler_id = None self.empty_combo_text(self.distro_combo) for distro in distros: self.distro_combo.append_text(distro) if distro == self.curr_distro: self.distro_combo.set_active(active) active = active + 1 self.distro_handler_id = self.distro_combo.connect("changed", self.distro_combo_changed_cb, handler) def package_format_combo_changed_cb(self, combo, handler): package_format = combo.get_active_text() if package_format != self.curr_package_format: self.curr_package_format = package_format self.configurator.setConfVar('PACKAGE_CLASSES', 'package_%s' % package_format) handler.set_package_format(package_format) self.reload_required = True def update_package_formats(self, handler, formats): active = 0 # disconnect the signal handler before updating the model if self.package_handler_id: self.package_combo.disconnect(self.package_handler_id) self.package_handler_id = None self.empty_combo_text(self.package_combo) for format in formats: self.package_combo.append_text(format) if format == self.curr_package_format: self.package_combo.set_active(active) active = active + 1 self.package_handler_id = self.package_combo.connect("changed", self.package_format_combo_changed_cb, handler) def include_gplv3_cb(self, toggle): excluded = toggle.get_active() orig_incompatible = self.configurator.getConfVar('INCOMPATIBLE_LICENSE') new_incompatible = "" if excluded: if not orig_incompatible: new_incompatible = "GPLv3" elif not orig_incompatible.find('GPLv3'): new_incompatible = "%s GPLv3" % orig_incompatible else: new_incompatible = orig_incompatible.replace('GPLv3', '') if new_incompatible != orig_incompatible: self.handler.set_incompatible_license(new_incompatible) self.configurator.setConfVar('INCOMPATIBLE_LICENSE', new_incompatible) self.reload_required = True def change_bb_threads_cb(self, spinner): val = spinner.get_value_as_int() self.handler.set_bbthreads(val) self.configurator.setConfVar('BB_NUMBER_THREADS', val) def change_make_threads_cb(self, spinner): val = spinner.get_value_as_int() self.handler.set_pmake(val) self.configurator.setConfVar('PARALLEL_MAKE', "-j %s" % val) def toggle_toolchain_cb(self, check): enabled = check.get_active() toolchain = '0' if enabled: toolchain = '1' self.handler.toggle_toolchain(enabled) self.configurator<2011-01-02augeas: upgrade to version 0.7.4Qing He 2010-12-09SRC_URI Checksums AdditionalsSaul Wold 2010-09-03augeas: add new packageQing He