summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builddetailspage.py83
1 files changed, 33 insertions, 50 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index b1afe10bbc..30eab29508 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -25,7 +25,7 @@ import pango
25import gobject 25import gobject
26import bb.process 26import bb.process
27from bb.ui.crumbs.progressbar import HobProgressBar 27from bb.ui.crumbs.progressbar import HobProgressBar
28from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText, HobButton 28from bb.ui.crumbs.hobwidget import hic, HobNotebook, HobAltButton, HobWarpCellRendererText, HobButton, HobInfoButton
29from bb.ui.crumbs.runningbuild import RunningBuildTreeView 29from bb.ui.crumbs.runningbuild import RunningBuildTreeView
30from bb.ui.crumbs.runningbuild import BuildFailureTreeView 30from bb.ui.crumbs.runningbuild import BuildFailureTreeView
31from bb.ui.crumbs.hobpages import HobPage 31from bb.ui.crumbs.hobpages import HobPage
@@ -199,68 +199,51 @@ class BuildDetailsPage (HobPage):
199 for child in children: 199 for child in children:
200 self.remove(child) 200 self.remove(child)
201 201
202 def update_failures_sum_display(self): 202 def add_build_fail_top_bar(self, actions, log_file=None):
203 num = 0 203 primary_action = "Edit %s" % actions
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 204
220 #set to issue page
221 self.notebook.set_page("Issues") 205 self.notebook.set_page("Issues")
222 206
223 color = HobColors.ERROR 207 color = HobColors.ERROR
224 build_fail_top = gtk.EventBox() 208 build_fail_top = gtk.EventBox()
225 build_fail_top.set_size_request(-1, 260) 209 build_fail_top.set_size_request(-1, 200)
226 build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) 210 build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color))
227 211
228 build_fail_tab = gtk.Table(7, 40, True) 212 build_fail_tab = gtk.Table(14, 46, True)
229 build_fail_top.add(build_fail_tab) 213 build_fail_top.add(build_fail_tab)
230 214
231 icon = gtk.Image() 215 icon = gtk.Image()
232 icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INDI_ERROR_FILE) 216 icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INDI_ERROR_FILE)
233 icon.set_from_pixbuf(icon_pix_buffer) 217 icon.set_from_pixbuf(icon_pix_buffer)
234 build_fail_tab.attach(icon, 1, 4, 0, 3) 218 build_fail_tab.attach(icon, 1, 4, 0, 6)
235 219
236 label = gtk.Label() 220 label = gtk.Label()
237 label.set_alignment(0.0, 0.5) 221 label.set_alignment(0.0, 0.5)
238 label.set_markup("<span size='x-large'>%s</span>" % self.title) 222 label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title)
239 build_fail_tab.attach(label, 4, 20, 0, 3) 223 build_fail_tab.attach(label, 4, 26, 0, 6)
240 224
241 label = gtk.Label() 225 label = gtk.Label()
242 label.set_alignment(0.0, 0.5) 226 label.set_alignment(0.0, 0.5)
243 num_of_fails = self.update_failures_sum_display() 227 label.set_markup("<span size='medium'>Check the \"Issues\" information for more details</span>")
244 current_fail, recipe_task_status = self.task_status.get_text().split('\n') 228 build_fail_tab.attach(label, 4, 40, 4, 9)
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 229
248 # create button 'Edit packages' 230 # create button 'Edit packages'
249 action_button = HobButton(mainly_action) 231 action_button = HobButton(primary_action)
250 action_button.set_size_request(-1, 49) 232 action_button.set_size_request(-1, 40)
251 action_button.connect('clicked', self.failure_main_action_button_clicked_cb, mainly_action) 233 action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action)
252 build_fail_tab.attach(action_button, 4, 16, 4, 6) 234 build_fail_tab.attach(action_button, 4, 13, 9, 12)
253 235
254 if next_action: 236 if log_file:
255 next_button = HobAltButton(next_action) 237 open_log_button = HobAltButton("Open log")
256 next_button.set_alignment(0.0, 0.5) 238 open_log_button.set_relief(gtk.RELIEF_HALF)
257 next_button.connect('clicked', self.failure_next_action_button_clicked_cb, next_action) 239 open_log_button.connect('clicked', self.failure_open_log_button_clicked_cb, log_file)
258 build_fail_tab.attach(next_button, 17, 24, 4, 5) 240 build_fail_tab.attach(open_log_button, 14, 23, 9, 12)
259 241
242 attach_pos = (24 if log_file else 14)
260 file_bug_button = HobAltButton('File a bug') 243 file_bug_button = HobAltButton('File a bug')
261 file_bug_button.set_alignment(0.0, 0.5) 244 file_bug_button.set_relief(gtk.RELIEF_HALF)
262 file_bug_button.connect('clicked', self.failure_file_bug_activate_link_cb) 245 file_bug_button.connect('clicked', self.failure_activate_file_bug_link_cb)
263 build_fail_tab.attach(file_bug_button, 17, 24, 4 + abs(next_action != ""), 6) 246 build_fail_tab.attach(file_bug_button, attach_pos, attach_pos + 9, 9, 12)
264 247
265 return build_fail_top 248 return build_fail_top
266 249
@@ -268,10 +251,10 @@ class BuildDetailsPage (HobPage):
268 self._remove_all_widget() 251 self._remove_all_widget()
269 self.title = "Hob cannot build your %s" % title 252 self.title = "Hob cannot build your %s" % title
270 253
271 self.build_fail_bar = self.add_build_fail_top_bar(action_names) 254 self.build_fail_bar = self.add_build_fail_top_bar(action_names, self.builder.current_logfile)
272 self.pack_start(self.build_fail_bar)
273 self.pack_start(self.group_align, expand=True, fill=True)
274 255
256 self.pack_start(self.group_align, expand=True, fill=True)
257 self.box_group_area.pack_start(self.build_fail_bar, expand=False, fill=False)
275 self.box_group_area.pack_start(self.vbox, expand=True, fill=True) 258 self.box_group_area.pack_start(self.vbox, expand=True, fill=True)
276 259
277 self.vbox.pack_start(self.notebook, expand=True, fill=True) 260 self.vbox.pack_start(self.notebook, expand=True, fill=True)
@@ -334,7 +317,7 @@ class BuildDetailsPage (HobPage):
334 def show_configurations(self, configurations, params): 317 def show_configurations(self, configurations, params):
335 self.config_tv.show(configurations, params) 318 self.config_tv.show(configurations, params)
336 319
337 def failure_main_action_button_clicked_cb(self, button, action): 320 def failure_primary_action_button_clicked_cb(self, button, action):
338 if "Edit recipes" in action: 321 if "Edit recipes" in action:
339 self.builder.show_recipes() 322 self.builder.show_recipes()
340 elif "Edit packages" in action: 323 elif "Edit packages" in action:
@@ -342,9 +325,9 @@ class BuildDetailsPage (HobPage):
342 elif "Edit image configuration" in action: 325 elif "Edit image configuration" in action:
343 self.builder.show_configuration() 326 self.builder.show_configuration()
344 327
345 def failure_next_action_button_clicked_cb(self, button, action): 328 def failure_open_log_button_clicked_cb(self, button, log_file):
346 if "Create new image" in action: 329 if log_file:
347 self.builder.initiate_new_build_async() 330 os.system("xdg-open /%s" % log_file)
348 331
349 def failure_file_bug_activate_link_cb(self, button): 332 def failure_activate_file_bug_link_cb(self, button):
350 button.child.emit('activate-link', "http://bugzilla.yoctoproject.org") 333 button.child.emit('activate-link', "http://bugzilla.yoctoproject.org")