def __init__(self): HIGHBox.__init__(self) self._create_target() self._create_profile() self.scan_button = gtk.Button(_("Scan")) self._pack_noexpand_nofill(self.target_label) self._pack_expand_fill(self.target_entry) self._pack_noexpand_nofill(self.profile_label) self._pack_expand_fill(self.profile_entry) self._pack_noexpand_nofill(self.scan_button) self.target_entry.set_focus_child(self.target_entry.child) self.profile_entry.set_focus_child(self.profile_entry.child) self.target_entry.child.grab_focus() # Events self.target_entry.child.connect('key-press-event',\ self.next, self.profile_entry.child) self.target_entry.child.connect('activate', lambda x: self.profile_entry.child.grab_focus()) self.profile_entry.child.connect('activate', lambda x: self.scan_button.clicked())
def __create_widgets(self): """""" self.update_switch_hbox = HIGHBox() self.update_settings_hbox = HIGHBox() self.update_db_hbox = HIGHBox() self.update_switch_section = HIGSectionLabel(_("Update News Detect")) self.update_switch_table = HIGTable() self.update_settings_section = HIGSectionLabel(_("Update Settings")) self.update_settings_table = HIGTable() self.update_db_section = HIGSectionLabel(_("Update Database")) self.update_db_table = HIGTable() self.update_check = gtk.CheckButton(_("Automatically update")) self.update_switch_check = gtk.CheckButton(_("Software Update Detect Switch")) self.update_times_label = HIGEntryLabel(_("Auto detect update news")) self.update_method_label = HIGEntryLabel(_("Update method")) self.update_time_store = gtk.ListStore(str) self.update_time_entry = gtk.ComboBoxEntry(self.update_time_store, 0) self.update_method_store = gtk.ListStore(str) self.update_method_entry = gtk.ComboBoxEntry(self.update_method_store, 0) self.update_db_label = HIGEntryLabel() self.update_db_clear_button = gtk.Button(_("Clear Update Information"))
def create_widgets(self): vboxmain = gtk.VBox() sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.store = gtk.ListStore(str) self.update_model() self.treeView = gtk.TreeView(self.store) #treeView.connect("row-activated", self.on_activated) #treeView.set_rules_hint(True) self.create_columns(self.treeView) sw.add(self.treeView) # buttons vbox = HIGVBox() btn = HIGButton(_("Edit..."), gtk.STOCK_EDIT) vbox.pack_start(btn, False, False) btn.connect("clicked", self._edit_template) btn = HIGButton(_("Remove"), gtk.STOCK_REMOVE) vbox.pack_start(btn, False, False) btn.connect("clicked", self._remove_template) hbox = HIGHBox() hbox.pack_start(sw, True, True) hbox.pack_start(vbox, False, False) vboxmain.pack_start(hbox, True, True, 0) self.add(vboxmain) self.show_all()
def __create_widgets(self): self.general_hbox = HIGHBox() self.version_hbox = HIGHBox() ################ #Version Section self.version_section = HIGSectionLabel(_("Version")) self.version_table = HIGTable() self.version_label = HIGEntryLabel(_("Software Version:")) self.version2_label = HIGEntryLabel() self.testver_label = HIGEntryLabel(_("Service Test Version:")) self.testver2_label = HIGEntryLabel() self.attribute_label = HIGEntryLabel(_("Agent Attribute:")) self.attribute2_label = HIGEntryLabel() ################ #General Section self.general_section = HIGSectionLabel(_("General")) self.general_table = HIGTable() self.startup_check = gtk.CheckButton( _("Startup OpenMonitor on system startup")) self.notification_check = gtk.CheckButton( _("Show Desktop Notifications")) self.login_ckeck = gtk.CheckButton(_("Enable Auto login"))
def __init__(self): HIGVBox.__init__(self) self.set_spacing(12) table = HIGTable() self.hbox = HIGHBox() self.description = HIGEntryLabel( _("""You wish to create a new profile,\ or just want to quickly create a command and run it once?""")) self.profile_radio = gtk.RadioButton(None, _('Profile')) self.command_radio = gtk.RadioButton(self.profile_radio, _('Command')) self.command_radio.connect('toggled', self.enable_target) self.profile_radio.connect('toggled', self.disable_target) self.target_label = HIGEntryLabel(_("Target")) self.target_entry = gtk.Entry() self.set_completion() self.hbox._pack_noexpand_nofill(hig_box_space_holder()) self.hbox._pack_noexpand_nofill(self.target_label) self.hbox._pack_expand_fill(self.target_entry) self.bar = ForwardBar() self._pack_noexpand_nofill(self.description) self._pack_expand_fill(table) self._pack_noexpand_nofill(self.bar) table.attach(self.profile_radio, 0, 1, 0, 1, yoptions=0) table.attach(self.command_radio, 0, 1, 1, 2, yoptions=0) table.attach(self.hbox, 0, 1, 2, 3, yoptions=0) self.disable_target()
def __init__(self): HIGHBox.__init__(self) self.frame = gtk.Frame() self._pack_expand_fill(self.frame) self.__create_draw_area()
def __init__(self): """ """ super(SaveDialog, self).__init__(title=_("Save Topology"), action=gtk.FILE_CHOOSER_ACTION_SAVE, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK)) self.__combo = gtk.combo_box_new_text() types_list = TYPES.keys() types_list.sort() for i in types_list: self.__combo.append_text(i) self.__combo.set_active(1) self.__label = HIGLabel(_("Select the output type:")) self.__hbox = HIGHBox() self.__hbox._pack_noexpand_nofill(self.__label) self.__hbox._pack_expand_fill(self.__combo) self.set_extra_widget(self.__hbox) self.set_do_overwrite_confirmation(True) self.__hbox.show_all()
def __create_widgets(self): self.vbox = HIGVBox() self.hbox = HIGHBox() self.notebook = HIGNotebook() self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE) self.written_by_scroll = HIGScrolledWindow() self.written_by_text = HIGTextView() self.design_scroll = HIGScrolledWindow() self.design_text = HIGTextView() self.soc2007_scroll = HIGScrolledWindow() self.soc2007_text = HIGTextView() self.soc2008_scroll = HIGScrolledWindow() self.soc2008_text = HIGTextView() self.soc2009_scroll = HIGScrolledWindow() self.soc2009_text = HIGTextView() self.contributors_scroll = HIGScrolledWindow() self.contributors_text = HIGTextView() self.translation_scroll = HIGScrolledWindow() self.translation_text = HIGTextView() self.nokia_scroll = HIGScrolledWindow() self.nokia_text = HIGTextView()
def __create_widgets(self): self.vbox = HIGVBox() self.hbox = HIGHBox() self.img_logo = gtk.Image() self.event_img_logo = gtk.EventBox() self.img = 1 self.d = {} for c in (65, 97): for i in range(26): self.d[chr(i + c)] = chr((i + 13) % 26 + c) self.lbl_program_version = gtk.Label("""\ <span size='30000' weight='heavy'>Umit %s</span>""" % VERSION) self.lbl_program_description = gtk.Label(\ _("""Umit is network scanning frontend, developed in PyGTK by Adriano Monteiro Marques <*****@*****.**> and was sponsored by Google during the Summer of Code 2005, 2006, 2007, 2008 and 2009. Thanks Google!""")) self.lbl_copyright = gtk.Label("<small>Copyright (C) 2005-2006 \ Insecure.Com LLC. and (C) 2007-2009 Adriano Monteiro Marques</small>") self.lbl_program_website = gtk.Label(\ "<span underline='single' \ foreground='blue'>http://www.umitproject.org</span>" ) self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE) self.btn_credits = HIGButton(_("Credits"))
def do_realize(self): global global_animation HIGHBox.do_realize(self) self.anim_image.set_from_animation(global_animation) self.anim_image.hide()
def set_scan_infos(self, scan_info): for scan in scan_info: exp = gtk.Expander('<b>%s - %s</b>' % (_('Scan Info'), scan['type'].capitalize())) exp.set_use_markup(True) hbox = HIGHBox() table = HIGTable() table.set_border_width(5) table.set_row_spacings(6) table.set_col_spacings(6) table.attach(HIGEntryLabel(_('Scan type:')),0,1,0,1) table.attach(HIGEntryLabel(scan['type']),1,2,0,1) table.attach(HIGEntryLabel(_('Protocol:')),0,1,1,2) table.attach(HIGEntryLabel(scan['protocol']),1,2,1,2) table.attach(HIGEntryLabel(_('# scanned ports:')),0,1,2,3) table.attach(HIGEntryLabel(scan['numservices']),1,2,2,3) table.attach(HIGEntryLabel(_('Services:')),0,1,3,4) table.attach(self.get_service_view(scan['services'].split(',')),\ 1,2,3,4) hbox._pack_noexpand_nofill(hig_box_space_holder()) hbox._pack_noexpand_nofill(table) exp.add (hbox) self._pack_noexpand_nofill(exp)
def __create_widgets(self): self.hbox1 = HIGHBox() self.hbox2 = HIGHBox() self.subbox = Tests() self.hbox1.add(self.subbox) self.checkbtn = gtk.CheckButton(_("Update tests module automatically")) self.checkbtn_throttled = gtk.CheckButton(_("Load HTTP Throttled Test"))
def __create_widgets(self): self.general_hbox = HIGHBox() self.version_hbox = HIGHBox() ################ #Version Section self.version_section = HIGSectionLabel(_("Version")) self.version_table = HIGTable() self.version_label = HIGEntryLabel(_("Software Version:")) self.version2_label = HIGEntryLabel() self.testver_label = HIGEntryLabel(_("Service Test Version:")) self.testver2_label = HIGEntryLabel() self.attribute_label = HIGEntryLabel(_("Agent Attribute:")) self.attribute2_label = HIGEntryLabel() ################ #General Section self.general_section = HIGSectionLabel(_("General")) self.general_table = HIGTable() self.startup_check = gtk.CheckButton(_("Startup OpenMonitor on system startup")) self.notification_check = gtk.CheckButton(_("Show Desktop Notifications")) self.login_ckeck = gtk.CheckButton(_("Enable Auto login"))
def __create_widgets(self): """ """ self.__params = HIGVBox() self.__params_main = HIGHBox() self.__params_options = HIGHBox() self.__fisheye_label = gtk.Label('Fisheye on ring') self.__ring = gtk.Adjustment(0, 0, self.__ring_max_value, 0.01, 0.01) self.__ring_spin = gtk.SpinButton(self.__ring) self.__ring_spin.set_digits(2) self.__ring_scale = gtk.HScale(self.__ring) self.__ring_scale.set_size_request(100, -1) self.__ring_scale.set_digits(2) self.__ring_scale.set_value_pos(gtk.POS_LEFT) self.__ring_scale.set_draw_value(False) self.__ring_scale.set_update_policy(gtk.UPDATE_CONTINUOUS) self.__interest_label = gtk.Label('Interest factor') self.__interest = gtk.Adjustment(0, 0, 10, 0.01) self.__interest_spin = gtk.SpinButton(self.__interest) self.__interest_spin.set_digits(2) self.__spread_label = gtk.Label('Spread factor') self.__spread = gtk.Adjustment(0, -1.0, 1.0, 0.01, 0.01) self.__spread_spin = gtk.SpinButton(self.__spread) self.__spread_spin.set_digits(2) self.__options_button = gtk.ToggleButton('More') self.__options_button.set_active(False) self.__params._pack_noexpand_nofill(self.__params_main) self.__params._pack_noexpand_nofill(self.__params_options) self.__params_main._pack_noexpand_nofill(self.__fisheye_label) self.__params_main._pack_noexpand_nofill(self.__ring_spin) self.__params_main._pack_expand_fill(self.__ring_scale) self.__params_main._pack_noexpand_nofill(self.__options_button) self.__params_options._pack_noexpand_nofill(self.__interest_label) self.__params_options._pack_noexpand_nofill(self.__interest_spin) self.__params_options._pack_noexpand_nofill(self.__spread_label) self.__params_options._pack_noexpand_nofill(self.__spread_spin) self.__params_options.set_no_show_all(True) self.__params_options.hide() self._pack_noexpand_nofill(self.__params) self.__ring.connect('value_changed', self.__change_ring) self.__interest.connect('value_changed', self.__change_interest) self.__spread.connect('value_changed', self.__change_spread) self.__options_button.connect('toggled', self.__options_toggled) gobject.timeout_add(REFRESH_RATE, self.__update_fisheye)
def __create_widgets(self): """ """ self.__content = HIGVBox() self.__head = HIGHBox(spacing=2) self.__notebook = NodeNotebook(self.__node) # create head elements # icon with node's score color self.__color_box = gtk.EventBox() self.__color_image = gtk.Image() self.__color_image.set_from_file(self.__icon.get_icon('border')) self.__color_box.add(self.__color_image) self.__color_box.set_size_request(15, 15) r, g, b = drawing.cairo_to_gdk_color( self.__node.get_draw_info('color')) self.__color_box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(r, g, b)) # title with the node ip and hostname self.__title = "" if self.__node.get_info('hostname') is not None: self.__title = self.__node.get_info('hostname') + ' - ' self.__title += self.__node.get_info('ip') self.__title_label = HIGSectionLabel(self.__title) self.__title_label.modify_font(self.__title_font) # icon to collapse window self.__collapse_box = gtk.EventBox() self.__collapse_img = gtk.Image() self.__collapse_img.set_from_file(self.__icon.get_icon('collapse')) self.__collapse_box.add(self.__collapse_img) self.__collapse_box.connect('button_press_event', self.collapse_window) self.__collapse_box.add_events(gtk.gdk.BUTTON_PRESS_MASK) # icon to close window self.__close_box = gtk.EventBox() self.__close_img = gtk.Image() self.__close_img.set_from_file(self.__icon.get_icon('close')) self.__close_box.add(self.__close_img) self.__close_box.connect('button_press_event', self.close_window) self.__close_box.add_events(gtk.gdk.BUTTON_PRESS_MASK) # packing head elements self.__head._pack_noexpand_nofill(self.__color_box) self.__head._pack_expand_fill(self.__title_label) self.__head._pack_noexpand_nofill(self.__collapse_box) self.__head._pack_noexpand_nofill(self.__close_box) # packing all to content self.__content._pack_noexpand_nofill(self.__head) self.__content._pack_expand_fill(self.__notebook) # add context to window self.add(self.__content)
def create_table_hbox(self): table = HIGTable() hbox = HIGHBox() hbox._pack_noexpand_nofill(hig_box_space_holder()) hbox._pack_noexpand_nofill(table) return table, hbox
def __create_widgets(self): self.hbox1 = HIGHBox() self.hbox2 = HIGHBox() self.subbox = Tests() self.hbox1.add(self.subbox) self.checkbtn = gtk.CheckButton(_("Update tests module automatically")) self.checkbtn_throttled = gtk.CheckButton( _("Load HTTP Throttled Test"))
def __init__(self): HIGHBox.__init__(self) self.command_label = HIGEntryLabel(_("Command:")) self.command_entry = gtk.Entry() self._pack_noexpand_nofill(self.command_label) self._pack_expand_fill(self.command_entry)
def _create_widgets(self): self.hbox = HIGHBox() self.lbl_diff = HIGSectionLabel("<b>%s</b>" % _("Diff Result")) self.scrolled = gtk.ScrolledWindow() self.txt_diff_result = gtk.TextView() self.txg_tag = gtk.TextTag("diff_style") self.txg_added = gtk.TextTag('added style') self.txg_removed = gtk.TextTag('removed style')
def _create_widgets(self): #Username self.username_label = HIGLabel(_("Username")) self.username_entry = HIGTextEntry() self.username_entry.set_activates_default(True) #Password self.password_label = HIGLabel(_("Password")) self.password_entry = HIGPasswordEntry() self.password_entry.set_activates_default(True) #Logo self.logo_openmonitor = gtk.gdk.pixbuf_new_from_file\ (os.path.join(IMAGES_DIR, 'logoOM.png')) self.logo_image = gtk.Image() self.logo_image.set_from_pixbuf(self.logo_openmonitor) #self.login_text = gtk.Label(_("Log into your ICM agent.")) #Register #self.register_button = HIGStockButton(gtk.STOCK_DIALOG_INFO,_("Register")) self.register_label = \ gtk.Label(_("<span foreground='blue'>" \ "Register id</span>")) self.register_label.set_use_markup(True) self.register_button = gtk.Button() self.register_button.add(self.register_label) self.register_button.set_relief(gtk.RELIEF_NONE) #Forget Password self.forgot_password_label = \ gtk.Label(_("<span foreground='blue'>" \ "Forgot password?</span>")) self.forgot_password_label.set_use_markup(True) self.forgot_password = gtk.Button() self.forgot_password.add(self.forgot_password_label) self.forgot_password.set_relief(gtk.RELIEF_NONE) #Auto Login self.auto_login_checkbtn = gtk.CheckButton(_("Auto login")) #Settings self.settings_button = HIGStockButton(gtk.STOCK_DIALOG_INFO, _("settings")) #Container self.hbox = HIGHBox(False, 2) self.table = HIGTable(8, 4, False) self.table.set_row_spacings(5) self.table.set_col_spacings(10) self.action_area.set_homogeneous(False) #tab orders self.orders = [ self.username_entry, self.password_entry, self.register_button, self.forgot_password ]
def __init__(self, label=None, option=None, hint=None): HIGHBox.__init__(self) self.cbutton = OptionCheck(label,option) self.option = option self.hint = Hint(hint) self.pack_start(self.cbutton, False, False) self.pack_start(self.hint, False, False, 5)
class ScanMapperPage(HIGVBox): def __init__(self): HIGVBox.__init__(self) self.__parser = None self.__radialnet = None self.__created = False def create_widgets(self): if self.__created: self.__toolbar.enable_tools() self.update_graph() return self.set_spacing(0) self.__hbox = HIGHBox(spacing=0) # Create RadialNet self.__radialnet = RadialNet(LAYOUT_WEIGHTED) self.__radialnet.set_no_show_all(True) self.__radialnet.set_empty() self.update_graph() self.__radialnet.show() # Create Controlors self.__control = ControlWidget(self.__radialnet) self.__control_sw = HIGScrolledWindow() self.__control_sw.set_no_show_all(True) self.__control_sw.add_with_viewport(self.__control) self.__control_sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) self.__fisheye = ControlFisheye(self.__radialnet) self.__fisheye.set_no_show_all(True) self.__toolbar = Toolbar(self.__radialnet, self, self.__control_sw, self.__fisheye) self.__toolbar.disable_tools() self.__hbox._pack_expand_fill(self.__radialnet) self.__hbox._pack_noexpand_nofill(self.__control_sw) self._pack_noexpand_nofill(self.__toolbar) self._pack_expand_fill(self.__hbox) self._pack_noexpand_nofill(self.__fisheye) self.show_all() self.__created = True def update_graph(self): self.__graph = GraphBuilder() self.__graph.make(self.__parser) self.__radialnet.set_graph(self.__graph) def set_parse(self, parse): self.__parser = parse if self.__radialnet is not None: self.__radialnet.set_graph(self.__graph)
def __init__(self): HIGHBox.__init__(self) self.entry = gtk.Entry() self.button = HIGButton(stock=gtk.STOCK_OPEN) self.entry.set_width_chars(20) self.button.connect("clicked", self.open_dialog) self._pack_expand_fill(self.entry) self._pack_noexpand_nofill(self.button)
class ChoosePage(HIGVBox): def __init__(self): HIGVBox.__init__(self) self.set_spacing(12) table = HIGTable() self.hbox = HIGHBox() self.description = HIGEntryLabel( _("""You wish to create a new profile,\ or just want to quickly create a command and run it once?""")) self.profile_radio = gtk.RadioButton(None, _('Profile')) self.command_radio = gtk.RadioButton(self.profile_radio, _('Command')) self.command_radio.connect('toggled', self.enable_target) self.profile_radio.connect('toggled', self.disable_target) self.target_label = HIGEntryLabel(_("Target")) self.target_entry = gtk.Entry() self.set_completion() self.hbox._pack_noexpand_nofill(hig_box_space_holder()) self.hbox._pack_noexpand_nofill(self.target_label) self.hbox._pack_expand_fill(self.target_entry) self.bar = ForwardBar() self._pack_noexpand_nofill(self.description) self._pack_expand_fill(table) self._pack_noexpand_nofill(self.bar) table.attach(self.profile_radio, 0, 1, 0, 1, yoptions=0) table.attach(self.command_radio, 0, 1, 1, 2, yoptions=0) table.attach(self.hbox, 0, 1, 2, 3, yoptions=0) self.disable_target() def set_completion(self): self.completion = gtk.EntryCompletion() self.target_list = gtk.ListStore(str) self.completion.set_model(self.target_list) self.completion.set_text_column(0) self.target_entry.set_completion(self.completion) for target in target_list.get_target_list()[:15]: self.target_list.append([target.replace('\n', '')]) def add_new_target(self, target): target_list.add_target(target) def enable_target(self, widget=None): self.hbox.set_sensitive(True) def disable_target(self, widget=None): self.hbox.set_sensitive(False)
def __init__(self, label): gtk.Expander.__init__(self) self.set_use_markup(True) self.set_label(label) self.hbox = HIGHBox() self.hbox.set_border_width(5) self.hbox._pack_noexpand_nofill(hig_box_space_holder()) self.add(self.hbox)
class ChoosePage(HIGVBox): def __init__(self): HIGVBox.__init__(self) self.set_spacing(12) table = HIGTable() self.hbox = HIGHBox() self.description = HIGEntryLabel(_("""You wish to create a new profile,\ or just want to quickly create a command and run it once?""")) self.profile_radio = gtk.RadioButton(None, _('Profile')) self.command_radio = gtk.RadioButton(self.profile_radio, _('Command')) self.command_radio.connect('toggled', self.enable_target) self.profile_radio.connect('toggled', self.disable_target) self.target_label = HIGEntryLabel(_("Target")) self.target_entry = gtk.Entry() self.set_completion() self.hbox._pack_noexpand_nofill(hig_box_space_holder()) self.hbox._pack_noexpand_nofill(self.target_label) self.hbox._pack_expand_fill(self.target_entry) self.bar = ForwardBar() self._pack_noexpand_nofill(self.description) self._pack_expand_fill(table) self._pack_noexpand_nofill(self.bar) table.attach(self.profile_radio,0,1,0,1, yoptions=0) table.attach(self.command_radio,0,1,1,2, yoptions=0) table.attach(self.hbox,0,1,2,3, yoptions=0) self.disable_target() def set_completion(self): self.completion = gtk.EntryCompletion() self.target_list = gtk.ListStore(str) self.completion.set_model(self.target_list) self.completion.set_text_column(0) self.target_entry.set_completion(self.completion) for target in target_list.get_target_list()[:15]: self.target_list.append([target.replace('\n','')]) def add_new_target(self, target): target_list.add_target(target) def enable_target(self, widget=None): self.hbox.set_sensitive(True) def disable_target(self, widget=None): self.hbox.set_sensitive(False)
def __init__(self, param=""): HIGHBox.__init__(self) self.entry = OptionEntry() self.button = HIGButton(stock=gtk.STOCK_OPEN) self._pack_expand_fill(self.entry) self._pack_noexpand_nofill(self.button) self.entry.set_text(param) self.button.connect('clicked', self.open_dialog_cb)
def _create_widgets(self): self.diff_box = HIGHBox() self.diff_title = HIGSectionLabel("Comparison") self.diff_scrolled = gtk.ScrolledWindow() self.diff_tree = gtk.TreeStore(str, str, str, str, str, str) self.diff_view = gtk.TreeView(self.diff_tree) self.diff_column1 = gtk.TreeViewColumn("") self.diff_column2 = gtk.TreeViewColumn(_("Section")) self.diff_column3 = gtk.TreeViewColumn(_("Property")) self.diff_column4 = gtk.TreeViewColumn(_("Original value")) self.diff_column5 = gtk.TreeViewColumn(_("Current value")) self.diff_cell = gtk.CellRendererText()
def _create_widgets(self): self.lbl_scan = HIGSectionLabel("%s %s" % (_("Scan Result"), str(self.num))) self.hbox = HIGHBox() self.table = HIGTable() self.list_scan = gtk.ListStore(str) self.combo_scan = gtk.ComboBoxEntry(self.list_scan, 0) self.btn_open_scan = gtk.Button(stock=gtk.STOCK_OPEN) self.exp_scan = gtk.Expander(_("Scan Result Visualization")) self.scrolled = gtk.ScrolledWindow() self.txt_scan_result = gtk.TextView() self.txg_tag = gtk.TextTag("scan_style")
def __layout(self): self.set_position(gtk.WIN_POS_CENTER) main_vbox = HIGVBox() top_hbox = HIGHBox() top_hbox._pack_noexpand_nofill(self.iimg) top_hbox._pack_noexpand_nofill(self.topic) main_vbox._pack_noexpand_nofill(top_hbox) main_vbox._pack_noexpand_nofill(self.message) self.add(main_vbox)
def __init__(self, parent = None): HIGDialog.__init__(self, _("Find"), parent, gtk.DIALOG_MODAL | gtk.DIALOG_NO_SEPARATOR, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_FIND, gtk.RESPONSE_OK)) self.set_default_response(gtk.RESPONSE_OK) hbox = HIGHBox() hbox.pack_start(gtk.Label(_("Search:"))) self.entry = HIGTextEntry() self.entry.set_activates_default(True) hbox.pack_start(self.entry) self.vbox.add(hbox) self.show_all()
def buildtv(*args): """ Build treeview and append results. """ lsmodel = gtk.ListStore(str, str, str, str) tview = gtk.TreeView(lsmodel) columns = 4 columns_text = ( _("Inventory"), _("Host"), _("First Matched Category"), _("Entry Date") ) tview.columns = [None]*columns for n in range(columns): tview.columns[n] = gtk.TreeViewColumn(columns_text[n]) tview.columns[n].cell = gtk.CellRendererText() tview.columns[n].pack_start(tview.columns[n].cell, True) tview.columns[n].set_attributes(tview.columns[n].cell, text=n) tview.append_column(tview.columns[n]) tview.connect('row-activated', row_activated) # layout matches = len(args[1]) word = append_s(_("result"), matches) upper_title = gtk.Label() upper_title.set_markup( ("<b>%d " % matches) + word + _(" found.") + "</b>") hutbox = HIGHBox() hutbox._pack_noexpand_nofill(upper_title) sw = HIGScrolledWindow() sw.add(tview) vbox = gtk.VBox() vbox.pack_start(hutbox, False, False, 3) vbox.pack_start(sw, True, True, 0) vbox.show_all() # append results to treeview results = args[1] for res, date in results.items(): invname = self.invdb.get_inventory_name_for_id(res[0]) lsmodel.append((invname, res[1], res[2], str(date))) title = _("Search: %s") % args[0] tab_label = HIGAnimatedTabLabel(title) tab_label.connect("close-clicked", close_page, vbox) self.viewernb.append_page(vbox, tab_label)
def __create_widgets(self): self.main_vbox = HIGVBox() self.add(self.main_vbox) self.btn_box = gtk.HButtonBox() self.ok_button = gtk.Button(stock=gtk.STOCK_SAVE) self.ok_button.connect('clicked', lambda x: self.__save_super_peers()) self.cancel_button = gtk.Button(stock=gtk.STOCK_CANCEL) self.cancel_button.connect('clicked', lambda x: self.destroy()) self.SuperPeersBox_vbox = HIGVBox() self.SuperPeersBox_hbox1 = HIGHBox() self.SuperPeersBox_hbox2 = HIGHBox() self.SuperPeersBox_subbox = SuperPeersBox() self.SuperPeersBox_hbox1.add(self.SuperPeersBox_subbox)
def __init__(self, name, get_function, set_function, increment=1): """ """ HIGHBox.__init__(self, spacing=0) self.__increment_pass = increment self.__increment_time = 200 self.__increment = False self.__name = name self.__get_function = get_function self.__set_function = set_function self.__create_widgets()
def __create_widgets(self): na = _('Not available') self.command_expander = gtk.Expander("<b>" + _("Command Info") + "</b>") self.general_expander = gtk.Expander("<b>" + _("General Info") + "</b>") # Command info self.command_label = HIGEntryLabel(_('Command:')) self.info_command_label = HIGEntryLabel(na) self.nmap_version_label = HIGEntryLabel(_('Nmap Version:')) self.info_nmap_version_label = HIGEntryLabel(na) self.verbose_label = HIGEntryLabel(_('Verbosity level:')) self.info_verbose_label = HIGEntryLabel(na) self.debug_label = HIGEntryLabel(_('Debug level:')) self.info_debug_label = HIGEntryLabel(na) self.command_table = HIGTable() self.command_hbox = HIGHBox() # General info: self.start_label = HIGEntryLabel(_('Started on:')) self.info_start_label = HIGEntryLabel(na) self.finished_label = HIGEntryLabel(_('Finished on:')) self.info_finished_label = HIGEntryLabel(na) self.host_up_label = HIGEntryLabel(_('Hosts up:')) self.info_hosts_up_label = HIGEntryLabel(na) self.host_down_label = HIGEntryLabel(_('Hosts down:')) self.info_hosts_down_label = HIGEntryLabel(na) self.host_scanned_label = HIGEntryLabel(_('Hosts scanned:')) self.info_hosts_scanned_label = HIGEntryLabel(na) self.open_label = HIGEntryLabel(_('Open ports:')) self.info_open_label = HIGEntryLabel(na) self.filtered_label = HIGEntryLabel(_('Filtered ports:')) self.info_filtered_label = HIGEntryLabel(na) self.closed_label = HIGEntryLabel(_('Closed ports:')) self.info_closed_label = HIGEntryLabel(na) self.general_table = HIGTable() self.general_hbox = HIGHBox()
def __init__(self, option=None): OptionDisplay.__init__(self) #Profile and Wizard core self._profilecore = None self._wizardcore = None self._notebook = None self._profile = None self._wizard = None self._changed = False hbox = HIGHBox() hbox.set_border_width(12) self.delete_button = HIGButton(stock='gtk-delete') self.delete_button.connect('clicked', self.delete_option) self.new_button = HIGButton(stock='gtk-new') self.new_button.connect('clicked', self.new_option) self.update_button = HIGButton(stock='gtk-refresh') self.update_button.connect('clicked', self.update_option) self.add_button = HIGButton(stock='gtk-add') self.add_button.connect('clicked', self.add_option) hbox.pack_end(self.delete_button, False, False) hbox.pack_end(self.update_button, False, False) hbox.pack_end(self.add_button, False, False) hbox.pack_end(self.new_button, False, False) self.attach(hbox, 1, 2, 6, 7) self.optionlist = option
def __create_wizard_widgets(self): self.wizard_title = HIGEntryLabel("") self.wizard_title.set_line_wrap(False) self.wizard_event = gtk.EventBox() self.wizard_logo = gtk.Image() self.wizard_event.add(self.wizard_logo) self.d = {} for c in (65, 97): for i in range(26): self.d[chr(i + c)] = chr((i + 13) % 26 + c) self.img = 1 command_hbox = HIGHBox() self.command_label = HIGEntryLabel(_("Command")) self.command_entry = gtk.Entry() separator = gtk.HSeparator() self.wizard_header_hbox = HIGHBox() self.wizard_header_hbox._pack_expand_fill(self.wizard_title) self.wizard_header_hbox._pack_noexpand_nofill(self.wizard_event) command_hbox._pack_noexpand_nofill(self.command_label) command_hbox._pack_expand_fill(self.command_entry) self.main_vbox._pack_noexpand_nofill(self.wizard_header_hbox) self.main_vbox._pack_noexpand_nofill(command_hbox) self.main_vbox._pack_noexpand_nofill(separator) self.wizard_logo.set_from_file(logo)
def _create_widgets(self): self.vbox = HIGVBox() self.button_box = gtk.HButtonBox() self.submitted_label = HIGHintSectionLabel(_("Submitted by (optional)"), _("Enter your name and \ e-mail address if we can contact you with any questions. (kept private, \ used for nothing else)")) self.submitted_entry = gtk.Entry() self.target_device_label = HIGHintSectionLabel(_("Target OS/device info"), _("<b>The more details \ the better!</b> For UNIX machines, '<i>uname -a</i>' often gives the proper \ version number. On Linux, please also specify the distribution version (such as\ Redhat 9.0) if you are using a vendor-provided kernel. For Windows, the \ '<i>winver</i>' command (if available) should show you any service pack \ information. If a Windows target has no service packs installed, \ please say so explicitly. For appliances/embedded devices, please mention \ the model number and what it is (printer, webcam, DSL router, VOIP phone, \ etc). Try to provide the architecture (X86, SPARC, etc.) where appropriate.")) self.target_device_entry = gtk.Entry() self.classification_label = HIGHintSectionLabel(_("Classification"), _("Please select \ the Device/OS info from this alphabetized choosebox")) self.classification_list = gtk.ListStore(str, str) self.classification_combo = gtk.ComboBoxEntry(self.classification_list, 0) self.notes_label = HIGHintSectionLabel(_("Notes"), _("Fill with further info on \ the device, any special network conditions, etc.")) self.notes_scrolled = gtk.ScrolledWindow() self.notes_text = gtk.TextView() self.fingerprint_icon = gtk.Image() self.fingerprint_text = gtk.Label(_("This form allows you to \ contribute new operating system fingerprints to the Nmap database. Thanks for \ helping! <b>Please do not fill this out unless you are sure that you know \ what application is running on the machine you are submitting</b>. Incorrect \ entries can pollute the database. By submitting fingerprints you are \ transfering any copyright interest in the data to Fyodor so that he \ can modify it, relicense it, incorporate it into programs such as Nmap, etc.")) self.btn_ok = gtk.Button(stock=gtk.STOCK_OK) self.btn_cancel = gtk.Button(stock=gtk.STOCK_CANCEL) self.hbox = HIGHBox() self.table = HIGTable()
def __create_widgets(self): """""" #box self.main_vbox = HIGVBox() self.btn_box = gtk.HButtonBox() self.LogsGUI_vbox = HIGHBox() self.main_vbox.set_border_width(2) #close button self.close_button = gtk.Button(stock=gtk.STOCK_CLOSE) #log information box self.LogsGUI_hbox1 = HIGHBox() self.LogsGUI_hbox2 = HIGHBox() self.LogsGUI_subbox = LogsGUI()
class HIGExpander(gtk.Expander): def __init__(self, label): gtk.Expander.__init__(self) self.set_use_markup(True) self.set_label(label) self.hbox = HIGHBox() self.hbox.set_border_width(5) self.hbox._pack_noexpand_nofill(hig_box_space_holder()) self.add(self.hbox) def get_container(self): return self.hbox
def __create_widgets(self): na = _('Not available') self.command_expander = gtk.Expander("<b>"+_("Command Info")+"</b>") self.general_expander = gtk.Expander("<b>"+_("General Info")+"</b>") # Command info self.command_label = HIGEntryLabel(_('Command:')) self.info_command_label = HIGEntryLabel(na) self.nmap_version_label = HIGEntryLabel(_('Nmap Version:')) self.info_nmap_version_label = HIGEntryLabel(na) self.verbose_label = HIGEntryLabel(_('Verbosity level:')) self.info_verbose_label = HIGEntryLabel(na) self.debug_label = HIGEntryLabel(_('Debug level:')) self.info_debug_label = HIGEntryLabel(na) self.command_table = HIGTable() self.command_hbox = HIGHBox() # General info: self.start_label = HIGEntryLabel(_('Started on:')) self.info_start_label = HIGEntryLabel(na) self.finished_label = HIGEntryLabel(_('Finished on:')) self.info_finished_label = HIGEntryLabel(na) self.host_up_label = HIGEntryLabel(_('Hosts up:')) self.info_hosts_up_label = HIGEntryLabel(na) self.host_down_label = HIGEntryLabel(_('Hosts down:')) self.info_hosts_down_label = HIGEntryLabel(na) self.host_scanned_label = HIGEntryLabel(_('Hosts scanned:')) self.info_hosts_scanned_label = HIGEntryLabel(na) self.open_label = HIGEntryLabel(_('Open ports:')) self.info_open_label = HIGEntryLabel(na) self.filtered_label = HIGEntryLabel(_('Filtered ports:')) self.info_filtered_label = HIGEntryLabel(na) self.closed_label = HIGEntryLabel(_('Closed ports:')) self.info_closed_label = HIGEntryLabel(na) self.general_table = HIGTable() self.general_hbox = HIGHBox()
def __init__(self): """ Constructor """ HIGHBox.__init__(self) self.scroll = HIGScrolledWindow() self._box = HIGHBox() self._icons_list = [] self._tabstruct = TabStruct() self.__current = [0] self.__model = gtk.ListStore(str, gtk.gdk.Pixbuf) #self.__model = gtk.ListStore(str, HIGHBox) self.__pixmap_d = Path.pixmaps_dir self.__icon = gtk.IconView() self.__icon.set_model(self.__model) self.__icon.set_text_column(0) self.__icon.set_pixbuf_column(1) self.__icon.set_orientation(gtk.ORIENTATION_VERTICAL) self.__icon.set_selection_mode(gtk.SELECTION_SINGLE) # Change background color -- FIXME #self.__icon.set_name("icon tabs") #gtk.rc_parse_string( #""" #style "iconview" #{ #bg[PRELIGHT] = { 0.75, 3, 1 } #} #class 'GtkIconView' style 'iconview' #""") map = self.__icon.get_colormap() colour = map.alloc_color("#FFF9E9") # light red style = self.__icon.get_style().copy() style.base[gtk.STATE_NORMAL] = colour self.__icon.set_style(style) #self.cellpb = gtk.CellRendererPixbuf() #self.cellpb.set_property('cell-background', 'yellow') #self.__icon.pack_start(self.cellpb, False) #self.__icon.set_attributes(self.cellpb, pixbuf=0) self.pack_start(self.scroll, True, True) self.scroll.add(self.__icon)
def __create_widgets(self): self.vbox_main = HIGVBox() self.main_frame = HIGFrame("Profiles") #self.main_frame.set_shadow_type(gtk.SHADOW_ETCHED_OUT) self.align = gtk.Alignment(0.0, 0.0, 1.0, 1.0) self.align.set_padding(0,0,12,0) self.vbox = HIGVBox() self.profiles_sw = HIGScrolledWindow() #TreeView self.model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) #self.modelfilter = self.model.filter_new() self.profiles_tv = gtk.TreeView(self.model) renderer = gtk.CellRendererText() column = gtk.TreeViewColumn(_("Name"), renderer, text=0) self.profiles_tv.append_column(column) renderer_hint = gtk.CellRendererText() column_hint = gtk.TreeViewColumn(_("Hint"), renderer_hint, text=1) self.profiles_tv.append_column(column_hint) #self.profiles_tv.set_model(self.modelfilter) #Info self.hbox_info = HIGHBox() self.command_label = HIGEntryLabel('Command: ') self.command_entry = HIGTextEntry() self.command_entry.set_editable(False) #Buttons self.hbox_buttons = HIGHBox() self.wiz_button = HIGButton(title='Wizard', stock='gtk-convert') self.wiz_button.connect("clicked", self.new_wiz) self.edit_button = HIGButton(stock='gtk-edit') self.edit_button.connect("clicked", self.open_peditor) self.new_button = HIGButton(stock='gtk-new') self.new_button.connect("clicked", self.open_peditor) self.copy_button = HIGButton(stock='gtk-copy') self.copy_button.connect("clicked", self.copy_profiles) self.delete_button = HIGButton(stock=gtk.STOCK_DELETE) self.delete_button.connect('clicked', self.delete_profile) #Apply Buttons self.cancel_button = HIGButton(stock='gtk-close') self.cancel_button.connect("clicked", self.quit) self.connect("delete-event", self.quit)
def __init__(self): HIGHBox.__init__(self) self.entry = gtk.SpinButton(gtk.Adjustment(value=30, lower=0, upper=9999, step_incr=1), 1) self.time_list = gtk.ListStore(str) self.time_combo = gtk.ComboBoxEntry(self.time_list, 0) self.entry.set_width_chars(4) for i in SearchConfig().time_list: self.time_list.append([i]) self._pack_noexpand_nofill(self.entry) self._pack_expand_fill(self.time_combo)
def __create_widgets(self): self.vbox = HIGVBox() self.hbox = HIGHBox() self.img_logo = gtk.Image() self.event_img_logo = gtk.EventBox() self.img = 1 self.d = {} for c in (65, 97): for i in range(26): self.d[chr(i+c)] = chr((i+13) % 26 + c) self.lbl_program_version = gtk.Label("""\ <span size='30000' weight='heavy'>Umit %s</span>""" % VERSION) self.lbl_program_description = gtk.Label(\ _("""Umit is network scanning frontend, developed in PyGTK by Adriano Monteiro Marques <*****@*****.**> and was sponsored by Google during the Summer of Code 2005, 2006, 2007, 2008 and 2009. Thanks Google!""")) self.lbl_copyright=gtk.Label("<small>Copyright (C) 2005-2006 \ Insecure.Com LLC. and (C) 2007-2009 Adriano Monteiro Marques</small>") self.lbl_program_website = gtk.Label(\ "<span underline='single' \ foreground='blue'>http://www.umitproject.org</span>") self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE) self.btn_credits = HIGButton(_("Credits"))
def __init__(self): """ """ super(SaveDialog, self).__init__( title=_("Save Topology"), action=gtk.FILE_CHOOSER_ACTION_SAVE, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK), ) self.__combo = gtk.combo_box_new_text() types_list = TYPES.keys() types_list.sort() for i in types_list: self.__combo.append_text(i) self.__combo.set_active(1) self.__label = HIGLabel(_("Select the output type:")) self.__hbox = HIGHBox() self.__hbox._pack_noexpand_nofill(self.__label) self.__hbox._pack_expand_fill(self.__combo) self.set_extra_widget(self.__hbox) self.set_do_overwrite_confirmation(True) self.__hbox.show_all()
def __init__(self): HIGVBox.__init__(self) self.set_spacing(12) table = HIGTable() self.hbox = HIGHBox() self.description = HIGEntryLabel(_("""You wish to create a new profile,\ or just want to quickly create a command and run it once?""")) self.profile_radio = gtk.RadioButton(None, _('Profile')) self.command_radio = gtk.RadioButton(self.profile_radio, _('Command')) self.command_radio.connect('toggled', self.enable_target) self.profile_radio.connect('toggled', self.disable_target) self.target_label = HIGEntryLabel(_("Target")) self.target_entry = gtk.Entry() self.set_completion() self.hbox._pack_noexpand_nofill(hig_box_space_holder()) self.hbox._pack_noexpand_nofill(self.target_label) self.hbox._pack_expand_fill(self.target_entry) self.bar = ForwardBar() self._pack_noexpand_nofill(self.description) self._pack_expand_fill(table) self._pack_noexpand_nofill(self.bar) table.attach(self.profile_radio,0,1,0,1, yoptions=0) table.attach(self.command_radio,0,1,1,2, yoptions=0) table.attach(self.hbox,0,1,2,3, yoptions=0) self.disable_target()
def __init__(self): HIGHBox.__init__(self) self._create_profile() self.change_button = gtk.Button(_("Change")) self._pack_noexpand_nofill(self.profile_label) self._pack_expand_fill(self.profile_entry) self._pack_noexpand_nofill(self.change_button) self.profile_entry.set_focus_child(self.profile_entry.child) # Events self.profile_entry.child.connect('activate', lambda x: self.change_button.clicked())