diff options
author | Valentin Popa <valentin.popa@intel.com> | 2013-07-03 11:31:44 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-07-05 15:52:48 +0100 |
commit | dc86293f0444384e8ae5131fdd10b6cb077164b0 (patch) | |
tree | eda13190537941768c9f6446865af22c5e4dd8ba /bitbake | |
parent | 1defbaf8b7339accc2660858f890bd36e325bff9 (diff) | |
download | poky-dc86293f0444384e8ae5131fdd10b6cb077164b0.tar.gz |
bitbake: HOB:Proper handle of SIGINT
Modal dialogs doesn't run on the main loop so they cannot
catch any signal from the terminal. This patch makes sure
the dialogs are destroyed when a SIGINT is sent to HOB.
[YOCTO #3329]
(Bitbake rev: 6eee0cc37438cc3f91531b7df524330fba27161b)
Signed-off-by: Valentin Popa <valentin.popa@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 8571014afc..a7bd21c923 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
@@ -30,6 +30,7 @@ import shlex | |||
30 | import re | 30 | import re |
31 | import logging | 31 | import logging |
32 | import sys | 32 | import sys |
33 | import signal | ||
33 | from bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage | 34 | from bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage |
34 | from bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage | 35 | from bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage |
35 | from bb.ui.crumbs.packageselectionpage import PackageSelectionPage | 36 | from bb.ui.crumbs.packageselectionpage import PackageSelectionPage |
@@ -441,6 +442,8 @@ class Builder(gtk.Window): | |||
441 | 442 | ||
442 | self.initiate_new_build_async() | 443 | self.initiate_new_build_async() |
443 | 444 | ||
445 | signal.signal(signal.SIGINT, self.event_handle_SIGINT) | ||
446 | |||
444 | def create_visual_elements(self): | 447 | def create_visual_elements(self): |
445 | self.set_title("Hob") | 448 | self.set_title("Hob") |
446 | self.set_icon_name("applications-development") | 449 | self.set_icon_name("applications-development") |
@@ -1075,6 +1078,12 @@ class Builder(gtk.Window): | |||
1075 | else: | 1078 | else: |
1076 | gtk.main_quit() | 1079 | gtk.main_quit() |
1077 | 1080 | ||
1081 | def event_handle_SIGINT(self, signal, frame): | ||
1082 | for w in gtk.window_list_toplevels(): | ||
1083 | if w.get_modal(): | ||
1084 | w.response(gtk.RESPONSE_DELETE_EVENT) | ||
1085 | sys.exit(0) | ||
1086 | |||
1078 | def build_packages(self): | 1087 | def build_packages(self): |
1079 | _, all_recipes = self.recipe_model.get_selected_recipes() | 1088 | _, all_recipes = self.recipe_model.get_selected_recipes() |
1080 | if not all_recipes: | 1089 | if not all_recipes: |