Hob: Fix pressing "stop" build
authorDongxiao Xu <dongxiao.xu@intel.com>
Wed, 29 Feb 2012 14:15:27 +0000 (22:15 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 1 Mar 2012 15:51:35 +0000 (15:51 +0000)
This commit fixes the behavior of clicking stop build button, it will
stay in the build detail screen and show build is failed.

(Bitbake rev: 80291865fa15012a3734e8724eb73c62b4ddc62f)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/ui/crumbs/builder.py

index 1d012f9..a905030 100755 (executable)
@@ -188,7 +188,6 @@ class Builder(gtk.Window):
         self.previous_step = None
 
         self.stopping = False
-        self.build_succeeded = True
 
         # recipe model and package model
         self.recipe_model = recipe_model
@@ -520,8 +519,7 @@ class Builder(gtk.Window):
             fraction = 0
         self.build_details_page.update_progress_bar("Build Started: ", fraction)
 
-    def handler_build_succeeded_cb(self, running_build):
-        self.build_succeeded = True
+    def build_succeeded(self):
         if self.current_step == self.FAST_IMAGE_GENERATING:
             fraction = 0.9
         elif self.current_step == self.IMAGE_GENERATING:
@@ -535,9 +533,9 @@ class Builder(gtk.Window):
         elif self.current_step == self.PACKAGE_GENERATING:
             fraction = 1.0
         self.build_details_page.update_progress_bar("Build Completed: ", fraction)
+        self.stopping = False
 
-    def handler_build_failed_cb(self, running_build):
-        self.build_succeeded = False
+    def build_failed(self):
         if self.current_step == self.FAST_IMAGE_GENERATING:
             fraction = 0.9
         elif self.current_step == self.IMAGE_GENERATING:
@@ -550,6 +548,16 @@ class Builder(gtk.Window):
         self.handler.build_failed_async()
         self.stopping = False
 
+    def handler_build_succeeded_cb(self, running_build):
+        if not self.stopping:
+            self.build_succeeded()
+        else:
+            self.build_failed()
+
+
+    def handler_build_failed_cb(self, running_build):
+        self.build_failed()
+
     def handler_task_started_cb(self, running_build, message): 
         fraction = message["current"] * 1.0/message["total"]
         title = "Build packages"