event/hob: Add a button for network tests in the proxy settings

This patch allows the user to check the network connectivity in
the "Proxy" page ("Settings" dialog) by adding a button which provides
this functionality. It also disables retrigerring sanity checks if the
proxy values are changed, since now the proxy checks are explicit.
Note that this patch depends on a patch in oe-core
("sanity.bbclass: trigger network tests explicitly"). It will
not work properly if the patch in oe-core is not merged.

[YOCTO #3026]

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: image size displayed wrong size in edit packages screen

    size_str = '%.1f' % (size*1.0/(1024*1024)) + ' MB'
    from /bitbake/lib/bb/ui/crumbs/hobpages.py file transformed
    the size in MB. In our file it was again multiplied by 1024
    instead of doing a division by 1024, which brought a faulty size on
    the edit packages screen.

Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: change behavior for "cancel" button from the Recipe selection page

-when returned to the Image configuration page, after canceling on the
Recipe selection page, the image selected previously is now shown corectly

[YOCTO #3205}
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: stop build without percentage shown

added a method in progressbar.py that doesn't update the
percentage in the progress bar shown in hob.

the call of the method is done in builder.py.

Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake: hob/hobwidget: "Brought in by" column is now displayed correctly

In "Edit Recipes" and "Edit packages" pages, the "Brought in by"
column is displayed correctly, with the right number of additional
packages and a proper title.

Fixes [YOCTO #2195].

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob/imageconfigurationpage: progress bar shows when recipe parsing is stopped

-when the recipe parsing process is stopped, the progress bar shows
"Stopping recipe parsing"

[YOCTO #3259]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob/builddetailspage: set "Log" page as default

- when you do a build you should see "Log" page, not
"Build configuration" page

[YOCTO #2569]

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake: hob/builder: Image selection is remembered while changing adv settings

Image selection is remembered correctly even after
advanced settings have been changed.
Selected image was reset even when it was not the case.

Fixes [YOCTO #3228]

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob/settings: add a scroll bar for the box with mirrors

- added a scroll bar in the shared state tab from settings
- added a signal on it, so when you add a new mirror, it will
auto-scroll to the end of the list

[YOCTO #3229]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake: hob/builder: Hob crashes because of bad init

Image selection is not properly initialized to none,
and it used before having a chance to have a value.
Due to dynamic nature of Python, variable is used before
it exists, in this case. This causes a crash.
Bug introduced during the fix of [YOCTO #3228]

Fixes [YOCTO #3334]

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: add a progress indicator when you select 'view log'

- created a new file named "hobthreads.py", defining a thread
for opening the log file in a subprocess using subprocess module;
in the future I think we will add some other threads here, to
implement some other performance issues
- on "builddetailspage", "packageselectionpage" and "imagedetailspage"
I have changed the manner for opening the log file; it uses the thread
to open the file, and on main thread it creates a dialog to show a
progress bar, which pulses till the file is open
- this was added because when the log file is big, it takes time to
be opened; on the dialog you can use "Cancel" button to terminate the
process initiated to open the file

[YOCTO #2997]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: during recipe parsing, progress bar text provides details about the process state

- indicating on progress bar that hob has gone from parsing
recipes to "Generating dependency tree"; this will provide
some visibility of what has caused the "stop" button state
to change

[YOCTO #3282]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob/hig: Hob doesn't save properly proxy settings

User introduced proxy settings were not saved
when a proxy details input dialog was opened.
The proxy settings were lost upon return, and
restored from the previously stored one.

Also:
Code cleanup:
details_cb() function duplicate definition
removed

Fixes [YOCTO #3240]

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: reordering the layers in the Hob Layers dialog

-since the order of the layers can potentially impact
the build outcome, users should be able to reorder
the layers within the layers dialog;
-used TreeView Drag and Drop

[YOCTO #3270]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
knotty: Ensure last tasks are disaplyed correctly in the footer

There was an issue where the last tasks run by bitbake would not
correctly get displayed in the knotty footer. This was due to the
total count including active tasks. This change ensures the footer
is displayed if the are any running tasks.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
uihelper: Set update flag when start event encountered

Its a minor correctness detail but the update flag should be set
when Start events are encountered.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cooker.py: Don't dump the environment into the console log file

Dumping the environment data into the console log files directory is
invariably not what the user wants or expects and leads to confusion
when looking at the log directory.

This change forces the logs to be disabled by default when using
the -e option.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/server: Remove dead console log code

This code is dead and doesn't do anything so lets remove it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: providing details about process state through porgress bar

-small changes to the text of the progress bar when parsing recipes

[YOCTO #3282]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
command: add error to return of runCommand

Currently, command.py can return an error message from runCommand, due to
being unable to run the command, yet few of our UIs (just hob) can handle it
today. This can result in seeing a TypeError with traceback in certain rare
circumstances.

To resolve this, we need a clean way to get errors back from runCommand,
without having to isinstance() the return value. This implements such a thing
by making runCommand also return an error (or None if no error occurred).

As runCommand now has a method of returning errors, we can also alter the
getCmdLineAction bits such that the returned value is just the action, not an
additional message. If a sync command wants to return an error, it raises
CommandError(message), and the message will be passed to the caller
appropriately.

Example Usage:

    result, error = server.runCommand(...)
    if error:
        log.error('Unable to run command: %s' % error)
        return 1

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>