def add_build_fail_top_bar(self, actions, log_file=None): primary_action = "Edit %s" % actions self.notebook.set_page("Issues") color = HobColors.ERROR build_fail_top = gtk.EventBox() build_fail_top.set_size_request(-1, 200) build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) build_fail_tab = gtk.Table(14, 46, True) build_fail_top.add(build_fail_tab) icon = gtk.Image() icon_pix_buffer = gtk.gdk.pixbuf_new_from_file( hic.ICON_INDI_ERROR_FILE) icon.set_from_pixbuf(icon_pix_buffer) build_fail_tab.attach(icon, 1, 4, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title) build_fail_tab.attach(label, 4, 26, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) label.set_markup( "<span size='medium'>Check the \"Issues\" information for more details</span>" ) build_fail_tab.attach(label, 4, 40, 4, 9) # create button 'Edit packages' action_button = HobButton(primary_action) action_button.set_size_request(-1, 40) action_button.set_tooltip_text("Edit the %s parameters" % actions) action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action) build_fail_tab.attach(action_button, 4, 13, 9, 12) if log_file: open_log_button = HobAltButton("Open log") open_log_button.set_relief(gtk.RELIEF_HALF) open_log_button.set_tooltip_text("Open the build's log file") open_log_button.connect('clicked', self.failure_open_log_button_clicked_cb, log_file) build_fail_tab.attach(open_log_button, 14, 23, 9, 12) attach_pos = (24 if log_file else 14) file_bug_button = HobAltButton('File a bug') file_bug_button.set_relief(gtk.RELIEF_HALF) file_bug_button.set_tooltip_text( "Open the Yocto Project bug tracking website") file_bug_button.connect('clicked', self.failure_activate_file_bug_link_cb) build_fail_tab.attach(file_bug_button, attach_pos, attach_pos + 9, 9, 12) return build_fail_top
def add_build_stop_top_bar(self, action, log_file=None): color = HobColors.LIGHT_GRAY build_stop_top = gtk.EventBox() #build_stop_top.set_size_request(-1, 200) build_stop_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) build_stop_top.set_flags(gtk.CAN_DEFAULT) build_stop_top.grab_default() build_stop_tab = gtk.Table(11, 46, True) build_stop_top.add(build_stop_tab) icon = gtk.Image() icon_pix_buffer = gtk.gdk.pixbuf_new_from_file( hic.ICON_INFO_HOVER_FILE) icon.set_from_pixbuf(icon_pix_buffer) build_stop_tab.attach(icon, 1, 4, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title) build_stop_tab.attach(label, 4, 26, 0, 6) action_button = HobButton("Edit %s" % action) action_button.set_size_request(-1, 40) if action == "image": action_button.set_tooltip_text("Edit the image parameters") elif action == "recipes": action_button.set_tooltip_text("Edit the included recipes") elif action == "packages": action_button.set_tooltip_text("Edit the included packages") action_button.connect('clicked', self.stop_primary_action_button_clicked_cb, action) build_stop_tab.attach(action_button, 4, 13, 6, 9) if log_file: open_log_button = HobAltButton("Open log") open_log_button.set_relief(gtk.RELIEF_HALF) open_log_button.set_tooltip_text("Open the build's log file") open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file) build_stop_tab.attach(open_log_button, 14, 23, 6, 9) attach_pos = (24 if log_file else 14) build_button = HobAltButton("Build new image") #build_button.set_size_request(-1, 40) build_button.set_tooltip_text("Create a new image from scratch") build_button.connect('clicked', self.new_image_button_clicked_cb) build_stop_tab.attach(build_button, attach_pos, attach_pos + 9, 6, 9) return build_stop_top, action_button
def add_build_fail_top_bar(self, actions, log_file=None): primary_action = "Edit %s" % actions self.notebook.set_page("Issues") color = HobColors.ERROR build_fail_top = gtk.EventBox() #build_fail_top.set_size_request(-1, 200) build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) build_fail_tab = gtk.Table(14, 46, True) build_fail_top.add(build_fail_tab) icon = gtk.Image() icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INDI_ERROR_FILE) icon.set_from_pixbuf(icon_pix_buffer) build_fail_tab.attach(icon, 1, 4, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title) build_fail_tab.attach(label, 4, 26, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) label.set_markup("<span size='medium'>Check the \"Issues\" information for more details</span>") build_fail_tab.attach(label, 4, 40, 4, 9) # create button 'Edit packages' action_button = HobButton(primary_action) #action_button.set_size_request(-1, 40) action_button.set_tooltip_text("Edit the %s parameters" % actions) action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action) build_fail_tab.attach(action_button, 4, 13, 9, 12) if log_file: open_log_button = HobAltButton("Open log") open_log_button.set_relief(gtk.RELIEF_HALF) open_log_button.set_tooltip_text("Open the build's log file") open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file) build_fail_tab.attach(open_log_button, 14, 23, 9, 12) attach_pos = (24 if log_file else 14) file_bug_button = HobAltButton('File a bug') file_bug_button.set_relief(gtk.RELIEF_HALF) file_bug_button.set_tooltip_text("Open the Yocto Project bug tracking website") file_bug_button.connect('clicked', self.failure_activate_file_bug_link_cb) build_fail_tab.attach(file_bug_button, attach_pos, attach_pos + 9, 9, 12) return build_fail_top
def add_build_stop_top_bar(self, action, log_file=None): color = HobColors.LIGHT_GRAY build_stop_top = gtk.EventBox() #build_stop_top.set_size_request(-1, 200) build_stop_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) build_stop_top.set_flags(gtk.CAN_DEFAULT) build_stop_top.grab_default() build_stop_tab = gtk.Table(11, 46, True) build_stop_top.add(build_stop_tab) icon = gtk.Image() icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INFO_HOVER_FILE) icon.set_from_pixbuf(icon_pix_buffer) build_stop_tab.attach(icon, 1, 4, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title) build_stop_tab.attach(label, 4, 26, 0, 6) action_button = HobButton("Edit %s" % action) action_button.set_size_request(-1, 40) if action == "image": action_button.set_tooltip_text("Edit the image parameters") elif action == "recipes": action_button.set_tooltip_text("Edit the included recipes") elif action == "packages": action_button.set_tooltip_text("Edit the included packages") action_button.connect('clicked', self.stop_primary_action_button_clicked_cb, action) build_stop_tab.attach(action_button, 4, 13, 6, 9) if log_file: open_log_button = HobAltButton("Open log") open_log_button.set_relief(gtk.RELIEF_HALF) open_log_button.set_tooltip_text("Open the build's log file") open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file) build_stop_tab.attach(open_log_button, 14, 23, 6, 9) attach_pos = (24 if log_file else 14) build_button = HobAltButton("Build new image") #build_button.set_size_request(-1, 40) build_button.set_tooltip_text("Create a new image from scratch") build_button.connect('clicked', self.new_image_button_clicked_cb) build_stop_tab.attach(build_button, attach_pos, attach_pos + 9, 6, 9) return build_stop_top, action_button
def add_build_fail_top_bar(self, actions, log_file=None): primary_action = "Edit %s" % actions color = HobColors.ERROR build_fail_top = gtk.EventBox() #build_fail_top.set_size_request(-1, 200) build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) build_fail_tab = gtk.Table(14, 46, True) build_fail_top.add(build_fail_tab) icon = gtk.Image() icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INDI_ERROR_FILE) icon.set_from_pixbuf(icon_pix_buffer) build_fail_tab.attach(icon, 1, 4, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title) build_fail_tab.attach(label, 4, 26, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) # Ensure variable disk_full is defined if not hasattr(self.builder, 'disk_full'): self.builder.disk_full = False if self.builder.disk_full: markup = "<span size='medium'>There is no disk space left, so Hob cannot finish building your image. Free up some disk space\n" markup += "and restart the build. Check the \"Issues\" tab for more details</span>" label.set_markup(markup) else: label.set_markup("<span size='medium'>Check the \"Issues\" information for more details</span>") build_fail_tab.attach(label, 4, 40, 4, 9) # create button 'Edit packages' action_button = HobButton(primary_action) #action_button.set_size_request(-1, 40) action_button.set_tooltip_text("Edit the %s parameters" % actions) action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action) if log_file: open_log_button = HobAltButton("Open log") open_log_button.set_relief(gtk.RELIEF_HALF) open_log_button.set_tooltip_text("Open the build's log file") open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file) attach_pos = (24 if log_file else 14) file_bug_button = HobAltButton('File a bug') file_bug_button.set_relief(gtk.RELIEF_HALF) file_bug_button.set_tooltip_text("Open the Yocto Project bug tracking website") file_bug_button.connect('clicked', self.failure_activate_file_bug_link_cb) if not self.builder.disk_full: build_fail_tab.attach(action_button, 4, 13, 9, 12) if log_file: build_fail_tab.attach(open_log_button, 14, 23, 9, 12) build_fail_tab.attach(file_bug_button, attach_pos, attach_pos + 9, 9, 12) else: restart_build = HobButton("Restart the build") restart_build.set_tooltip_text("Restart the build") restart_build.connect('clicked', self.restart_build_button_clicked_cb) build_fail_tab.attach(restart_build, 4, 13, 9, 12) build_fail_tab.attach(action_button, 14, 23, 9, 12) if log_file: build_fail_tab.attach(open_log_button, attach_pos, attach_pos + 9, 9, 12) self.builder.disk_full = False return build_fail_top
def add_build_fail_top_bar(self, actions, log_file=None): primary_action = "Edit %s" % actions color = HobColors.ERROR build_fail_top = gtk.EventBox() #build_fail_top.set_size_request(-1, 200) build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) build_fail_tab = gtk.Table(14, 46, True) build_fail_top.add(build_fail_tab) icon = gtk.Image() icon_pix_buffer = gtk.gdk.pixbuf_new_from_file( hic.ICON_INDI_ERROR_FILE) icon.set_from_pixbuf(icon_pix_buffer) build_fail_tab.attach(icon, 1, 4, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title) build_fail_tab.attach(label, 4, 26, 0, 6) label = gtk.Label() label.set_alignment(0.0, 0.5) # Ensure variable disk_full is defined if not hasattr(self.builder, 'disk_full'): self.builder.disk_full = False if self.builder.disk_full: markup = "<span size='medium'>There is no disk space left, so Hob cannot finish building your image. Free up some disk space\n" markup += "and restart the build. Check the \"Issues\" tab for more details</span>" label.set_markup(markup) else: label.set_markup( "<span size='medium'>Check the \"Issues\" information for more details</span>" ) build_fail_tab.attach(label, 4, 40, 4, 9) # create button 'Edit packages' action_button = HobButton(primary_action) #action_button.set_size_request(-1, 40) action_button.set_tooltip_text("Edit the %s parameters" % actions) action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action) if log_file: open_log_button = HobAltButton("Open log") open_log_button.set_relief(gtk.RELIEF_HALF) open_log_button.set_tooltip_text("Open the build's log file") open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file) attach_pos = (24 if log_file else 14) file_bug_button = HobAltButton('File a bug') file_bug_button.set_relief(gtk.RELIEF_HALF) file_bug_button.set_tooltip_text( "Open the Yocto Project bug tracking website") file_bug_button.connect('clicked', self.failure_activate_file_bug_link_cb) if not self.builder.disk_full: build_fail_tab.attach(action_button, 4, 13, 9, 12) if log_file: build_fail_tab.attach(open_log_button, 14, 23, 9, 12) build_fail_tab.attach(file_bug_button, attach_pos, attach_pos + 9, 9, 12) else: restart_build = HobButton("Restart the build") restart_build.set_tooltip_text("Restart the build") restart_build.connect('clicked', self.restart_build_button_clicked_cb) build_fail_tab.attach(restart_build, 4, 13, 9, 12) build_fail_tab.attach(action_button, 14, 23, 9, 12) if log_file: build_fail_tab.attach(open_log_button, attach_pos, attach_pos + 9, 9, 12) self.builder.disk_full = False return build_fail_top