[bitbake-devel] [PATCH 2/2] Hob: forbid users to exit Hob directly when Hob is busy

Shane Wang shane.wang at intel.com
Thu Apr 12 14:22:44 UTC 2012


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]

Signed-off-by: Shane Wang <shane.wang at intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 10b9a77..e3f2d40 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -274,6 +274,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()
 
@@ -584,6 +587,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):
@@ -738,6 +742,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 = "<b>Do you really want to exit the Hob image creator?</b>"
         dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO)
         button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
-- 
1.7.6





More information about the bitbake-devel mailing list