diff options
| -rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builddetailspage.py | 99 | ||||
| -rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 8 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobwidget.py | 7 |
3 files changed, 113 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py index c2d5abc1d4..0052b017e5 100755 --- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py | |||
| @@ -24,10 +24,11 @@ import gtk | |||
| 24 | import pango | 24 | import pango |
| 25 | import gobject | 25 | import gobject |
| 26 | from bb.ui.crumbs.progressbar import HobProgressBar | 26 | from bb.ui.crumbs.progressbar import HobProgressBar |
| 27 | from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText | 27 | from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText, HobButton |
| 28 | from bb.ui.crumbs.runningbuild import RunningBuildTreeView | 28 | from bb.ui.crumbs.runningbuild import RunningBuildTreeView |
| 29 | from bb.ui.crumbs.runningbuild import BuildFailureTreeView | 29 | from bb.ui.crumbs.runningbuild import BuildFailureTreeView |
| 30 | from bb.ui.crumbs.hobpages import HobPage | 30 | from bb.ui.crumbs.hobpages import HobPage |
| 31 | from bb.ui.crumbs.hobcolor import HobColors | ||
| 31 | 32 | ||
| 32 | class BuildConfigurationTreeView(gtk.TreeView): | 33 | class BuildConfigurationTreeView(gtk.TreeView): |
| 33 | def __init__ (self): | 34 | def __init__ (self): |
| @@ -198,6 +199,87 @@ class BuildDetailsPage (HobPage): | |||
| 198 | for child in children: | 199 | for child in children: |
| 199 | self.remove(child) | 200 | self.remove(child) |
| 200 | 201 | ||
| 202 | def update_failures_sum_display(self): | ||
| 203 | num = 0 | ||
| 204 | it = self.failure_model.get_iter_first() | ||
| 205 | while it: | ||
| 206 | color = self.failure_model.get_value(it, self.builder.handler.build.model.COL_COLOR) | ||
| 207 | if color == HobColors.ERROR: | ||
| 208 | num += 1 | ||
| 209 | it = self.failure_model.iter_next(it) | ||
| 210 | |||
| 211 | return num | ||
| 212 | |||
| 213 | def add_build_fail_top_bar(self, actions): | ||
| 214 | mainly_action = "Edit %s" % actions | ||
| 215 | if 'image' in actions: | ||
| 216 | next_action = "" | ||
| 217 | else: | ||
| 218 | next_action = "Create new image" | ||
| 219 | |||
| 220 | #set to issue page | ||
| 221 | self.notebook.set_page("Issues") | ||
| 222 | |||
| 223 | color = HobColors.ERROR | ||
| 224 | build_fail_top = gtk.EventBox() | ||
| 225 | build_fail_top.set_size_request(-1, 260) | ||
| 226 | build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) | ||
| 227 | |||
| 228 | build_fail_tab = gtk.Table(7, 40, True) | ||
| 229 | build_fail_top.add(build_fail_tab) | ||
| 230 | |||
| 231 | icon = gtk.Image() | ||
| 232 | icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INDI_ERROR_FILE) | ||
| 233 | icon.set_from_pixbuf(icon_pix_buffer) | ||
| 234 | build_fail_tab.attach(icon, 1, 4, 0, 3) | ||
| 235 | |||
| 236 | label = gtk.Label() | ||
| 237 | label.set_alignment(0.0, 0.5) | ||
| 238 | label.set_markup("<span size='x-large'>%s</span>" % self.title) | ||
| 239 | build_fail_tab.attach(label, 4, 20, 0, 3) | ||
| 240 | |||
| 241 | label = gtk.Label() | ||
| 242 | label.set_alignment(0.0, 0.5) | ||
| 243 | num_of_fails = self.update_failures_sum_display() | ||
| 244 | current_fail, recipe_task_status = self.task_status.get_text().split('\n') | ||
| 245 | label.set_markup(" %d tasks failed, %s, %s" % (num_of_fails, current_fail, recipe_task_status)) | ||
| 246 | build_fail_tab.attach(label, 4, 40, 2, 4) | ||
| 247 | |||
| 248 | # create button 'Edit packages' | ||
| 249 | action_button = HobButton(mainly_action) | ||
| 250 | action_button.set_size_request(-1, 49) | ||
| 251 | action_button.connect('clicked', self.failure_main_action_button_clicked_cb, mainly_action) | ||
| 252 | build_fail_tab.attach(action_button, 4, 16, 4, 6) | ||
| 253 | |||
| 254 | if next_action: | ||
| 255 | next_button = HobAltButton(next_action) | ||
| 256 | next_button.set_alignment(0.0, 0.5) | ||
| 257 | next_button.connect('clicked', self.failure_next_action_button_clicked_cb, next_action) | ||
| 258 | build_fail_tab.attach(next_button, 17, 24, 4, 5) | ||
| 259 | |||
| 260 | file_bug_button = HobAltButton('File a bug') | ||
| 261 | file_bug_button.set_alignment(0.0, 0.5) | ||
| 262 | file_bug_button.connect('clicked', self.failure_file_bug_activate_link_cb) | ||
| 263 | build_fail_tab.attach(file_bug_button, 17, 24, 4 + abs(next_action != ""), 6) | ||
| 264 | |||
| 265 | return build_fail_top | ||
| 266 | |||
| 267 | def show_fail_page(self, title, action_names): | ||
| 268 | self._remove_all_widget() | ||
| 269 | self.title = "Hob cannot build your %s" % title | ||
| 270 | |||
| 271 | self.build_fail_bar = self.add_build_fail_top_bar(action_names) | ||
| 272 | self.pack_start(self.build_fail_bar) | ||
| 273 | self.pack_start(self.group_align, expand=True, fill=True) | ||
| 274 | |||
| 275 | self.box_group_area.pack_start(self.vbox, expand=True, fill=True) | ||
| 276 | |||
| 277 | self.vbox.pack_start(self.notebook, expand=True, fill=True) | ||
| 278 | |||
| 279 | self.box_group_area.pack_end(self.button_box, expand=False, fill=False) | ||
| 280 | self.show_all() | ||
| 281 | self.back_button.hide() | ||
| 282 | |||
| 201 | def show_page(self, step): | 283 | def show_page(self, step): |
| 202 | self._remove_all_widget() | 284 | self._remove_all_widget() |
| 203 | if step == self.builder.PACKAGE_GENERATING or step == self.builder.FAST_IMAGE_GENERATING: | 285 | if step == self.builder.PACKAGE_GENERATING or step == self.builder.FAST_IMAGE_GENERATING: |
| @@ -251,3 +333,18 @@ class BuildDetailsPage (HobPage): | |||
| 251 | 333 | ||
| 252 | def show_configurations(self, configurations, params): | 334 | def show_configurations(self, configurations, params): |
| 253 | self.config_tv.show(configurations, params) | 335 | self.config_tv.show(configurations, params) |
| 336 | |||
| 337 | def failure_main_action_button_clicked_cb(self, button, action): | ||
| 338 | if "Edit recipes" in action: | ||
| 339 | self.builder.show_recipes() | ||
| 340 | elif "Edit packages" in action: | ||
| 341 | self.builder.show_packages() | ||
| 342 | elif "Edit image configuration" in action: | ||
| 343 | self.builder.show_configuration() | ||
| 344 | |||
| 345 | def failure_next_action_button_clicked_cb(self, button, action): | ||
| 346 | if "Create new image" in action: | ||
| 347 | self.builder.initiate_new_build_async() | ||
| 348 | |||
| 349 | def failure_file_bug_activate_link_cb(self, button): | ||
| 350 | button.child.emit('activate-link', "http://bugzilla.yoctoproject.org") | ||
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 44d626c261..141ee2c560 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
| @@ -853,12 +853,20 @@ class Builder(gtk.Window): | |||
| 853 | message = "Build stopped: " | 853 | message = "Build stopped: " |
| 854 | fraction = self.build_details_page.progress_bar.get_fraction() | 854 | fraction = self.build_details_page.progress_bar.get_fraction() |
| 855 | else: | 855 | else: |
| 856 | fail_to_next_edit = "" | ||
| 856 | if self.current_step == self.FAST_IMAGE_GENERATING: | 857 | if self.current_step == self.FAST_IMAGE_GENERATING: |
| 858 | fail_to_next_edit = "image configuration" | ||
| 857 | fraction = 0.9 | 859 | fraction = 0.9 |
| 858 | elif self.current_step == self.IMAGE_GENERATING: | 860 | elif self.current_step == self.IMAGE_GENERATING: |
| 861 | if self.previous_step == self.FAST_IMAGE_GENERATING: | ||
| 862 | fail_to_next_edit = "image configuration" | ||
| 863 | else: | ||
| 864 | fail_to_next_edit = "packages" | ||
| 859 | fraction = 1.0 | 865 | fraction = 1.0 |
| 860 | elif self.current_step == self.PACKAGE_GENERATING: | 866 | elif self.current_step == self.PACKAGE_GENERATING: |
| 867 | fail_to_next_edit = "recipes" | ||
| 861 | fraction = 1.0 | 868 | fraction = 1.0 |
| 869 | self.build_details_page.show_fail_page(fail_to_next_edit.split(' ')[0], fail_to_next_edit) | ||
| 862 | status = "fail" | 870 | status = "fail" |
| 863 | message = "Build failed: " | 871 | message = "Build failed: " |
| 864 | self.build_details_page.update_progress_bar(message, fraction, status) | 872 | self.build_details_page.update_progress_bar(message, fraction, status) |
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py index f5997e5b6b..f8e97ad1f8 100644 --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py | |||
| @@ -566,6 +566,13 @@ class HobNotebook(gtk.Notebook): | |||
| 566 | def set_search_entry_clear_cb(self, search, icon_pos, event): | 566 | def set_search_entry_clear_cb(self, search, icon_pos, event): |
| 567 | self.reset_entry(search) | 567 | self.reset_entry(search) |
| 568 | 568 | ||
| 569 | def set_page(self, title): | ||
| 570 | for child in self.tabbar.children: | ||
| 571 | if child["title"] == title: | ||
| 572 | self.tabbar.current_child = child | ||
| 573 | self.tabbar.grab_focus() | ||
| 574 | self.notebook.set_current_page(child["toggled_page"]) | ||
| 575 | |||
| 569 | class HobWarpCellRendererText(gtk.CellRendererText): | 576 | class HobWarpCellRendererText(gtk.CellRendererText): |
| 570 | def __init__(self, col_number): | 577 | def __init__(self, col_number): |
| 571 | gtk.CellRendererText.__init__(self) | 578 | gtk.CellRendererText.__init__(self) |
