def __init__(self): GladeDelegate.__init__(self, "ui", toplevel_name='MainWindow', delete_handler=self.on_exit__activate) self.tree = self.get_widget('maintree') tree = self.tree cols = [Column('name', title=_('Step'), data_type=str, expand=True)] tree.set_columns(cols) tree.set_headers_visible(False) basics = tree.append(None, Step(_('Assessment'), 0)) first = tree.append(basics, Step(_('Target Information'), 1)) self.first = first tree.append(basics, Step(_('Inventory'), 2)) tree.append(basics, Step(_('Vulnerabilities'), 3)) tree.expand(basics) controls = tree.append(None, Step(_('Treatment'), 4)) self.first_control = tree.append(controls, Step(_('Control Library'), 5)) tree.append(controls, Step(_('Applied Controls'), 5)) # Open or create a file before doing much if self.db_file is None: self.open_or_new() tree.expand(controls) tree.select(self.first) icon = environ.find_resource('pixmaps', 'criskicon.png') __window = self.get_widget('MainWindow') __window.set_icon_from_file(icon)
def __init__(self): GladeDelegate.__init__(self, "ui", toplevel_name = 'MainWindow', delete_handler = self.on_exit__activate) self.tree = self.get_widget('maintree') tree = self.tree cols = [ Column('name', title=_('Step'), data_type = str, expand = True) ] tree.set_columns(cols) tree.set_headers_visible(False) basics = tree.append(None, Step(_('Assessment'), 0)) first = tree.append(basics, Step(_('Target Information'), 1)) self.first = first tree.append(basics, Step(_('Inventory'), 2)) tree.append(basics, Step(_('Vulnerabilities'), 3)) tree.expand(basics) controls = tree.append(None, Step(_('Treatment'), 4)) self.first_control = tree.append(controls, Step(_('Control Library'), 5)) tree.append(controls, Step(_('Applied Controls'), 5)) # Open or create a file before doing much if self.db_file is None: self.open_or_new() tree.expand(controls) tree.select(self.first) icon = environ.find_resource('pixmaps', 'criskicon.png') __window = self.get_widget('MainWindow') __window.set_icon_from_file(icon)
def on_about__activate(self, *args): diag = gtk.AboutDialog() logofile = environ.find_resource('pixmaps', 'aboutlogo.png') logo = gtk.gdk.pixbuf_new_from_file(logofile) diag.set_logo(logo) diag.set_name('Crisk') diag.set_version(crisk.__version__) diag.set_copyright('Copyright 2009 - José de Paula E. Júnior') diag.set_authors(['José de Paula E. Júnior <*****@*****.**>']) diag.set_comments(_('A simple risk management tool')) diag.set_website('https://coredump.github.com/crisk') diag.set_license(crisk.__license__) x = diag.run() diag.hide()