Patchwork [bitbake-devel,v2,3/4] hob: remove confirmation dialog on close

login
register
mail settings
Submitter Paul Eggleton
Date Sept. 21, 2012, 2:47 p.m.
Message ID <e2b5212da3d9bda16f843bdf38fbe6321fc68a85.1348238757.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/37003/
State New
Headers show

Comments

Paul Eggleton - Sept. 21, 2012, 2:47 p.m.
This is not necessary for modern applications - instead we just need to
check if we're in the middle of a build and if so, do the same thing as
pressing the "Stop" button.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |   17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 3e96a3b..ff49227 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -1023,20 +1023,11 @@  class Builder(gtk.Window):
     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)
-        HobAltButton.style_button(button)
-        button = dialog.add_button("Exit Hob", gtk.RESPONSE_YES)
-        HobButton.style_button(button)
-        dialog.set_default_response(gtk.RESPONSE_YES)
-        response = dialog.run()
-        dialog.destroy()
-        if response == gtk.RESPONSE_YES:
-            gtk.main_quit()
-            return False
-        else:
+        elif self.handler.building:
+            self.stop_build()
             return True
+        else:
+            gtk.main_quit()
 
     def build_packages(self):
         _, all_recipes = self.recipe_model.get_selected_recipes()