def __init__(self, arguments): """Creates a new QA reviewer window. Keyword -- arguments: arguments: A commandline to process when setting up the environment """ # Create the properties for this checklist ### FIXME: Properties is hard-coded right now. Needs some love. self.properties = Properties('fedoraus.xml') # Load the interface gladefile = 'glade/qa-assistant.glade' gnomeglade.GnomeApp.__init__(self, __programName__, __version__, gladefile, 'ReviewerWindow') self.program.set_property(gnome.PARAM_HUMAN_READABLE_NAME, __programHumanName__) # # Create additional interface components # iconFile = self._GnomeApp__uninstalled_file('pixmaps/qa-icon.png') if iconFile == None: iconFile = self.locate_file(gnome.FILE_DOMAIN_APP_PIXMAP, 'qa-icon.png') if iconFile == []: iconFile = None else: iconFile = iconFile[0] if iconFile: self.ReviewerWindow.set_property('icon', gnomeglade.load_pixbuf(iconFile)) # Create a treeview for our listPane self.checkView = gtk.TreeView() self.checkView.set_rules_hint(True) # load the checklist data (Associates itself with checkView) self.__load_checklist() renderer = gtk.CellRendererToggle() renderer.set_radio(False) column = gtk.TreeViewColumn('Display', renderer, active=checklist.DISPLAY, visible=checklist.ISITEM) renderer.connect('toggled', self.display_toggle) self.checkView.append_column(column) renderer = OptionCellRenderer() column = gtk.TreeViewColumn('pass/fail', renderer, optionlist=checklist.RESLIST, selectedoption=checklist.RESOLUTION, mode=checklist.ISITEM) column.set_cell_data_func(renderer, self.__translate_option_mode) renderer.connect('changed', self.resolution_changed) self.checkView.append_column(column) renderer = gtk.CellRendererText() column = gtk.TreeViewColumn('Description', renderer, text=checklist.SUMMARY) self.checkView.append_column(column) renderer = gtk.CellRendererText() renderer.connect('edited', self.output_edited, self.checklist.tree) column = gtk.TreeViewColumn('Output', renderer, markup=checklist.OUTPUT, visible=checklist.DISPLAY, editable=checklist.DISPLAY) self.outputColumn = column self.checkView.append_column(column) self.tips = TreeTips(self.checkView, checklist.DESC) self.listPane.add(self.checkView) self.checkView.show() self.grabArrow=gtk.Arrow(gtk.ARROW_LEFT, gtk.SHADOW_NONE) self.grabArrow.set_size_request(4,4) label=self.grabBar.get_child() self.grabBar.remove(label) self.grabBar.add(self.grabArrow) self.grabArrow.show() self.reviewView = Review(self.checklist.tree, self.properties) self.reviewView.show() self.reviewPane.add(self.reviewView) self.reviewScroll.hide() # # Command line initialization # ### FIXME: take care of the command line args ### FIXME: Absolute dependence on arguments[1] being an SRPM without a # check to make sure of it. Need to fix that up with cmd-line args. if len(arguments) == 2: self.SRPM_into_properties(arguments[1]) # # Blast off! # self.__check_readiness() self.ReviewerWindow.show()
def __init__(self, checkList=None): gtk.TreeView.__init__(self) if checkList: self.set_model(checkList) self.set_rules_hint(True) renderer = gtk.CellRendererToggle() renderer.set_radio(False) column = gtk.TreeViewColumn('Display', renderer, active=checklist.DISPLAY, visible=checklist.ISITEM) renderer.connect('toggled', self.display_toggle) self.append_column(column) renderer = OptionCellRenderer() column = gtk.TreeViewColumn('Resolution', renderer, optionlist=checklist.RESLIST, selectedoption=checklist.RESOLUTION, mode=checklist.ISITEM) column.set_cell_data_func(renderer, self.__translate_option_mode) renderer.connect('changed', self.resolution_changed) self.append_column(column) renderer = gtk.CellRendererText() column = gtk.TreeViewColumn('Summary', renderer, text=checklist.SUMMARY) self.append_column(column) renderer = gtk.CellRendererText() renderer.connect('edited', self.output_edited) column = gtk.TreeViewColumn('Output', renderer, markup=checklist.OUTPUT, visible=checklist.DISPLAY, editable=checklist.DISPLAY) self.outputColumn = column self.outputHidden = False self.append_column(column) self.tips = TreeTips(self, checklist.DESC) # Get preferences from gconf for setting the treetip help. self.gconfClient = gconf.client_get_default() self.gconfClient.add_dir(GCONFPREFIX, gconf.CLIENT_PRELOAD_NONE) key = GCONFPREFIX + '/display/disable-checklist-descriptions' self.gconfClient.notify_add(key, self.__change_treetip_show) try: disableTips = self.gconfClient.get_bool(key) except gobject.GError: disableTips = ( self.gconfClient.get_default_from_schema(key).get_bool()) if disableTips: self.tips.disable() else: self.tips.enable() key = GCONFPREFIX + '/display/checklist-description-wait' self.gconfClient.notify_add(key, self.__change_treetip_delay) try: tipDelay = self.gconfClient.get_int(key) except gobject.GError: tipDelay = self.gconfClient.get_default_from_schema(key).get_int() if tipDelay: self.tips.set_property('delay', tipDelay)