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): 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 __do_layout(self): """ Layout widgets in window. """ main_vbox = HIGVBox() main_vbox.set_border_width(5) main_vbox.set_spacing(12) header_hbox = HIGHBox() schema_table = HIGTable() auth_table = HIGTable() btns_hbox = HIGHBox() header_hbox._pack_expand_fill(self.ttitle) header_hbox._pack_noexpand_nofill(self.umit_logo) # schema name schema_table.attach_label(self.schema_name_lbl, 0, 1, 0, 1) schema_table.attach_entry(self.schema_name, 1, 2, 0, 1) # smtp server schema_table.attach_label(self.smtp_server_lbl, 0, 1, 1, 2) schema_table.attach_entry(self.smtp_server, 1, 2, 1, 2) # smtp server port schema_table.attach_label(self.smtp_port_lbl, 0, 1, 2, 3) schema_table.attach_entry(self.smtp_port, 1, 2, 2, 3) # smtp mail from schema_table.attach_label(self.smtp_mailfrom_lbl, 0, 1, 3, 4) schema_table.attach_entry(self.smtp_mailfrom, 1, 2, 3, 4) # smtp user auth_table.attach_label(self.smtp_login_lbl, 0, 1, 0, 1) auth_table.attach_entry(self.smtp_login, 1, 2, 0, 1) # smtp passwd auth_table.attach_label(self.smtp_passwd_lbl, 0, 1, 1, 2) auth_table.attach_label(self.smtp_passwd, 1, 2, 1, 2) # bottom buttons btns_hbox.set_homogeneous(True) btns_hbox._pack_expand_fill(self.help) btns_hbox._pack_expand_fill(hig_box_space_holder()) btns_hbox._pack_expand_fill(self.apply) btns_hbox._pack_expand_fill(self.cancel) btns_hbox._pack_expand_fill(self.ok) main_vbox._pack_noexpand_nofill(header_hbox) main_vbox._pack_noexpand_nofill(gtk.HSeparator()) main_vbox._pack_noexpand_nofill(schema_table) main_vbox._pack_noexpand_nofill(gtk.HSeparator()) main_vbox._pack_noexpand_nofill(self.smtp_need_auth) main_vbox._pack_noexpand_nofill(auth_table) main_vbox._pack_noexpand_nofill(gtk.HSeparator()) main_vbox._pack_noexpand_nofill(self.smtp_encrypt_tls) main_vbox.pack_end(btns_hbox, False, False, 0) self.add(main_vbox)
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 __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 _create_widgets(self): # Ports view self.port_columns = {} self.port_list = gtk.ListStore(str, str, int, str, str, str, str) self.port_tree = gtk.TreeStore(str, str, int, str, str, str, str) self.port_view = gtk.TreeView(self.port_list) self.cell_icon = gtk.CellRendererPixbuf() self.cell_port = gtk.CellRendererText() self.port_columns['hostname'] = gtk.TreeViewColumn(_('Host')) self.port_columns['icon'] = gtk.TreeViewColumn('') self.port_columns['port_number'] = gtk.TreeViewColumn(_('Port')) self.port_columns['protocol'] = gtk.TreeViewColumn(_('Protocol')) self.port_columns['state'] = gtk.TreeViewColumn(_('State')) self.port_columns['service'] = gtk.TreeViewColumn(_('Service')) self.port_columns['version'] = gtk.TreeViewColumn(_('Version')) # Host services view self.host_columns = {} self.host_list = gtk.ListStore(str, str, str, int, str, str, str, str) self.host_tree = gtk.TreeStore(str, str, str, int, str, str, str, str) self.host_view = gtk.TreeView(self.host_list) self.cell_host_icon = gtk.CellRendererPixbuf() self.cell_host = gtk.CellRendererText() self.host_columns['service'] = gtk.TreeViewColumn(_('Service')) self.host_columns['hostname'] = gtk.TreeViewColumn(_('Hostname')) self.host_columns['icon'] = gtk.TreeViewColumn('') self.host_columns['protocol'] = gtk.TreeViewColumn(_('Protocol')) self.host_columns['port_number'] = gtk.TreeViewColumn(_('Port')) self.host_columns['state'] = gtk.TreeViewColumn(_('State')) self.host_columns['server'] = gtk.TreeViewColumn(_('Server product')) self.host_columns['version'] = gtk.TreeViewColumn(_('Version')) self.scroll_ports_hosts = gtk.ScrolledWindow() self.expander_sorting = gtk.Expander(_('Display Order / Grouping')) self.hbox_sort_group = HIGHBox() self.frame_sort = gtk.Frame() self.frame_group = gtk.Frame() self.table_sort = HIGTable() self.table_group = HIGTable() self.radio_sort_port = gtk.RadioButton(None, _('Sort by port number')) self.radio_sort_service = gtk.RadioButton(self.radio_sort_port,\ _('Sort by service name'))
def _create_tabs_widgets(self): # Tabs self._frame_tabs = HIGFrame(_('Tabs')) self._box_tabs = HIGVBox() self._radio_inside = gtk.RadioButton(None, _('Scans inside Umit')) self._radio_outside = gtk.RadioButton(self._radio_inside,\ _('Scans outside Umit')) # Toolbar: self._frame_toolbar = HIGFrame(_('Toolbar')) self._lbl_tlb_size = gtk.Label(_('Toolbar Size: ')) self._lbl_tlb_style = gtk.Label(_('Toolbar Style: ')) self._cmb_tlb_size = gtk.combo_box_new_text() self._cmb_tlb_size.append_text(_('Small')) self._cmb_tlb_size.append_text(_('Medium')) self._cmb_tlb_size.append_text(_('Larger')) self._cmb_tlb_size.append_text(_('System Default')) self._cmb_tlb_style = gtk.combo_box_new_text() self._cmb_tlb_style.append_text(_('Icons')) self._cmb_tlb_style.append_text(_('Text')) self._cmb_tlb_style.append_text(_('Both')) self._tbl_tlb = HIGTable()
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_tab(self, tab_name, section_name, tab): log.debug(">>> Tab name: %s" % tab_name) log.debug(">>>Creating profile editor section: %s" % section_name) vbox = HIGVBox() table = HIGTable() section = HIGSectionLabel(section_name) vbox._pack_noexpand_nofill(section) vbox._pack_noexpand_nofill(HIGSpacer(table)) vbox.set_border_width(6) tab.fill_table(table, True) self.scrollwindow = HIGScrolledWindow() self.scrollwindow.set_size_request(600, 300) vp = gtk.Viewport() vp.add(vbox) vp.set_shadow_type(gtk.SHADOW_NONE) self.scrollwindow.add(vp) vbox_tmp = HIGVBox() vbox_tmp.set_border_width(6) vbox_tmp.set_spacing(12) vbox_tmp.pack_start(self.scrollwindow) self.notebook.append_page(vbox_tmp, gtk.Label(tab_name))
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 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): #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 _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 __init__(self, section_name, profile, listoptions, notebook_parent, new=False): """ A Box Editable contains a options of each tab @param section_name: section name <tab> @type section_name: str @param profile: A class that view and modify xml file @type profile: ProfileCore @param listoptions: The List of Options to update XML (I guess to confirm) @type listoptions: ListOptions @param notebook_parent: Notebook @type notebook_parent: Notebook or Subclass @param new: It's a new tab or not @type new: bool """ HIGVBox.__init__(self) self._coords = {} self._parent = notebook_parent self._last = None #Profile Core do a manage at profile_editor.xml file self._profilecore = None self._profile = profile self._listoptions = listoptions self._table = HIGTable() self._section_name = section_name if not new: self._options = self._profile.get_section(section_name) self._table.set_border_width(3) c = self.get_colormap() color = c.alloc_color(0, 0, 0) self._table.modify_fg(gtk.STATE_NORMAL, color) #self._fill_table() box_tmp = HIGVBox() box_tmp.pack_start(self._table, False, False) self._sw = HIGScrolledWindow() #self._sw.set_size_request(400,200) vp = gtk.Viewport() vp.add(box_tmp) vp.set_shadow_type(gtk.SHADOW_NONE) self._sw.add(vp) self.pack_start(self._sw, True, True) self._old_selected = None self._x = 0 self._y = 0 self.connect('button-press-event', self._bp)
def __do_layout(self): """ Layout window widgets. """ main_vbox = HIGVBox() main_vbox.set_border_width(5) main_vbox.set_spacing(12) header_hbox = HIGHBox() schedp_hbox = HIGHBox() cron_box = HIGVBox() cron_table = HIGTable(5, 2) btns_hbox = HIGHBox() header_hbox._pack_expand_fill(self.ttitle) header_hbox._pack_noexpand_nofill(self.umit_logo) schedp_hbox._pack_noexpand_nofill(self.schedp_name_lbl) schedp_hbox._pack_expand_fill(self.schedp_name) # cron format settings_align = gtk.Alignment(0.5, 0.5, 1, 1) settings_align.set_padding(6, 0, 12, 0) cron_table.attach(self.cron_minute_lbl, 0, 1, 0, 1) cron_table.attach(self.cron_minute, 1, 2, 0, 1) cron_table.attach(self.cron_hour_lbl, 0, 1, 1, 2) cron_table.attach(self.cron_hour, 1, 2, 1, 2) cron_table.attach(self.cron_day_lbl, 0, 1, 2, 3) cron_table.attach(self.cron_day, 1, 2, 2, 3) cron_table.attach(self.cron_month_lbl, 0, 1, 3, 4) cron_table.attach(self.cron_month, 1, 2, 3, 4) cron_table.attach(self.cron_weekday_lbl, 0, 1, 4, 5) cron_table.attach(self.cron_weekday, 1, 2, 4, 5) cron_box._pack_noexpand_nofill(cron_table) settings_align.add(cron_box) self.cron_frame.add(settings_align) # bottom buttons btns_hbox.set_homogeneous(True) btns_hbox._pack_expand_fill(self.help) btns_hbox._pack_expand_fill(hig_box_space_holder()) btns_hbox._pack_expand_fill(self.apply) btns_hbox._pack_expand_fill(self.cancel) btns_hbox._pack_expand_fill(self.ok) main_vbox._pack_noexpand_nofill(header_hbox) main_vbox._pack_noexpand_nofill(gtk.HSeparator()) main_vbox._pack_noexpand_nofill(schedp_hbox) main_vbox._pack_noexpand_nofill(self.cron_frame) main_vbox.pack_end(btns_hbox, False, False, 0) self.add(main_vbox)
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 __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.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): """ Create widgets""" # Create table and attach it contains self.__table = HIGTable(5,2) binary_mask = gtk.EXPAND|gtk.SHRINK p = PreviewWindowObj() p.set_size_request(300,300) align = gtk.Alignment() align.add(p) align.set_padding(10,10,10,10) self.__table.attach(align, 0,1,0,1,binary_mask, gtk.FILL) self.pack_start(self.__table, False, False)
def _create_widgets(self): self.table = HIGTable() self.unchanged_button = gtk.ColorButton(self.colors.unchanged) self.unchanged_label = gtk.Label( _("Property remained <b>U</b>nchanged")) self.added_button = gtk.ColorButton(self.colors.added) self.added_label = gtk.Label(_("Property was <b>A</b>dded")) self.modified_button = gtk.ColorButton(self.colors.modified) self.modified_label = gtk.Label(_("Property was <b>M</b>odified")) self.not_present_button = gtk.ColorButton(self.colors.not_present) self.not_present_label = gtk.Label(_("Property is <b>N</b>ot present"))
def __pack_widgets(self): self.add(self.main_vbox) # Packing widgets to main_vbox self.main_vbox._pack_noexpand_nofill(self.command_expander) self.main_vbox._pack_expand_fill(self.notebook) self.main_vbox._pack_noexpand_nofill(self.buttons_hbox) # Packing command_entry on command_expander self.command_expander.hbox.pack_start(self.command_entry) # Packing profile information tab on notebook self.notebook.append_page(self.profile_info_vbox, gtk.Label(_('Profile'))) self.profile_info_vbox.set_border_width(5) table = HIGTable() self.profile_info_vbox._pack_noexpand_nofill(self.profile_info_label) self.profile_info_vbox._pack_noexpand_nofill(HIGSpacer(table)) self.profile_annotation_scroll.add(self.profile_annotation_text) self.profile_description_scroll.add(self.profile_description_text) vbox_desc = HIGVBox() vbox_desc._pack_noexpand_nofill(self.profile_description_label) vbox_desc._pack_expand_fill(hig_box_space_holder()) vbox_ann = HIGVBox() vbox_ann._pack_noexpand_nofill(self.profile_annotation_label) vbox_ann._pack_expand_fill(hig_box_space_holder()) table.attach(self.profile_name_label, 0, 1, 0, 1) table.attach(self.profile_name_entry, 1, 2, 0, 1) #table.attach(self.profile_hint_label,0,1,1,2,xoptions=0) table.attach(self.profile_hint_label, 0, 1, 1, 2) table.attach(self.profile_hint_entry, 1, 2, 1, 2) table.attach(vbox_desc, 0, 1, 2, 3) table.attach(self.profile_description_scroll, 1, 2, 2, 3) table.attach(vbox_ann, 0, 1, 3, 4) table.attach(self.profile_annotation_scroll, 1, 2, 3, 4) # Packing buttons on button_hbox self.buttons_hbox.pack_start(self.help_button) #self.buttons_hbox.pack_start(self.delete_button) self.buttons_hbox.pack_start(self.cancel_button) self.buttons_hbox.pack_start(self.ok_button) self.buttons_hbox.set_border_width(5) self.buttons_hbox.set_spacing(6)
def _create_widgets(self): self.username_label = HIGLabel(_("Username")) self.username_entry = gtk.Entry() self.password_label = HIGLabel(_("Password")) self.password_entry = HIGPasswordEntry() self.retype_password_label = HIGLabel(_("Retype password")) self.retype_password_entry = HIGPasswordEntry() self.registration_icon = gtk.Image() self.registration_text = gtk.Label( _("If you don't have an ICM account," "please register a new account.")) self.hbox = HIGHBox() self.table = HIGTable()
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 _create_widgets(self): self.category_label = HIGHintSectionLabel( _("Category (optional)"), _("If you know in which section of the program " "is the bug, please, select it from the choosebox. " "If you don't know what section to choose, leave it blank.")) self.category_list = gtk.ListStore(str, str) self.category_combo = gtk.ComboBoxEntry(self.category_list, 0) self.email_label = HIGHintSectionLabel( _("Email"), _("Please inform a valid e-mail address from " "where you can be reached to be notified when the bug gets " "fixed. Not used for other purposes.")) self.email_entry = gtk.Entry() self.summary_label = HIGHintSectionLabel( _("Summary"), _("This should be a quick description of the issue. " "Try to be clear and concise.")) self.summary_entry = gtk.Entry() self.description_label = HIGHintSectionLabel( _("Description"), _("This is where you should write about the bug, " "describing it as clear as possible and giving as many " "informations as you can and how to reproduce the bug.")) self.description_scrolled = gtk.ScrolledWindow() self.description_text = gtk.TextView() self.bug_icon = gtk.Image() self.bug_text = gtk.Label( _("This Bug Report dialog allows you " "to easily tell us about a problem that you may have found on " "Open Monitor. Doing so, you help us to help you, by fixing and " "improving Open Monitor faster than usual.")) if self.crashreport: # Create a button to show details self.show_details = HIGStockButton(gtk.STOCK_DIALOG_INFO, _("Show Details")) self.hbox = HIGHBox() self.table = HIGTable()
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_steps(self, step_name, back_step, next_step, step_description, content): vbox = HIGVBox() vbox.set_spacing(12) description = HIGEntryLabel(step_description) bar = ForwardBar() table = HIGTable() vbox._pack_noexpand_nofill(description) vbox._pack_expand_fill(table) vbox._pack_noexpand_nofill(bar) content.fill_table(table, False) bar.cancel.connect('clicked', self.close_wizard) bar.help.connect('clicked', self._show_help) bar.back.connect('clicked', self.switch_page, step_name, back_step) bar.forward.connect('clicked', self.switch_page, step_name, next_step) return vbox
def _create_widgets_error(self): # Create Widgets self._box_error_frame = HIGFrame('Error') self._box_error = HIGTable(5, 2) self._box_error.set_border_width(10) self._box_error_frame.add(self._box_error) self.__crash_report = gtk.CheckButton(_('Enable Crash Report')) # Radio Button List self.__log_no = gtk.RadioButton(None, _('No log')) self.__log_terminal = gtk.RadioButton(self.__log_no, _('Enable log in terminal')) self.__log_file = gtk.RadioButton(self.__log_terminal,\ _('Enable log file')) self.__log_file_label = HIGEntryLabel(_('Log file')) self.__log_file_entry = HIGTextEntry() self.__log_file_entry.set_editable(False) # FIXME: Do default file ~/.umit/umit.log self.__log_file_browser = HIGButton(_('Browse file'), \ gtk.STOCK_DIRECTORY) tmpbox = HIGHBox() tmpbox.pack_start(self.__log_file_entry, False, False) tmpbox.pack_start(self.__log_file_browser, False, False) # attach table self._box_error.attach(self.__crash_report, 0,1,0,1,\ gtk.FILL|gtk.EXPAND| gtk.SHRINK, gtk.FILL) self._box_error.attach(self.__log_no, 0,1,1,2,\ gtk.FILL|gtk.EXPAND| gtk.SHRINK, gtk.FILL) self._box_error.attach(self.__log_terminal, 0,1,2,3,\ gtk.FILL|gtk.EXPAND| gtk.SHRINK, gtk.FILL) self._box_error.attach(self.__log_file, 0,1,3,4,\ gtk.FILL|gtk.EXPAND| gtk.SHRINK, gtk.FILL) self._box_error.attach(self.__log_file_label, 0,1,4,5,\ gtk.FILL|gtk.EXPAND| gtk.SHRINK, gtk.FILL) self._box_error.attach(tmpbox, 1,2,4,5,\ gtk.FILL|gtk.EXPAND| gtk.SHRINK, gtk.FILL)
def _create_widgets_proxy(self): self.__frame = TabFrame(_("Proxy Settings")) self.__frame.set_shadow_type(gtk.SHADOW_NONE) self.__frame_box = HIGTable(6, 2, True) self._radio_no_proxy = gtk.RadioButton(None, _('No proxy server')) self._radio_proxy = gtk.RadioButton(self._radio_no_proxy, _('Configure server')) # Core Structure of data of proxy: fields = [] fields.append({ 'name': 'hostname', 'label': _('Hostname'), 'values': network_conf.hostname, 'entry': None }) fields.append({ 'name': 'port', 'label': _('Port'), 'values': network_conf.port, 'entry': None, 'type': 'spin' }) fields.append({ 'name': 'username', 'label': _('Username'), 'values': network_conf.username, 'entry': None }) fields.append({ 'name': 'password', 'label': _('Password'), 'values': network_conf.password, 'entry': None, 'type': 'password' }) self.__proxy_fields = fields # Create, attach and set values of widgets of proxy xopt = gtk.FILL | gtk.EXPAND | gtk.SHRINK yopt = gtk.FILL self.__frame_box.attach(self._radio_no_proxy, 0, 1, 0, 1, xopt, yopt) self.__frame_box.attach(self._radio_proxy, 0, 1, 1, 2) row = 2 # Create list of labels/entrys self.__label_list = [] self.__entry_list = [] for field in fields: # Create widgets label = gtk.Label(field['label']) if field.has_key('type') and field['type'] == 'spin': entry = IntSpin() else: entry = HIGTextEntry() # Add widgets to lists self.__label_list.append(label) self.__entry_list.append(entry) field['entry'] = entry # Customize label.set_alignment(1.0, 0.0) # Attachment Table self.__frame_box.attach(label, 0,1,row,row+1, \ xopt, yopt) self.__frame_box.attach(entry, 1, 2, row, row + 1) # Increment row row = row + 1 self.__frame.add(self.__frame_box)
def __create_widgets(self): self.suggestion_hbox = HIGHBox() self.report_hbox = HIGHBox() self.suggestion_section = HIGSectionLabel(_("Test Suggestion")) self.suggestion_table = HIGTable() self.report_section = HIGSectionLabel(_("Bug Report")) self.report_table = HIGTable() # Website Suggestion self.website_suggestion_table = HIGTable() self.website_suggestion_slabel = HIGSectionLabel( _("Website Suggestion")) self.website_url_subhbox = HIGHBox() self.website_url_label = HIGEntryLabel(_("URL:")) self.website_url_entry = gtk.Entry() self.website_suggestion_sendbtn = HIGButton(_('Send')) self.website_suggestion_sendbtn.set_size_request(60, 25) self.website_suggestion_sendbtn.connect( 'clicked', lambda x: self.send_website_suggestion()) # Service Suggestion self.service_suggestion_table = HIGTable() self.service_suggestion_slabel = HIGSectionLabel( _("Service Suggestion")) self.service_name_subhbox = HIGHBox() self.service_name_label = HIGEntryLabel(_("Name:")) self.service_list_store = gtk.ListStore(str) self.service_name_entry = gtk.ComboBoxEntry(self.service_list_store, 0) self.service_host_subhbox = HIGHBox() self.service_host_label = HIGEntryLabel(_("Hostname:")) self.service_host_entry = gtk.Entry() self.service_ip_subhbox = HIGHBox() self.service_ip_label = HIGEntryLabel(_("IP:")) self.service_ip_entry = gtk.Entry() self.service_port_label = HIGEntryLabel(_("PORT:")) self.service_port_entry = gtk.Entry() self.service_suggestion_sendbtn = HIGButton(_('Send')) self.service_suggestion_sendbtn.set_size_request(60, 25) self.service_suggestion_sendbtn.connect( 'clicked', lambda x: self.send_service_suggestion()) self.report_namelabel = HIGEntryLabel(_("Your Name:")) self.report_nameentry = gtk.Entry() #self.report_nameentry.set_has_frame(True) self.report_nameentry.set_size_request(100, 26) self.report_emaillabel = HIGEntryLabel(_("Email:")) self.report_emailentry = gtk.Entry() self.report_emailentry.set_size_request(198, 26) self.report_subhbox1 = HIGHBox() self.report_sw = gtk.ScrolledWindow() self.report_sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.report_textview = gtk.TextView() self.report_textbuffer = self.report_textview.get_buffer() self.report_textview.set_editable(True) self.report_textview.set_wrap_mode(True) self.report_textview.set_border_width(2) self.report_sw.add(self.report_textview) self.report_sw.show() self.report_textview.show() self.report_subhbox2 = HIGHBox() self.report_sendbtn = HIGButton(_('Send')) self.report_sendbtn.set_size_request(60, 25) self.report_sendbtn.connect('clicked', lambda x: self.send_bug_report()) self.report_subhbox3 = HIGHBox()
def _create_widgets(self): # Main widgets self.hpaned = gtk.HPaned() self.main_vbox = HIGVBox() # Results section self.result_section = HIGSectionLabel(_("Results")) self.result_vbox = HIGVBox() self.result_hbox = HIGHBox() self.result_list = gtk.ListStore(str, str, int) # title, date, id self.result_view = gtk.TreeView(self.result_list) self.result_scrolled = gtk.ScrolledWindow() self.result_title_column = gtk.TreeViewColumn(_("Scan")) self.result_date_column = gtk.TreeViewColumn(_("Date")) # Search notebook self.search_vbox = HIGVBox() self.search_notebook = gtk.Notebook() self.search_button = HIGButton(stock=gtk.STOCK_FIND) # General page self.general_vbox = HIGVBox() self.general_hbox = HIGHBox() #self.general_start_hbox = HIGHBox() #self.general_finish_hbox = HIGHBox() self.general_section = HIGSectionLabel(_("General search parameters")) self.general_table = HIGTable() self.general_option_label = HIGEntryLabel(_("Option")) self.general_profile_label = HIGEntryLabel(_("Profile")) #self.general_finished_label = HIGEntryLabel(_("Finished")) #self.general_started_label = HIGEntryLabel(_("Started")) self.general_keyword_label = HIGEntryLabel(_("Keyword")) self.general_keyword_entry = gtk.Entry() self.general_option_combo = OptionCombo() self.general_profile_combo = ProfileCombo() #self.general_started_range = DateRange() #self.general_finished_range = DateRange() # Host page self.host_vbox = HIGVBox() self.host_hbox = HIGHBox() #self.host_uptime_hbox = HIGHBox() #self.host_lastboot_hbox = HIGHBox() self.host_section = HIGSectionLabel(_("Host search parameters")) self.host_table = HIGTable() self.host_target_label = HIGEntryLabel(_("Target")) self.host_mac_label = HIGEntryLabel(_("MAC")) self.host_ipv4_label = HIGEntryLabel(_("IPv4")) self.host_ipv6_label = HIGEntryLabel(_("IPv6")) #self.host_uptime_label = HIGEntryLabel(_("Uptime")) #self.host_lastboot_label = HIGEntryLabel(_("Last boot")) self.host_target_combo = TargetCombo() self.host_mac_entry = gtk.Entry() self.host_ipv4_entry = gtk.Entry() self.host_ipv6_entry = gtk.Entry() #self.host_uptime_range = DateRange() #self.host_lastboot_range = DateRange() # Service self.serv_vbox = HIGVBox() self.serv_hbox = HIGHBox() self.serv_section = HIGSectionLabel(_("Service search parameters")) self.serv_table = HIGTable() self.serv_port_label = HIGEntryLabel(_("Port number")) self.serv_service_label = HIGEntryLabel(_("Service")) self.serv_product_label = HIGEntryLabel(_("Product")) self.serv_portstate_label = HIGEntryLabel(_("Port state")) self.serv_port_entry = gtk.Entry() self.serv_service_combo = ServiceCombo() self.serv_product_entry = gtk.Entry() self.serv_portstate_check = PortState() # OS self.os_vbox = HIGVBox() self.os_hbox = HIGHBox() self.os_section = HIGSectionLabel(_("Operating System search \ parameters")) self.os_table = HIGTable() self.os_osclass_label = HIGEntryLabel(_("OS class")) self.os_osmatch_label = HIGEntryLabel(_("OS match")) self.os_osclass_combo = OSClassCombo() self.os_osmatch_combo = OSMatchCombo() # Search options page 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"))