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 __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.left_box = HIGVBox()
        self.right_box = HIGVBox()

        ##########
        #Grade Box
        self.grade_box = HIGVBox()
        self.grade_title = gtk.Label(
            "<span size='18000' weight='heavy'>Communication Grade</span>")
        self.grade_title.set_use_markup(True)
        self.grade_title.set_selectable(False)
        self.mark_box = gtk.HBox()
        self.mark_image = [None] * 5
        for i in range(0, 5):
            self.mark_image[i] = gtk.Image()
            self.mark_image[i].set_from_file(
                os.path.join(IMAGES_DIR, 'emptymark.png'))
            self.mark_box.pack_start(self.mark_image[i])

        #############
        #Website Test
        self.webtest_box = HIGVBox()
        self.webtest_title = gtk.Label(
            "<span size='18000' weight='heavy'>Website Test</span>")
        self.webtest_title.set_use_markup(True)
        self.webtest_title.set_selectable(False)

        status_str = "--"
        speed_str = "--"
        throtthled_str = "--"
        self.webtest_status_label = gtk.Label(
            "<span size='12500' weight='heavy'>Web Status: %s</span>" %
            (status_str))
        self.webtest_speed_label = gtk.Label(
            "<span size='12500' weight='heavy'>Network Speed: %s</span>" %
            (speed_str))
        self.webtest_throttled_label = gtk.Label(
            "<span size='12500' weight='heavy'>Throttled Status: %s</span>" %
            (throtthled_str))
        self.webtest_status_label.set_use_markup(True)
        self.webtest_status_label.set_selectable(False)
        self.webtest_speed_label.set_use_markup(True)
        self.webtest_speed_label.set_selectable(False)
        self.webtest_throttled_label.set_use_markup(True)
        self.webtest_throttled_label.set_selectable(False)
        ############
        #Service Box
        self.service_box = HIGVBox()
        #self.service_title =  gtk.Label(
        #    "<span size='12500' weight='heavy'>Service Statistics</span>")
        #self.service_title.set_use_markup(True)
        #self.service_title.set_selectable(False)
        self.refresh_btn = gtk.Button(_("Refresh Now!"))
        self.refresh_btn.set_size_request(108, 72)

        self.display_bar = TimeLineDisplayBar(self)
    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)
示例#5
0
    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 __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.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 __init__(self):
     HIGMainWindow.__init__(self)
     self.vbox = HIGVBox()
     self.main_hbox = gtk.HBox()
     self.set_default_size(500, 30)
     self.set_border_width(0)
     self.connect('delete-event', gtk.main_quit)
示例#11
0
    def _create_widgets(self):
        self._optionlist = OptionList()
        label = gtk.Label('Items at the %s ' % self._name)
        self._box = gtk.HPaned()
        ol = self._optionlist
        ol.reload()
        self.vbox.pack_start(label, False, False, 0)
        self._box.add(ol)
        self.vbox.pack_start(self._box)
        self._box.show_all()
        self._move_box = HIGVBox()
        self._add_bt = HIGButton(stock='gtk-add')
        self._add_bt.connect('clicked', self._on_add_press)
        self._remove_bt = HIGButton(stock='gtk-remove')
        self._remove_bt.connect('clicked', self._on_remove_press)
        #XXX - moves don't work yet: lack the connect
        self._move_up_bt = HIGButton(stock='gtk-go-up')
        self._move_down_bt = HIGButton(stock='gtk-go-down')
        self._move_box.pack_start(self._add_bt, False, False)
        self._move_box.pack_start(self._remove_bt, False, False)
        self._move_box.pack_start(self._move_up_bt, False, False)
        self._move_box.pack_start(self._move_down_bt, False, False)
        self._create_option_tv()

        self._box.set_position(200)
        self._box_other = gtk.HPaned()
        self._box.add(self._box_other)
        self._box_other.add(self._move_box)
        self._box_other.add(self._sw)
        self._move_box.show_all()
        self.vbox.show_all()

        label.show()
    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)
示例#13
0
    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 __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.vbox = HIGVBox()
        self.vbox_content = HIGVBox()

        self.img_logo = gtk.Image()
        self.event_img_logo = gtk.EventBox()

        self.vbox.set_border_width(5)
        self.vbox.set_spacing(12)

        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='15000' weight='heavy'>Open Monitor Desktop Agent</span>"
        )

        self.lbl_program_description = gtk.Label("""\
ICM Internet Connectivity is a global monitor to
inspect the connectivity issues happened in the world.
Developer: Alan Wang<*****@*****.**>
Paul Pei<*****@*****.**>
Tianwei Liu<*****@*****.**>
It was sponsered by Google Summer of Code 2011-2012. 
Thanks Google!""")

        self.lbl_copyright = gtk.Label(
            "<small>Copyright (C) 2012 Adriano Monteiro Marques</small>")

        self.lbl_program_website = gtk.Label(
            "<span underline='single' foreground='blue'>"
            "http://www.umitproject.org</span>")
        self.lbl_program_website2 = gtk.Label(
            "<span underline='single' foreground='blue'>"
            "http://www.openmonitor.org</span>")

        self.bottom_btn_box = gtk.HButtonBox()
        self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE)
        self.btn_close.grab_focus()
    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)
示例#17
0
    def __create_widgets(self):
        self.vbox = HIGVBox()

        self.animated_bar = HIGAnimatedBar('')
        self.toolbar = HIGToolBar()

        self.notebook = gtk.Notebook()
        self.notebook.set_show_tabs(False)
        self.notebook.set_show_border(False)

        self.plug_page = PluginPage(self)
        self.path_page = PathPage(self)
    def __create_widgets(self):
        """
        """
        self.__scans_page = ZionScansPage()
        self.__ports_page = HIGVBox()

        self.open_ports = ScanOpenPortsPage()

        self.append_page(self.__scans_page, gtk.Label(_('Scans')))
        self.append_page(self.__ports_page, gtk.Label(_('Ports')))

        self.__ports_page.add(self.open_ports)
    def __create_widgets(self):
        """
        """
        self.__tbox = HIGTableRNet(1, 4)
        self.__tbox._set_spacing(0)
        self.__vbox = HIGVBox()

        self.__jump_to = gtk.RadioToolButton(None, gtk.STOCK_JUMP_TO)
        self.__jump_to.set_tooltip_text('Change focus')
        self.__jump_to.connect('toggled',
                               self.__change_pointer,
                               POINTER_JUMP_TO)

        self.__info = gtk.RadioToolButton(self.__jump_to, gtk.STOCK_INFO)
        self.__info.set_tooltip_text('Show information')
        self.__info.connect('toggled',
                            self.__change_pointer,
                            POINTER_INFO)

        self.__group = gtk.RadioToolButton(self.__jump_to, gtk.STOCK_ADD)
        self.__group.set_tooltip_text('Group children')
        self.__group.connect('toggled',
                             self.__change_pointer,
                             POINTER_GROUP)

        self.__region = gtk.RadioToolButton(self.__jump_to,
                                            gtk.STOCK_SELECT_COLOR)
        self.__region.set_tooltip_text('Fill region')
        self.__region.connect('toggled',
                              self.__change_pointer,
                              POINTER_FILL)

        self.__region_color = gtk.combo_box_new_text()
        self.__region_color.append_text('Red')
        self.__region_color.append_text('Yellow')
        self.__region_color.append_text('Green')
        self.__region_color.connect('changed', self.__change_region)
        self.__region_color.set_active(self.radialnet.get_region_color())

        self.__tbox._attach_next(self.__jump_to)
        self.__tbox._attach_next(self.__info)
        self.__tbox._attach_next(self.__group)
        self.__tbox._attach_next(self.__region)

        self.__vbox._pack_noexpand_nofill(self.__tbox)
        self.__vbox._pack_noexpand_nofill(self.__region_color)

        self._add(self.__vbox)

        self.__jump_to.set_active(True)
        self.__region_color.set_no_show_all(True)
        self.__region_color.hide()
    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.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 __init__(self, name):
     gtk.ScrolledWindow.__init__(self)
     self.frame = TabFrame(name)
     self.frame.set_shadow_type(gtk.SHADOW_ETCHED_IN)
     self.__main_box = HIGVBox()
     self.frame.add(self.__main_box)
     self._create_widgets()
     self.viewport = gtk.Viewport()
     self.viewport.add(self.frame)
     self.add(self.viewport)
     self.viewport.set_shadow_type(gtk.SHADOW_NONE)
     self.props.shadow_type = gtk.SHADOW_NONE
     self.__main_box.set_border_width(6)
     self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
    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()
示例#24
0
    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()
示例#25
0
    def __init__(self, only_text=True):
        HIGScrolledWindow.__init__(self)

        self._box = HIGVBox()
        vp = gtk.Viewport()

        self._box.set_border_width(6)
        if only_text:
            self._draw_buttons()
            self._pack()
        #ELSE == Algo com icons; ETC!

        vp.add(self._box)
        vp.set_shadow_type(gtk.SHADOW_NONE)
        self.add(vp)
    def __create_widgets(self):
        """
        Create widgets 
        """
        self.main_vbox = gtk.VBox()
        self.widgets = {}

        #UI Manager
        self.__create_ui_manager()
        #Table - contains menubar and toolbar

        #Menubar
        self.__create_menubar()
        #Toolbar
        self.__create_toolbar()

        self.display_frame = HIGFrame()
        self.display_frame.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        self.display_frame.set_border_width(6)

        self.hbox_edit = gtk.HBox()
        self.hspacer = gtk.HPaned()
        self.hspacer.set_border_width(0)
        self.vbox_right = HIGVBox()
        self.vbox_left = HIGVBox()

        self.edit_mode_exp = gtk.Expander(_('Edit Modes'))
        self.edit_mode_box = self.create_edit_mode()

        self.notebook.set_scrollable(True)
        self.notebook.append_page(self.list_options_box,
                                  HIGEntryLabel(_('Option List')))

        self.list_options_box.reload()

        self.__create_status_bar()
    def __create_widgets(self):
        # Creating widgets
        self.scrolled = gtk.ScrolledWindow()
        self.text_view = gtk.TextView()

        self.__hbox = HIGVBox()
        self.__attractor = AttractorWidget()
        self.__osinfo = gtk.Label()
        self.__textalign = gtk.Alignment()
        self.__textalign.add(self.__osinfo)
        self.__textalign.set_padding(8, 0, 0, 8)
        self.__frame_attractor = HIGFrameRNet(_('Attractor'))
        self.__frame_attractor._add(self.__attractor)

        self.__hbox._pack_noexpand_nofill(self.__frame_attractor)
        self.__hbox._pack_noexpand_nofill(self.__textalign)
示例#28
0
    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)
示例#29
0
    def __do_layout(self):
        """
        Layout window widgets.
        """
        main_vbox = HIGVBox()
        btns_box = HIGHBox()

        main_vbox.pack_start(self.logo_img)
        main_vbox.pack_start(self.lbl_program_version)
        main_vbox.pack_start(self.lbl_program_description)

        btns_box.pack_end(self.btn_close)
        main_vbox._pack_noexpand_nofill(btns_box)

        self.btn_close.grab_focus()

        self.add(main_vbox)
    def create_edit_mode(self):
        """
        Create a treeview that contains a three edit modes 
        returns vbox contains a treeview

        @return: returns the treeview with list of edit modes 
        @rtype: vbox
        """

        model = gtk.TreeStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING)
        self.edit_mode_tv = gtk.TreeView(model)
        self.edit_mode_tv.set_headers_visible(False)
        renderer = gtk.CellRendererText()
        cell_renderer_pix = gtk.CellRendererPixbuf()
        column = gtk.TreeViewColumn()
        column.set_title(_('Name'))
        column.pack_start(cell_renderer_pix, False)
        column.add_attribute(cell_renderer_pix, 'pixbuf', 0)
        column.pack_start(renderer, True)
        column.add_attribute(renderer, 'text', 1)

        self.edit_mode_tv.append_column(column)
        myiter = model.insert_before(None, None)
        icon = gtk.Image()
        icon = icon.render_icon('gtk-edit', gtk.ICON_SIZE_MENU)
        model.set_value(myiter, 0, icon)
        model.set_value(myiter, 1, "Profile")
        myiter = model.insert_before(None, None)
        icon = gtk.Image()
        icon = icon.render_icon('gtk-convert', gtk.ICON_SIZE_MENU)
        model.set_value(myiter, 0, icon)
        model.set_value(myiter, 1, "Wizard")
        myiter = model.insert_before(None, None)
        icon = gtk.Image()

        icon = icon.render_icon(gtk.STOCK_DND_MULTIPLE, gtk.ICON_SIZE_MENU)
        model.set_value(myiter, 0, icon)
        model.set_value(myiter, 1, "Options")
        selection = self.edit_mode_tv.get_selection()
        selection.select_iter(myiter)
        self.edit_mode_tv.connect("cursor-changed", self.change_edit_mode)
        vbox = HIGVBox()
        vbox.pack_start(self.edit_mode_tv, False, False)
        return vbox