summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/builddetailspage.py
diff options
context:
space:
mode:
authorLiming An <limingx.l.an@intel.com>2012-05-21 22:41:21 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-23 11:33:17 +0100
commit374ad22550f0610f41e127352a3efb2c62689ff0 (patch)
treed21f9935d97a4620530255fab0d636a015f71f04 /bitbake/lib/bb/ui/crumbs/builddetailspage.py
parent39a9267dee0a0ee4d87ed51d4a0272549c462b02 (diff)
downloadpoky-374ad22550f0610f41e127352a3efb2c62689ff0.tar.gz
Hob: change the build failure scenario as ui design
change the top bar display in build 'issue' page [YOCTO #2183] (Bitbake rev: 0705d3db1ce6d0f29301e2428c990ab0d9b2860e) Signed-off-by: Liming An <limingx.l.an@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/builddetailspage.py')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builddetailspage.py99
1 files changed, 98 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
24import pango 24import pango
25import gobject 25import gobject
26from bb.ui.crumbs.progressbar import HobProgressBar 26from bb.ui.crumbs.progressbar import HobProgressBar
27from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText 27from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText, HobButton
28from bb.ui.crumbs.runningbuild import RunningBuildTreeView 28from bb.ui.crumbs.runningbuild import RunningBuildTreeView
29from bb.ui.crumbs.runningbuild import BuildFailureTreeView 29from bb.ui.crumbs.runningbuild import BuildFailureTreeView
30from bb.ui.crumbs.hobpages import HobPage 30from bb.ui.crumbs.hobpages import HobPage
31from bb.ui.crumbs.hobcolor import HobColors
31 32
32class BuildConfigurationTreeView(gtk.TreeView): 33class 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")