lib/bb/ui/crumbs: hob progress bar should not be red when user stops build
If the user explicitly stops the build telling them the build failed is a misnomer. (Bitbake rev: 722f4f0e31f9debf5ad20a91da759a8c25151567) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
7463dd803a
commit
57434b40b8
|
@ -213,7 +213,7 @@ class BuildDetailsPage (HobPage):
|
||||||
self.show_all()
|
self.show_all()
|
||||||
self.back_button.hide()
|
self.back_button.hide()
|
||||||
|
|
||||||
def update_progress_bar(self, title, fraction, status=True):
|
def update_progress_bar(self, title, fraction, status=None):
|
||||||
self.progress_bar.update(fraction)
|
self.progress_bar.update(fraction)
|
||||||
self.progress_bar.set_title(title)
|
self.progress_bar.set_title(title)
|
||||||
self.progress_bar.set_rcstyle(status)
|
self.progress_bar.set_rcstyle(status)
|
||||||
|
|
|
@ -608,13 +608,20 @@ class Builder(gtk.Window):
|
||||||
self.stopping = False
|
self.stopping = False
|
||||||
|
|
||||||
def build_failed(self):
|
def build_failed(self):
|
||||||
if self.current_step == self.FAST_IMAGE_GENERATING:
|
if self.stopping:
|
||||||
fraction = 0.9
|
status = "stop"
|
||||||
elif self.current_step == self.IMAGE_GENERATING:
|
message = "Build stopped: "
|
||||||
fraction = 1.0
|
fraction = self.build_details_page.progress_bar.get_fraction()
|
||||||
elif self.current_step == self.PACKAGE_GENERATING:
|
else:
|
||||||
fraction = 1.0
|
if self.current_step == self.FAST_IMAGE_GENERATING:
|
||||||
self.build_details_page.update_progress_bar("Build Failed: ", fraction, False)
|
fraction = 0.9
|
||||||
|
elif self.current_step == self.IMAGE_GENERATING:
|
||||||
|
fraction = 1.0
|
||||||
|
elif self.current_step == self.PACKAGE_GENERATING:
|
||||||
|
fraction = 1.0
|
||||||
|
status = "fail"
|
||||||
|
message = "Build failed: "
|
||||||
|
self.build_details_page.update_progress_bar(message, fraction, status)
|
||||||
self.build_details_page.show_back_button()
|
self.build_details_page.show_back_button()
|
||||||
self.build_details_page.hide_stop_button()
|
self.build_details_page.hide_stop_button()
|
||||||
self.handler.build_failed_async()
|
self.handler.build_failed_async()
|
||||||
|
|
|
@ -735,7 +735,7 @@ class DeployImageDialog (CrumbsDialog):
|
||||||
cmdline += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "; bash\""
|
cmdline += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "; bash\""
|
||||||
subprocess.Popen(args=shlex.split(cmdline))
|
subprocess.Popen(args=shlex.split(cmdline))
|
||||||
|
|
||||||
def update_progress_bar(self, title, fraction, status=True):
|
def update_progress_bar(self, title, fraction, status=None):
|
||||||
self.progress_bar.update(fraction)
|
self.progress_bar.update(fraction)
|
||||||
self.progress_bar.set_title(title)
|
self.progress_bar.set_title(title)
|
||||||
self.progress_bar.set_rcstyle(status)
|
self.progress_bar.set_rcstyle(status)
|
||||||
|
|
|
@ -105,7 +105,7 @@ class ImageConfigurationPage (HobPage):
|
||||||
self.set_config_machine_layout(show_progress_bar = False)
|
self.set_config_machine_layout(show_progress_bar = False)
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
|
||||||
def update_progress_bar(self, title, fraction, status=True):
|
def update_progress_bar(self, title, fraction, status=None):
|
||||||
self.progress_bar.update(fraction)
|
self.progress_bar.update(fraction)
|
||||||
self.progress_bar.set_title(title)
|
self.progress_bar.set_title(title)
|
||||||
self.progress_bar.set_rcstyle(status)
|
self.progress_bar.set_rcstyle(status)
|
||||||
|
|
|
@ -29,10 +29,12 @@ class HobProgressBar (gtk.ProgressBar):
|
||||||
def set_rcstyle(self, status):
|
def set_rcstyle(self, status):
|
||||||
rcstyle = gtk.RcStyle()
|
rcstyle = gtk.RcStyle()
|
||||||
rcstyle.fg[2] = gtk.gdk.Color(HobColors.BLACK)
|
rcstyle.fg[2] = gtk.gdk.Color(HobColors.BLACK)
|
||||||
if status:
|
if status == "stop":
|
||||||
rcstyle.bg[3] = gtk.gdk.Color(HobColors.RUNNING)
|
rcstyle.bg[3] = gtk.gdk.Color(HobColors.WARNING)
|
||||||
else:
|
elif status == "fail":
|
||||||
rcstyle.bg[3] = gtk.gdk.Color(HobColors.ERROR)
|
rcstyle.bg[3] = gtk.gdk.Color(HobColors.ERROR)
|
||||||
|
else:
|
||||||
|
rcstyle.bg[3] = gtk.gdk.Color(HobColors.RUNNING)
|
||||||
self.modify_style(rcstyle)
|
self.modify_style(rcstyle)
|
||||||
|
|
||||||
def set_title(self, text=None):
|
def set_title(self, text=None):
|
||||||
|
|
Loading…
Reference in New Issue