From 4997801bad7ae2a43221dd58151c8f2facd03210 Mon Sep 17 00:00:00 2001 From: Shane Wang Date: Thu, 12 Apr 2012 22:22:44 +0800 Subject: Hob: forbid users to exit Hob directly when Hob is busy When Hob is busy with generating data, exiting Hob is not allowed. That should be reasonable because at that time the mouse cursor is not a pointer. If users want to exit, they can click "Stop" first and then do exit. That is also a walkaround for [Yocto #2142] (Bitbake rev: ad7f6bf3c7c4c15d546781aaefdaf03f00193f7c) Signed-off-by: Shane Wang Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/builder.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bitbake') diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 410ff5fa85..f414bc7120 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -298,6 +298,9 @@ class Builder(gtk.Window): # Indicate whether user has customized the image self.customized = False + # Indicate whether the UI is working + self.sensitive = True + # create visual elements self.create_visual_elements() @@ -610,6 +613,7 @@ class Builder(gtk.Window): self.get_root_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)) else: self.get_root_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) + self.sensitive = sensitive def handler_generating_data_cb(self, handler): @@ -764,6 +768,8 @@ class Builder(gtk.Window): self.build_details_page.show_issues() def destroy_window_cb(self, widget, event): + if not self.sensitive: + return True lbl = "Do you really want to exit the Hob image creator?" dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO) button = dialog.add_button("Cancel", gtk.RESPONSE_NO) -- cgit v1.2.3-54-g00ecf