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.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 __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 __do_layout(self, create_buttons): main_vbox = HIGVBox() # timeline frame tl_settings_align = gtk.Alignment(0.5, 0.5, 1, 1) tl_settings_align.set_padding(6, 0, 12, 0) tl_settings_vbox = HIGVBox() mode_hbox = HIGHBox() mode_hbox._pack_noexpand_nofill(self.tl_mode_lbl) mode_hbox._pack_expand_fill(self.tl_mode) kind_hbox = HIGHBox() kind_hbox._pack_noexpand_nofill(self.tl_kind_lbl) kind_hbox._pack_expand_fill(self.tl_kind) tl_settings_vbox._pack_noexpand_nofill(mode_hbox) tl_settings_vbox._pack_noexpand_nofill(kind_hbox) tl_settings_align.add(tl_settings_vbox) self.timeline.add(tl_settings_align) main_vbox._pack_noexpand_nofill(self.timeline) # end timeline frame # statusbar frame sbar_settings_align = gtk.Alignment(0.5, 0.5, 1, 1) sbar_settings_align.set_padding(6, 0, 12, 0) sbar_settings_vbox = HIGVBox() sbar_settings_vbox._pack_noexpand_nofill(self.sbar_tips) sbar_settings_align.add(sbar_settings_vbox) self.sbar.add(sbar_settings_align) main_vbox._pack_noexpand_nofill(self.sbar) # end statusbar frame # tabs frame tabs_settings_align = gtk.Alignment(0.5, 0.5, 1, 1) tabs_settings_align.set_padding(6, 0, 12, 0) tabs_settings_vbox = HIGVBox() tabs_settings_vbox._pack_noexpand_nofill(self.tabs_cbtn) tabs_settings_align.add(tabs_settings_vbox) self.tabs.add(tabs_settings_align) main_vbox._pack_noexpand_nofill(self.tabs) # end tabs frame if create_buttons: # buttons box btnsbox = HIGHBox() btnsbox._pack_noexpand_nofill(self.apply) btnsbox._pack_noexpand_nofill(self.cancel) btnsbox._pack_noexpand_nofill(self.ok) bbox = gtk.HBox() bbox.pack_end(btnsbox, False, False, 0) main_vbox.pack_end(bbox, False, False, 0) main_vbox.pack_end(gtk.HSeparator(), False, False, 0) # end buttons box return main_vbox
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 __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 __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): 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): 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 __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()
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 __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 __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 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 __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 __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_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 __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_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.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 __do_layout(self): """ Layout window widgets. """ main_vbox = HIGVBox() days_box = HIGHBox() btns_box = HIGHBox() days_box._pack_noexpand_nofill(self.data_lbl) days_box._pack_expand_fill(self.days) days_box._pack_noexpand_nofill(self.days_lbl) btns_box.pack_end(self.apply, False, False, 0) btns_box.pack_end(self.cancel, False, False, 0) main_vbox._pack_noexpand_nofill(days_box) main_vbox.pack_end(btns_box, False, False, 0) self.add(main_vbox)
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 _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 _create_widgets(self): self.main_vbox = HIGVBox() self.hbox_mode = HIGHBox() self.hbox_settings = HIGHBox() self.hbox_buttons = HIGHBox() self.hbox_result = HIGHBox() self.btn_open_browser = HIGButton(_("Open in Browser"), stock=gtk.STOCK_EXECUTE) self.btn_help = HIGButton(stock=gtk.STOCK_HELP) self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE) self.check_color = gtk.CheckButton(_("Enable colored diffies")) self.btn_legend = HIGButton(_("Color Descriptions"), stock=gtk.STOCK_SELECT_COLOR) self.text_mode = gtk.ToggleButton(_("Text Mode")) self.compare_mode = gtk.ToggleButton(_("Compare Mode")) self.vpaned = gtk.VPaned() self.hpaned = gtk.HPaned() self.scan_chooser1 = ScanChooser(self.scans, "1") self.scan_chooser2 = ScanChooser(self.scans, "2") self.scan_buffer1 = self.scan_chooser1.get_buffer() self.scan_buffer2 = self.scan_chooser2.get_buffer()
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 __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 __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)