From dc86293f0444384e8ae5131fdd10b6cb077164b0 Mon Sep 17 00:00:00 2001 From: Valentin Popa Date: Wed, 3 Jul 2013 11:31:44 +0000 Subject: 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 Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/builder.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bitbake') 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 import re import logging import sys +import signal from bb.ui.crumbs.imageconfigurationpage import ImageConfigurationPage from bb.ui.crumbs.recipeselectionpage import RecipeSelectionPage from bb.ui.crumbs.packageselectionpage import PackageSelectionPage @@ -441,6 +442,8 @@ class Builder(gtk.Window): self.initiate_new_build_async() + signal.signal(signal.SIGINT, self.event_handle_SIGINT) + def create_visual_elements(self): self.set_title("Hob") self.set_icon_name("applications-development") @@ -1075,6 +1078,12 @@ class Builder(gtk.Window): else: gtk.main_quit() + def event_handle_SIGINT(self, signal, frame): + for w in gtk.window_list_toplevels(): + if w.get_modal(): + w.response(gtk.RESPONSE_DELETE_EVENT) + sys.exit(0) + def build_packages(self): _, all_recipes = self.recipe_model.get_selected_recipes() if not all_recipes: -- cgit v1.2.3-54-g00ecf