Hob: Fix MACHINE setting

Define the empty curr_mach to be "" instead of None.
Fix the judgement for ' if self.curr_mach == "" ' to be
' if self.curr_mach '.
Also set machine to bitbake server when "MACHINE" is not empty.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: Update the cache when setting changed

If values in advanced is changed, we also need to reparse the cache to
get the latest value.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: Remove some calling of initiate_new_build()

initiate_new_build() function is in async mode and could not be called
before another async function.

Also we could not initialize the build if user simply change a setting,
therefore remove this function.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: Remove duplication for certain bitbake variables

Sometimes, certain variables have duplicated values inside, for example,
IMAGE_FSTYPES = "tar.bz2 ext3 tar.bz2 ext3"

We need to remove the redundancy for those values.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: Set stop button sensitive after task started

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: Fix toolchain build

Originally we added -dev and -dbg postfixes to our selected packages as
toolchain packages. However, some package names are modified in recipes,
so we could not rely on its base name. The new approach is to detect if
a package is selected, then include those packages under the same recipe
endswith "-dev" and "-dbg".

This fixes [YOCTO #2185]

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: fix IMAGE_INSTALL setting while save template

If save every selected package into IMAGE_INSTALL field, and then build
the saved bb file by bitbake command line, it will report errors since
some packages could not be found since they are dynamically generated.
With this commit, Hob will only save those packages into the
IMAGE_INSTALL variable which are brought in by user.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: add the "info" indication icon for "information" in the dialogs.

Previously we reused the info display file which is for indication of tooltips.
But it is too small, when it is shown on the dialog as the dialog indication icon,
it becomes unclear after being stretched out. So, we replace it with a larger
icon.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: remove grab_default() for deploy button

When the deploy button is disabled since there is no deployable image,
the console will show the warning message:

WARNING: /home/yocto-build5/poky-contrib/bitbake/lib/bb/ui/crumbs/imagedetailspage.py:333:
GtkWarning: /build/buildd/gtk+2.0-2.22.0/gtk/gtkwidget.c:5684: widget not within a GtkWindow
  self.deploy_button.grab_default()

This patch is to remove the warning message.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: reset issue indication and build status before build starts on build details screen

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/hob: exit cleanly if the required pygtk version isn't available

Hob uses API from pygtk 2.22, therefore check to see whether this
version is available and exit cleanly if not.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: Remove the recipe/task type for multilib

We will not display multilib recipes and tasks in separate tabs,
therefore remove the specific types.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: Check "dummy" image while update_image_combo

We also need to check if the selected image is "Create your own image"
and set it as active.

Besides, to avoid the impact of set_active(), we need to move the
connect signal in the end of the update_image_combo() function.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: handle exceptions in get_parameters() from the bitbake

Handle exceptions during type conversion into integers.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: handle exceptions when loading templates

Handle exceptions during type conversion to integers.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: unify _size_to_string() and _string_to_size()

We call intsize_to_string (and string_to_intsize) in 3 different places.
We unify the implementations into one place.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: avoid the empty white space appearing on top of the gtk.ComboBox

Avoid the empty white space appearing on top of the machine selection combo
box and the image selection combo box in the "Image configuration" screen

[Yocto #2166]

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: a minor fix on image_fstypes

image_fstypes in the configuration has been changed into a string rather than
a list. Here we correct it in __init__() of class Configuration. At other places,
image_fstypes are all strings.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hob: a minor fix on pmake

params["pmake"] should be in the format "-j int".
When loading/saving "PARALLEL_MAKE" into templates, configuration.pmake will be
converted into "-j int", as "PACKAGE_CLASSES" and "BBLAYERS" do.

For "PACKAGE_CLASSES" and "BBLAYERS", params["pclass"] and params["layer"] are
also strings rather than the types of configuration.curr_package_format and
configuration.layers.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>