def set_hostnames(self, hostname): if hostname: self.hostnames_expander.set_use_markup(True) self.hostnames_expander.set_expanded(True) table, hbox = self.create_table_hbox() y1 = 1 y2 = 2 for h in hostname: name = na try: name = h['hostname'] except: pass type = na try: type = h['hostname_type'] except: pass table.attach(HIGEntryLabel(_('Name - Type:')), 0, 1, y1, y2) table.attach(HIGEntryLabel(name+' - '+\ type),1,2,y1,y2) y1 += 1 y2 += 1 self.hostnames_expander.add(hbox) self._pack_noexpand_nofill(self.hostnames_expander)
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_and_attach_widgets(self): self.option_label = HIGSectionLabel('New Option') self.attach(self.option_label, 0, 3, 0, 1) self.name_label = HIGEntryLabel(_('Name:')) self.name_entry = HIGTextEntry() self.attach(self.name_label, 0, 1, 1, 2) self.attach(self.name_entry, 1, 3, 1, 2) self.hint_label = HIGEntryLabel(_('Hint:')) self.hint_entry = HIGTextEntry() self.attach(self.hint_label, 0, 1, 2, 3) self.attach(self.hint_entry, 1, 3, 2, 3) self.need_root = gtk.CheckButton(_('Need root')) self.attach(self.need_root, 0, 1, 3, 4) self.options_label = HIGEntryLabel(_('Options:')) hbox = HIGHBox() self.options_entry = HIGTextEntry() self.insert_arg_button = HIGButton(title='Args', stock='gtk-add') self.insert_arg_button.connect('clicked', self.update_args) self.attach(self.options_label, 0, 1, 4, 5) self.attach(self.options_entry, 1, 2, 4, 5) self.attach(self.insert_arg_button, 2, 3, 4, 5) self.aguments_label = HIGEntryLabel(_('Arguments:')) self.arguments_entry = HIGTextEntry() self.arguments_entry.set_editable(False) self.attach(self.aguments_label, 0, 1, 5, 6) self.attach(self.arguments_entry, 1, 3, 5, 6)
def _create_widgets(self): """ Create widgets""" self._frm_option = HIGFrame(_('Options')) self._box_option = HIGHBox() self.__lbl_file_opt = HIGEntryLabel(_('File:')) self.__entry_file_opt = HIGTextEntry() self.__entry_file_opt.set_editable(False) self.__file_browser_opt = HIGButton(_('Browse file'), \ gtk.STOCK_DIRECTORY) self._frm_profile = HIGFrame(_('Profile')) self._box_profile = HIGHBox() self.__lbl_file_profile = HIGEntryLabel(_('File:')) self.__entry_file_profile = HIGTextEntry() self.__entry_file_profile.set_editable(False) self.__file_browser_profile = HIGButton(_('Browse file'), \ gtk.STOCK_DIRECTORY) self._frm_wizard = HIGFrame(_('Wizard')) self._box_wizard = HIGHBox() self.__lbl_file_wizard = HIGEntryLabel(_('File:')) self.__entry_file_wizard = HIGTextEntry() self.__entry_file_wizard.set_editable(False) self.__file_browser_wizard = HIGButton(_('Browse file'), \ gtk.STOCK_DIRECTORY) self.__btn_restore = HIGButton(_('Restore Defaults'), gtk.STOCK_CLEAR)
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 __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_ports_used(self, ports=None): # Removing old childs child = self.portsused_expander.get_child() if child is not None: self.portsused_expander.remove(child) if ports is None: self.portsused_expander.set_sensitive(False) return else: self.portsused_expander.set_sensitive(True) self.portsused_expander.set_use_markup(True) table, hbox = self.create_table_hbox() y1 = 0 y2 = 1 for p in ports: table.attach(HIGEntryLabel(_('Port-Protocol-State:')), 0, 1, y1, y2) table.attach(HIGEntryLabel(p['portid']+' - '+p['proto']+' - '+\ p['state']), 1, 2, y1, y2) y1 += 1 y2 += 1 self.portsused_expander.add(hbox)
def __create_widgets(self): """""" self.peerinfo_hbox = HIGHBox() self.cloudagg_hbox = HIGHBox() self.superpeers_hbox = HIGHBox() self.pref_location_hbox = HIGHBox() self.peerinfo_section = HIGSectionLabel(_("Peer Info")) self.peerinfo_table = HIGTable() self.pref_location_section = HIGSectionLabel(_("Preferred Locations")) self.pref_location_table = HIGTable() self.cloudagg_section = HIGSectionLabel(_("Cloud Aggregator")) self.cloudagg_table = HIGTable() self.cloudagg_subhbox = HIGHBox() self.superpeers_section = HIGSectionLabel(_("Super Peers")) self.superpeers_table = HIGTable() self.peerid_label = HIGEntryLabel(_("Peer ID:")) self.email_label = HIGEntryLabel(_("Email Address:")) self.test_version_label = HIGEntryLabel(_("Test Sets Version:")) self.peerid_label2 = HIGEntryLabel() self.email_entry = gtk.Entry() self.test_version_label2 = HIGEntryLabel() self.longitude_label = HIGLabel(_("longitude:")) self.longitude_entry = gtk.Entry() self.latitude_label = HIGLabel(_("latitude:")) self.latitude_entry = gtk.Entry() self.cloudagg_entry = gtk.Entry() self.cloudagg_button = HIGButton(_("Reset")) self.cloudagg_button.connect('clicked', lambda w: self.reset_aggregator_url()) self.cloudagg_button.set_size_request(80, 28) self.superpeers_ip_label = HIGLabel(_("IP:")) self.superpeers_ip_entry = gtk.Entry() self.superpeers_ip_entry.set_size_request(160, 26) self.superpeers_port_label = HIGLabel(_("Port:")) self.superpeers_port_entry = gtk.Entry() self.superpeers_port_entry.set_size_request(80, 26) self.superpeers_subhbox = HIGHBox() self.btn_box = gtk.HButtonBox() self.superpeers_button1 = HIGButton(_("Add")) self.superpeers_button1.connect('clicked', lambda w: self.add_superpeer()) self.superpeers_button2 = HIGButton(_("Show all")) self.superpeers_button2.connect( 'clicked', lambda w: self.show_super_peer_list_window())
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): ''' Create the main entrys of the option ''' self._box = HIGVBox() self._table = HIGTable() #Name self._label_name = HIGEntryLabel(_('Name')) self._entry_name = HIGTextEntry() self._entry_name.connect('activate', self._update_label) #Type self._label_type = HIGEntryLabel(_('Type')) self._combo_type = gtk.combo_box_new_text() self._combo_type.append_text('') self._combo_type.append_text('Option List') self._combo_type.append_text('Option Check') self._combo_type.set_active(0) self._combo_type.connect('changed', self.change_combo) self._label_opt = HIGEntryLabel(_('Option')) self._entry_opt = HIGTextEntry() self._entry_opt.set_sensitive(False) #For option list open a dialog to add/remove options self._button_list = HIGButton('Edit Option List') img = gtk.Image() img_dir = os.path.join(pixmaps_dir, 'uie', 'combo.png') img.set_from_file(img_dir) self._button_list.set_image(img) self._button_list.connect('button-press-event', self._button_list_clicked) self._table.attach(self._label_name, 0, 1, 0, 1) self._table.attach(self._entry_name, 1, 2, 0, 1) self._table.attach(self._label_type, 0, 1, 1, 2) self._table.attach(self._combo_type, 1, 2, 1, 2) self._table.attach(self._button_list, 0, 2, 3, 4) self._table.attach(self._label_opt, 0, 1, 4, 5) self._table.attach(self._entry_opt, 1, 2, 4, 5) self._box.pack_start(self._table, False, False)
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 set_tcptsseq(self, tcptsseq): if tcptsseq: self.tcpts_expander.set_use_markup(True) table, hbox = self.create_table_hbox() combo = gtk.combo_box_new_text() for i in tcptsseq.get('values', '').split(','): combo.append_text(i) table.attach(HIGEntryLabel(_('Class:')), 0, 1, 0, 1) table.attach(HIGEntryLabel(tcptsseq['class']), 1, 2, 0, 1) table.attach(HIGEntryLabel(_('Values:')), 0, 1, 1, 2) table.attach(combo, 1, 2, 1, 2) self.tcpts_expander.add(hbox) self._pack_noexpand_nofill(self.tcpts_expander)
def __init__(self): HIGWindow.__init__(self) self.wtitle = _("SMTP Account Editor") # header self.title_markup = "<span size='16500' weight='heavy'>%s</span>" self.ttitle = HIGEntryLabel("") self.ttitle.set_line_wrap(False) self.ttitle.set_markup(self.title_markup % self.wtitle) self.umit_logo = gtk.Image() self.umit_logo.set_from_file(logo) # schemas name self.schema_name_lbl = HIGEntryLabel(_("Schema name")) self.schema_name = gtk.combo_box_entry_new_text() self.schema_name.connect('changed', self._check_schema) # smtp server self.smtp_server_lbl = HIGEntryLabel(_("Server")) self.smtp_server = gtk.Entry() self.smtp_port_lbl = HIGEntryLabel(_("Port")) self.smtp_port = gtk.Entry() # sending mail.. self.smtp_mailfrom_lbl = HIGEntryLabel(_("Mail from")) self.smtp_mailfrom = gtk.Entry() # smtp auth self.smtp_need_auth = gtk.CheckButton( _("Servers requires authentication")) self.smtp_need_auth.connect('toggled', self._auth_need) self.smtp_login_lbl = HIGEntryLabel(_("Username")) self.smtp_login = gtk.Entry() self.smtp_passwd_lbl = HIGEntryLabel(_("Password")) self.smtp_passwd = gtk.Entry() self.smtp_passwd.set_visibility(False) self._auth_need(None) # smtp encryption self.smtp_encrypt_tls = gtk.CheckButton(_("Use TLS Encryption")) """ Missing: SSL encryption, Other authentication methods. """ # bottom buttons self.help = HIGButton(stock=gtk.STOCK_HELP) self.help.connect('clicked', self._show_help) self.apply = HIGButton(stock=gtk.STOCK_APPLY) self.apply.connect('clicked', self._save_schema) self.cancel = HIGButton(stock=gtk.STOCK_CANCEL) self.cancel.connect('clicked', self._exit) self.ok = HIGButton(stock=gtk.STOCK_OK) self.ok.connect('clicked', self._save_schema_and_leave) self.load_schemas() self.__set_props() self.__do_layout() self.connect('destroy', self._exit)
def __init__(self): HIGVBox.__init__(self) self.set_spacing(12) self.prof = False self.description = HIGEntryLabel( _("""Please, enter the profile name, \ and optionally, enter a hint, description and annotation for this \ new profile""")) self.profile_label = HIGEntryLabel(_("Profile name")) self.hint_label = HIGEntryLabel(_("Hint")) self.description_label = HIGEntryLabel(_("Description")) self.annotation_label = HIGEntryLabel(_("Annotation")) self.profile_entry = gtk.Entry() self.hint_entry = gtk.Entry() self.description_scroll = HIGScrolledWindow() self.description_text = HIGTextView() self.annotation_scroll = HIGScrolledWindow() self.annotation_text = HIGTextView() self.description_scroll.add(self.description_text) self.annotation_scroll.add(self.annotation_text) table = HIGTable() self.bar = ForwardBar() self._pack_noexpand_nofill(self.description) self._pack_expand_fill(table) self._pack_noexpand_nofill(self.bar) table.attach(self.profile_label, 0, 1, 0, 1, xoptions=0) table.attach(self.profile_entry, 1, 2, 0, 1) table.attach(self.hint_label, 0, 1, 1, 2, xoptions=0) table.attach(self.hint_entry, 1, 2, 1, 2) table.attach(self.description_label, 0, 1, 2, 3, xoptions=0) table.attach(self.description_scroll, 1, 2, 2, 3) table.attach(self.annotation_label, 0, 1, 3, 4, xoptions=0) table.attach(self.annotation_scroll, 1, 2, 3, 4)
def _create_tooldesign(self): ''' create tooldesign that contains widgets to put in work area of edit profile ''' if self._tooldesign == None : self._tooldesign = ToolDesign() if self._proprieties == None : self._proprieties = Proprieties() if self.notebook.get_n_pages() < 2: self.notebook.append_page(self._tooldesign, HIGEntryLabel(_('Design'))) self.notebook.append_page(self._proprieties, HIGEntryLabel(_('Proprieties'))) self.notebook.show_all() obj = self.profile_box obj.set_proprieties(self._proprieties) profilecore = obj.get_profilecore() self._proprieties.set_profilecore(profilecore)
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 quit(self, widget=None, extra=None): if self.deleted: dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) alert = HIGEntryLabel('<b>' + _("Deleting Profile") + '</b>') text = HIGEntryLabel( _('Your profile is going to be deleted! Click\ Ok to continue, or Cancel to go back to Profile Editor.' )) hbox = HIGHBox() hbox.set_border_width(5) hbox.set_spacing(12) vbox = HIGVBox() vbox.set_border_width(5) vbox.set_spacing(12) image = gtk.Image() image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG) vbox.pack_start(alert) vbox.pack_start(text) hbox.pack_start(image) hbox.pack_start(vbox) dialog.vbox.pack_start(hbox) dialog.vbox.show_all() response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_CANCEL: return None self.destroy() if self.scan_notebook != None: for i in xrange(self.scan_notebook.get_n_pages()): page = self.scan_notebook.get_nth_page(i) page.toolbar.profile_entry.update()
def __create_widgets(self): self.main_vbox = HIGVBox() self.command_expander = HIGExpander('<b>' + _('Command') + '</b>') self.command_expander.set_expanded(True) self.command_entry = gtk.Entry() self.notebook = gtk.Notebook() # Profile info page self.profile_info_vbox = HIGVBox() self.profile_info_label = HIGSectionLabel(_('Profile Information')) self.profile_name_label = HIGEntryLabel(_('Profile name')) self.profile_name_entry = gtk.Entry() self.profile_hint_label = HIGEntryLabel(_('Hint')) self.profile_hint_entry = gtk.Entry() self.profile_description_label = HIGEntryLabel(_('Description')) #self.profile_description_label = HIGHBox() self.profile_description_scroll = HIGScrolledWindow() self.profile_description_text = HIGTextView() self.profile_annotation_label = HIGEntryLabel(_('Annotation')) #self.profile_annotation_label = HIGHBox() self.profile_annotation_scroll = HIGScrolledWindow() self.profile_annotation_text = HIGTextView() # Buttons self.buttons_hbox = HIGHBox() self.help_button = HIGButton(stock=gtk.STOCK_HELP) self.help_button.connect('clicked', self.help) #self.delete_button = HIGButton(stock=gtk.STOCK_DELETE) #self.delete_button.connect('clicked', self.delete_profile) self.cancel_button = HIGButton(stock=gtk.STOCK_CANCEL) self.cancel_button.connect('clicked', self.quit_without_saving) self.ok_button = HIGButton(stock=gtk.STOCK_OK) self.ok_button.connect('clicked', self.save_profile)
def __create_widgets(self): """""" self.timer_hbox = HIGHBox() self.timer_section = HIGSectionLabel(_("Timeout Setting (seconds)")) self.timer_table = HIGTable() self.other_hbox = HIGHBox() self.other_section = HIGSectionLabel(_("Others")) self.other_table = HIGTable() self.task_assign_label = HIGEntryLabel(_("Task Assign")) self.task_scheduler_label = HIGEntryLabel(_("Task Scheduler")) self.report_uploader_label = HIGEntryLabel(_("Report Uploader")) self.test_fetch_label = HIGEntryLabel(_("Test sets Fetch")) self.task_assign_entry = gtk.Entry() self.task_scheduler_entry = gtk.Entry() self.report_uploader_entry = gtk.Entry() self.test_fetch_entry = gtk.Entry() self.language_label = HIGEntryLabel(_("Language")) self.language_store = gtk.ListStore(str) self.language_entry = gtk.ComboBoxEntry(self.language_store, 0)
def _create_widgets(self): self.opt_vbox = HIGVBox() self.opt_local_hbox = HIGHBox() self.opt_base_hbox = HIGHBox() self.opt_local_section = HIGSectionLabel(_("Local files")) self.opt_local_table = HIGTable() self.opt_base_section = HIGSectionLabel(_("Database")) self.opt_base_table = HIGTable() self.opt_path_label = HIGEntryLabel(_("Directory")) self.opt_extension_label = HIGEntryLabel(_("File extension")) self.opt_savetime_label = HIGEntryLabel(_("Save results for")) self.opt_path_entry = PathEntry() self.opt_extension_entry = gtk.Entry() self.opt_savetime_entry = SaveTime() self.opt_save_check = gtk.CheckButton( _("Save scan results in data \ base for latter search")) self.opt_search_check = gtk.CheckButton( _("Search saved scan results \ in data base"))
def __init__(self): HIGVBox.__init__(self) self.set_spacing(12) self.description = HIGEntryLabel( _("""Umit generated the nmap command. \ Click Apply to finish this wizard.""")) spacer = hig_box_space_holder() self.bar = ApplyBar() self._pack_noexpand_nofill(self.description) self._pack_expand_fill(spacer) self._pack_noexpand_nofill(self.bar)
def on_delete(self, widget=None): if not self.profile_name: return self.on_cancel() dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) alert = HIGEntryLabel('<b>' + _("Deleting Profile") + '</b>') text = HIGEntryLabel( _('Your profile is going to be deleted! Click \ Ok to continue, or Cancel to go back to Profile Editor.')) hbox = HIGHBox() hbox.set_border_width(5) hbox.set_spacing(12) vbox = HIGVBox() vbox.set_border_width(5) vbox.set_spacing(12) image = gtk.Image() image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG) vbox.pack_start(alert) vbox.pack_start(text) hbox.pack_start(image) hbox.pack_start(vbox) dialog.vbox.pack_start(hbox) dialog.vbox.show_all() response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_CANCEL: return None self.deleted = True self.profile.remove_profile(self.profile_name) self.on_cancel()
def _create_widgets_common(self): """ generally tab """ self._box_common = HIGVBox() # pack main section self.__check_splash = gtk.CheckButton(_('Enable Splash on start')) self.__check_silent_root = gtk.CheckButton(\ _('Silent Warning Non-Root')) self.__check_warning_extensions = gtk.CheckButton(\ _('Set/Check extensions - Windows only')) self._box_common.pack_start(self.__check_splash, False, False) #self._box_common.pack_start(self.__check_warning_extensions, False, \ # False) self._box_common.pack_start(self.__check_silent_root, False, False) self.__label_nmap = HIGEntryLabel(_('Nmap Command')) self.__entry_nmap = HIGTextEntry() # Files usr saved on predefined directory: self.__label_path = HIGEntryLabel(_('Nmap Command')) self.__entry_path = HIGTextEntry() self.__button_path = HIGButton(_('Choose')) self.__box_path = HIGHBox() self.__box_path.pack_start(self.__label_path, False, False) self.__box_path.pack_end(self.__button_path, False, False) self._box_common.set_border_width(0)
def __parse_option_list(self, option_list, options_used): options = option_list.getElementsByTagName(u'option') label = HIGEntryLabel(option_list.getAttribute(u'label')) opt_list = OptionList() for opt in options: opt_list.append(self.options.get_option(opt.getAttribute(u'name'))) for i, row in enumerate(opt_list.list): if row[0] in options_used: opt_list.set_active(i) return label, opt_list
def dialog_args(self): ''' Create a dialog ''' d = HIGDialog(_('Arguments')) description_label = HIGEntryLabel( _('Insert the description to argument:')) description_label.show() description_entry = HIGTextEntry() text = self.arguments_entry.get_text() description_entry.set_text(text) description_entry.show() combo_box = gtk.combo_box_new_text() combo_box.set_wrap_width(1) index = -1 j = 0 for i in ARG_TYPES: combo_box.append_text(ARG_TYPES[i]) if i == self.arg_type: index = j j = j + 1 if index > -1: combo_box.set_active(index) combo_box.show() d.vbox.pack_start(description_label, False, False) d.vbox.pack_start(description_entry, False, False) d.vbox.pack_start(combo_box, False, False) d.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) d.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) resp = d.run() result = None, None if resp == gtk.RESPONSE_OK: model = combo_box.get_model() active = combo_box.get_active() if active < 0: return None, None combo_selected = model[active][0] for i in ARG_TYPES: if combo_selected == ARG_TYPES[i]: combo_selected = i result = description_entry.get_text(), combo_selected #self.insert_arg_button.set_label('Edit args') #self.insert_arg_button. d.destroy() return result
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, connector, tlbase): gtk.HBox.__init__(self) self.connector = connector self.tlbase = tlbase self.connector.connect('date-changed', self._update_current_date) # viewing by cur_mode = view_mode_descr[self.tlbase.graph_mode] self.dateselect_lbl = HIGEntryLabel(cur_mode) values = self.tlbase.bounds_by_graphmode() self.dateselect = gtk.SpinButton(gtk.Adjustment(value=values[2], lower=values[0], upper=values[1], step_incr=1), 1) self.dateselect_apply = HIGButton(stock=gtk.STOCK_APPLY) self.dateselect_apply.connect("clicked", self._date_change) self.__layout()
def set_osclass(self, osclass=None): child = self.osclass_expander.get_child() if child is not None: self.osclass_expander.remove(child) if osclass is None: self.osclass_expander.set_sensitive(False) return else: self.osclass_expander.set_sensitive(True) self.osclass_expander.set_use_markup(True) table, hbox = self.create_table_hbox() table.attach(HIGEntryLabel(_('Type')), 0, 1, 0, 1) table.attach(HIGEntryLabel(_('Vendor')), 1, 2, 0, 1) table.attach(HIGEntryLabel(_('OS Family')), 2, 3, 0, 1) table.attach(HIGEntryLabel(_('OS Generation')), 3, 4, 0, 1) table.attach(HIGEntryLabel(_('Accuracy')), 4, 5, 0, 1) y1 = 1 y2 = 2 for o in osclass: table.attach(HIGEntryLabel(o['type']), 0, 1, y1, y2) table.attach(HIGEntryLabel(o['vendor']), 1, 2, y1, y2) table.attach(HIGEntryLabel(o['osfamily']), 2, 3, y1, y2) table.attach(HIGEntryLabel(o.get('osgen', '')), 3, 4, y1, y2) progress = gtk.ProgressBar() progress.set_text(o['accuracy'] + '%') progress.set_fraction(float(o['accuracy']) / 100.0) table.attach(progress, 4, 5, y1, y2) y1 += 1 y2 += 1 self.osclass_expander.add(hbox)
def __init__(self): HIGVBox.__init__(self) self.set_spacing(12) sec_vbox = HIGVBox() self.description = HIGEntryLabel( _("""Umit allow user to construct \ powerful commands in two distinct ways:""")) self.novice_radio = gtk.RadioButton(None, _('Novice')) self.expert_radio = gtk.RadioButton(self.novice_radio, _('Expert')) self.bar = ForwardBar(back=False) self._pack_noexpand_nofill(self.description) self._pack_expand_fill(sec_vbox) self._pack_noexpand_nofill(self.bar) sec_vbox._pack_noexpand_nofill(self.novice_radio) sec_vbox._pack_noexpand_nofill(self.expert_radio)
def __init__(self, daddy, profile=None): HIGWindow.__init__(self) self.daddy = daddy self.wtitle = _("Scheduling Profiles Editor") self.start_profile = profile # header self.title_markup = "<span size='16500' weight='heavy'>%s</span>" self.ttitle = HIGEntryLabel("") self.ttitle.set_line_wrap(False) self.ttitle.set_markup(self.title_markup % self.wtitle) self.umit_logo = gtk.Image() self.umit_logo.set_from_file(logo) # profiles name self.schedp_name_lbl = HIGEntryLabel(_("Scheduling Profile")) self.schedp_name = gtk.combo_box_entry_new_text() self.schedp_name.connect('changed', self._check_profile) # cron format self.cron_frame = HIGFrame(_("Schedule")) self.cron_minute_lbl = HIGEntryLabel(_("Minute")) self.cron_minute = gtk.Entry() self.cron_hour_lbl = HIGEntryLabel(_("Hour")) self.cron_hour = gtk.Entry() self.cron_day_lbl = HIGEntryLabel(_("Day of month")) self.cron_day = gtk.Entry() self.cron_month_lbl = HIGEntryLabel(_("Month")) self.cron_month = gtk.Entry() self.cron_weekday_lbl = HIGEntryLabel(_("Weekday")) self.cron_weekday = gtk.Entry() # bottom buttons self.help = HIGButton(stock=gtk.STOCK_HELP) self.help.connect('clicked', self._show_help) self.apply = HIGButton(stock=gtk.STOCK_APPLY) self.apply.connect('clicked', self._save_profile) self.cancel = HIGButton(stock=gtk.STOCK_CANCEL) self.cancel.connect('clicked', self._exit) self.ok = HIGButton(stock=gtk.STOCK_OK) self.ok.connect('clicked', self._save_profile_and_leave) self.load_profiles() self.__set_props() self.__do_layout() self.connect('destroy', self._exit)