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 <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Shane Wang
2012-04-12 22:22:44 +08:00
committed by Richard Purdie
parent 9c1dcdceb2
commit 4997801bad

View File

@@ -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 = "<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)