def __init__(self, builder):
super(BuildDetailsPage, self).__init__(builder, "Building ...")
+ self.num_of_issues = 0
+
# create visual elements
self.create_visual_elements()
self.back_button.connect("clicked", self.back_button_clicked_cb)
self.button_box.pack_start(self.back_button, expand=False, fill=False)
+ def show_issues(self):
+ self.num_of_issues += 1
+ self.notebook.show_indicator_icon("Issues", self.num_of_issues)
+
+ def reset_issues(self):
+ self.num_of_issues = 0
+ self.notebook.hide_indicator_icon("Issues")
+
def _remove_all_widget(self):
children = self.vbox.get_children() or []
for child in children:
self.handler.build.connect("build-succeeded", self.handler_build_succeeded_cb)
self.handler.build.connect("build-failed", self.handler_build_failed_cb)
self.handler.build.connect("task-started", self.handler_task_started_cb)
+ self.handler.build.connect("log-error", self.handler_build_failure_cb)
self.handler.connect("generating-data", self.handler_generating_data_cb)
self.handler.connect("data-generated", self.handler_data_generated_cb)
self.handler.connect("command-succeeded", self.handler_command_succeeded_cb)
elif self.current_step == self.PACKAGE_GENERATING:
fraction = 0
self.build_details_page.update_progress_bar("Build Started: ", fraction)
+ self.build_details_page.reset_issues()
def build_succeeded(self):
if self.current_step == self.FAST_IMAGE_GENERATING:
fraction = 0.2 + 0.8 * fraction
self.build_details_page.update_progress_bar(title + ": ", fraction)
+ def handler_build_failure_cb(self, running_build):
+ self.build_details_page.show_issues()
+
def destroy_window_cb(self, widget, event):
lbl = "<b>Do you really want to exit the Hob image creator?</b>"
dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO)
self.tb.show()
+ def show_indicator_icon(self, title, number):
+ for i, child in enumerate(self.tabbar.children):
+ if child["toggled_page"] == -1:
+ continue
+ if child["title"] == title:
+ self.tabbar.show_indicator_icon(i, number)
+
+ def hide_indicator_icon(self, title):
+ for i, child in enumerate(self.tabbar.children):
+ if child["toggled_page"] == -1:
+ continue
+ if child["title"] == title:
+ self.tabbar.hide_indicator_icon(i)
+
def tab_switched_cb(self, widget, page):
self.notebook.set_current_page(page)
'task-started' : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT,)),
+ 'log-error' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
}
pids_to_task = {}
tasks_to_iter = {}
if event.levelno >= logging.ERROR:
icon = "dialog-error"
color = HobColors.ERROR
+ self.emit("log-error")
elif event.levelno >= logging.WARNING:
icon = "dialog-warning"
color = HobColors.WARNING