From 26acca8cb33f3229141c26ef10f78970bb4865e0 Mon Sep 17 00:00:00 2001 From: Dongxiao Xu Date: Wed, 29 Feb 2012 22:15:27 +0800 Subject: [PATCH] Hob: Fix pressing "stop" build 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/builder.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 1d012f9..a905030 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -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" -- 2.7.4