aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValentin Popa <valentin.popa@intel.com>2013-07-03 11:31:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-07-05 15:52:44 +0100
commit6eee0cc37438cc3f91531b7df524330fba27161b (patch)
tree0f85c24f0b0be9849b2a084f54c3f37f0e7814a0
parentb6aa2b63d71cbe82850a375381b2dbc750cf1905 (diff)
downloadbitbake-6eee0cc37438cc3f91531b7df524330fba27161b.tar.gz
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] 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>
-rwxr-xr-xlib/bb/ui/crumbs/builder.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 8571014af..a7bd21c92 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/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: