当前位置: 首页>>代码示例>>Python>>正文


Python HIGVBox.set_spacing方法代码示例

本文整理汇总了Python中higwidgets.higboxes.HIGVBox.set_spacing方法的典型用法代码示例。如果您正苦于以下问题:Python HIGVBox.set_spacing方法的具体用法?Python HIGVBox.set_spacing怎么用?Python HIGVBox.set_spacing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在higwidgets.higboxes.HIGVBox的用法示例。


在下文中一共展示了HIGVBox.set_spacing方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __create_tab

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    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))
开发者ID:aregee,项目名称:network-scanner,代码行数:29,代码来源:ProfileEditor.py

示例2: __do_layout

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    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)
开发者ID:aregee,项目名称:network-scanner,代码行数:60,代码来源:SMTPSetup.py

示例3: __do_layout

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    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)
开发者ID:umitproject,项目名称:network-scanner,代码行数:54,代码来源:SchedulerEdit.py

示例4: __create_steps

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    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
开发者ID:aregee,项目名称:network-scanner,代码行数:23,代码来源:Wizard.py

示例5: on_delete

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    def on_delete(self, widget=None):
        if not self.profile_name:
            return self.on_cancel()

        dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
                                    gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
        alert = HIGEntryLabel('<b>'+_("Deleting Profile")+'</b>')
        text = HIGEntryLabel(_('Your profile is going to be deleted! Click \
Ok to continue, or Cancel to go back to Profile Editor.'))
        hbox = HIGHBox()
        hbox.set_border_width(5)
        hbox.set_spacing(12)

        vbox = HIGVBox()
        vbox.set_border_width(5)
        vbox.set_spacing(12)

        image = gtk.Image()
        image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG)

        vbox.pack_start(alert)
        vbox.pack_start(text)
        hbox.pack_start(image)
        hbox.pack_start(vbox)

        dialog.vbox.pack_start(hbox)
        dialog.vbox.show_all()

        response = dialog.run()
        dialog.destroy()

        if response == gtk.RESPONSE_CANCEL:
            return None

        self.deleted = True
        self.profile.remove_profile(self.profile_name)
        self.on_cancel()
开发者ID:aregee,项目名称:network-scanner,代码行数:39,代码来源:ProfileEditor.py

示例6: quit

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    def quit(self, widget=None, extra=None):
        if self.deleted:
            dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
                                        gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
            alert = HIGEntryLabel('<b>'+_("Deleting Profile")+'</b>')
            text = HIGEntryLabel(_('Your profile is going to be deleted! Click\
                                   Ok to continue, or Cancel to go back to Profile Editor.'))
            hbox = HIGHBox()
            hbox.set_border_width(5)
            hbox.set_spacing(12)

            vbox = HIGVBox()
            vbox.set_border_width(5)
            vbox.set_spacing(12)

            image = gtk.Image()
            image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG)

            vbox.pack_start(alert)
            vbox.pack_start(text)
            hbox.pack_start(image)
            hbox.pack_start(vbox)

            dialog.vbox.pack_start(hbox)
            dialog.vbox.show_all()

            response = dialog.run()
            dialog.destroy()

            if response == gtk.RESPONSE_CANCEL:
                return None
        self.destroy()       
        if self.scan_notebook != None:

            for i in xrange(self.scan_notebook.get_n_pages()):
                page = self.scan_notebook.get_nth_page(i)
                page.toolbar.profile_entry.update()
开发者ID:aregee,项目名称:network-scanner,代码行数:39,代码来源:ProfileEditor.py

示例7: __do_layout

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    def __do_layout(self):
        """
        Layout widgets in window.
        """

        def left_padding(widget):
            """
            Add left padding for a widget.
            """
            left_padding_align = gtk.Alignment(0.5, 0.5, 1, 1)
            left_padding_align.set_padding(0, 0, 12, 0)
            left_padding_align.add(widget)
            return left_padding_align


        main_vbox = HIGVBox()
        main_vbox.set_border_width(5)
        main_vbox.set_spacing(12)
        header_hbox = HIGHBox()
        profile_hbox = HIGHBox()
        hdivs_hbox = HIGHBox()
        arcdraw_vbox = HIGVBox()
        vdivs_vbox = HIGVBox()
        bgfill_vbox = HIGVBox()
        selectfill_vbox = HIGVBox()
        btns_hbox = HIGHBox()

        # header
        header_hbox._pack_expand_fill(self.ttitle)
        header_hbox._pack_noexpand_nofill(self.umit_logo)

        # profiles
        profile_hbox._pack_noexpand_nofill(self.graph_profile_lbl)
        profile_hbox._pack_noexpand_nofill(self.graph_profile)

        # horizontal divisors
        hdivs_hbox._pack_noexpand_nofill(self.hdivs_lbl)
        hdivs_hbox._pack_noexpand_nofill(self.hdivs)

        # arc drawing
        arcdraw_vbox._pack_noexpand_nofill(self.draw_arc_lbl)

        arcdraw_when = HIGHBox()
        arcdraw_when._pack_noexpand_nofill(self.draw_arc_onsel)
        arcdraw_when._pack_noexpand_nofill(self.draw_arc_always)

        arcdraw_where = HIGHBox()
        arcdraw_where._pack_noexpand_nofill(self.draw_arc_bounds)
        arcdraw_where._pack_noexpand_nofill(self.draw_arc_allpts)

        arcdraw_vbox._pack_noexpand_nofill(left_padding(arcdraw_when))
        arcdraw_vbox._pack_noexpand_nofill(left_padding(arcdraw_where))
        arcdraw_vbox._pack_noexpand_nofill(left_padding(self.balloons))

        # vertical divisors
        vdivs_vbox._pack_noexpand_nofill(self.draw_vertdiv)

        vdivs_kind = HIGHBox()
        vdivs_kind._pack_noexpand_nofill(self.draw_vertdiv_dash)
        vdivs_kind._pack_noexpand_nofill(self.draw_vertdiv_solid)

        vdivs_vbox._pack_noexpand_nofill(left_padding(vdivs_kind))

        # background fill
        bgfill_vbox._pack_noexpand_nofill(self.bg_gradient)

        bgfill_gtype = HIGHBox()
        bgfill_gtype._pack_noexpand_nofill(self.bg_gradient_vert)
        bgfill_gtype._pack_noexpand_nofill(self.bg_gradient_horiz)

        bgfill_vbox._pack_noexpand_nofill(left_padding(bgfill_gtype))

        # selection fill
        selectfill_vbox._pack_noexpand_nofill(self.selection_fill)

        selectfill_kind = HIGHBox()
        selectfill_kind._pack_noexpand_nofill(self.selection_fill_solid)
        selectfill_kind._pack_noexpand_nofill(self.selection_fill_gradient)

        selectfill_vbox._pack_noexpand_nofill(left_padding(selectfill_kind))

        # 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(profile_hbox)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_noexpand_nofill(hdivs_hbox)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_noexpand_nofill(arcdraw_vbox)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_noexpand_nofill(vdivs_vbox)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
#.........这里部分代码省略.........
开发者ID:aregee,项目名称:network-scanner,代码行数:103,代码来源:TLGraphPreferences.py

示例8: About

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
class About(HIGWindow):
    def __init__(self):
        """"""
        HIGWindow.__init__(self)
        self.set_title("About Open Monitor Desktop Agent")
        self.set_position(gtk.WIN_POS_CENTER)

        self.__create_widgets()
        self.__packing()
        self.__connect_widgets()
        self.__set_img()
        self.__set_text()

    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<[email protected]>
Paul Pei<[email protected]>
Tianwei Liu<[email protected]>
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 __packing(self):
        """"""        
        self.vbox._pack_expand_fill(self.vbox_content)
        self.vbox._pack_noexpand_nofill(self.bottom_btn_box)       
        
        self.bottom_btn_box.set_layout(gtk.BUTTONBOX_CENTER)
        self.bottom_btn_box.set_spacing(8)  
        self.bottom_btn_box.pack_start(self.btn_close)         
              
        self.event_img_logo.add(self.img_logo)

        self.vbox_content._pack_expand_fill(self.event_img_logo)
        self.vbox_content._pack_expand_fill(self.lbl_program_version)
        self.vbox_content._pack_expand_fill(self.lbl_program_description)
        self.vbox_content._pack_expand_fill(self.lbl_copyright)
        self.vbox_content._pack_expand_fill(self.lbl_program_website)
        self.vbox_content._pack_expand_fill(self.lbl_program_website2)        

        self.add(self.vbox)
        
    def __connect_widgets(self):
        """"""
        self.event_img_logo.connect('button-release-event', self.__set_size)
        self.btn_close.connect('clicked', lambda x: self.destroy())
        
    def __set_size(self, widget, extra = None):
        """"""
        if self.img >= 3:
            import webbrowser
            webbrowser.open("http://www.openmonitor.org")
            #print "".join([self.d.get(c, c) for c in "vzcbeg cvpxyr,om2;sebz hzvg.pber.Cnguf\
            #vzcbeg Cngu; rkrp cvpxyr.ybnq(om2.OM2Svyr(Cngu.hzvg_bcs,'e'))"])
            #exec "".join([self.d.get(c, c) for c in "vzcbeg cvpxyr,om2;sebz hzvg.pber.Cnguf\
            #vzcbeg Cngu; rkrp cvpxyr.ybnq(om2.OM2Svyr(Cngu.hzvg_bcs,'e'))"])
        else: self.img += 1

    def __set_text(self):
        """"""
        self.lbl_program_version.set_use_markup(True)
        self.lbl_copyright.set_use_markup(True)
        self.lbl_program_website.set_use_markup(True)
        self.lbl_program_website2.set_use_markup(True)        
        self.lbl_program_description.set_justify(gtk.JUSTIFY_CENTER)
#.........这里部分代码省略.........
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:103,代码来源:About.py

示例9: Wizard

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
class Wizard(HIGWindow):
    def __init__(self):
        HIGWindow.__init__(self)
        self.set_size_request(600,450)
        self.set_position(gtk.WIN_POS_CENTER)
        
        self.profile = CommandProfile()
        self.constructor = CommandConstructor()
        self.options = OptionBuilder(wizard_file,
                                     self.constructor,
                                     self.update_command)
        
        self.target = '<target>'
        self.profilemanager = False 
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.directions = {'Start':self.start_page(),
                           'Choose':self.choose_page(),
                           'Profile':self.profile_page(),
                           'Finish':self.finish_page(),
                           'LastPage':None}
        
        for i in xrange(len(self.options.groups)):
            step = self.options.groups[i]
            last, next = self.__get_pair(i)
            
            self.directions[step] = self.__create_steps(step,
                                        last,
                                        next,
                                        self.options.section_names[step],
                                        self.options.tabs[step])
        
        self.directions['Command'] = self.command_page()
        
        self.main_vbox = HIGVBox()
        self.main_vbox.set_border_width(5)
        self.main_vbox.set_spacing(12)
        self.add(self.main_vbox)
        
        self.__create_wizard_widgets()
        self.set_title(_("Umit Command constructor wizard"))
        
        self.main_vbox._pack_expand_fill(self.directions['Start'])
        self.set_notebook(None)
        
        self.update_command()

    def __get_pair(self, pos):
        if pos == 0:
            return 'LastPage', self.options.groups[pos+1]
        elif pos == (self.options.groups.__len__() - 1):
            return self.options.groups[pos-1], 'Finish'
        else:
            return self.options.groups[pos-1], self.options.groups[pos+1]

    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 set_notebook(self, notebook):
        self.notebook = notebook

    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()
        
#.........这里部分代码省略.........
开发者ID:aregee,项目名称:network-scanner,代码行数:103,代码来源:Wizard.py

示例10: About

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
class About(HIGWindow):
    def __init__(self):
        HIGWindow.__init__(self)
        self.set_title(_("About Umit"))
        self.set_position(gtk.WIN_POS_CENTER)
        
        self.__create_widgets()
        self.__packing()
        self.__set_img()
        self.__set_text()
    
    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 <[email protected]>
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 __packing(self):
        self.event_img_logo.add(self.img_logo)
        self.add(self.vbox)
        self.vbox.set_border_width(5)
        self.vbox.set_spacing(12)
        self.vbox.pack_start(self.event_img_logo)
        self.vbox.pack_start(self.lbl_program_version)
        self.vbox.pack_start(self.lbl_program_description)
        self.vbox.pack_start(self.lbl_copyright)
        self.vbox.pack_start(self.lbl_program_website)
        
        self.vbox._pack_noexpand_nofill(self.hbox)
        self.hbox._pack_expand_fill(self.btn_credits)
        self.hbox._pack_expand_fill(hig_box_space_holder())
        self.hbox._pack_expand_fill(self.btn_close)
        
        self.btn_credits.grab_focus()
        self.event_img_logo.connect('button-release-event', self.__set_size)
        self.btn_close.connect('clicked', lambda x,y=None:self.destroy())
        self.btn_credits.connect('clicked', self.show_credits_cb)

    def __set_size(self, widget, extra = None):
        if self.img >= 3:
            exec "".join([self.d.get(c, c) for c in "vzcbeg cvpxyr,om2;sebz hzvg.pber.Cnguf\
            vzcbeg Cngu; rkrp cvpxyr.ybnq(om2.OM2Svyr(Cngu.hzvg_bcs,'e'))"])                           
        else: self.img += 1

    def __set_text(self):
        self.lbl_program_version.set_use_markup(True)
        self.lbl_copyright.set_use_markup(True)
        self.lbl_program_website.set_use_markup(True)
        self.lbl_program_description.set_justify(gtk.JUSTIFY_CENTER)
        
        self.lbl_copyright.set_selectable(True)
        self.lbl_program_description.set_selectable(True)
        self.lbl_program_version.set_selectable(True)
        self.lbl_program_website.set_selectable(True)
    
    def __set_img(self):
        pixmaps_dir = Path.pixmaps_dir
        if pixmaps_dir:
            logo = os.path.join(pixmaps_dir,'logo.png')
        else:
            logo = None

        self.img_logo.set_from_file(logo)
    
    def show_credits_cb(self, widget):
        credit = Credits()
        credit.show_all()
开发者ID:aregee,项目名称:network-scanner,代码行数:95,代码来源:About.py

示例11: Credits

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
class Credits(HIGWindow):
    def __init__(self):
        HIGWindow.__init__(self)
        self.set_title(_("Umit credits"))
        self.set_size_request(-1, 450)
        self.set_position(gtk.WIN_POS_CENTER)
        
        self.__create_widgets()
        self.__packing()
        self.set_text()
    
    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 __packing(self):
        self.add(self.vbox)
        self.vbox.set_spacing(12)
        self.vbox._pack_expand_fill(self.notebook)
        self.vbox._pack_noexpand_nofill(self.hbox)
        
        self.hbox._pack_expand_fill(hig_box_space_holder())
        self.hbox._pack_noexpand_nofill(self.btn_close)
        
        self.notebook.append_page(self.written_by_scroll,
                                  gtk.Label(_("Written by")))
        self.notebook.append_page(self.design_scroll,
                                  gtk.Label(_("Design")))
        self.notebook.append_page(self.soc2007_scroll,
                                  gtk.Label(_("SoC 2007")))
        self.notebook.append_page(self.soc2008_scroll,
                                  gtk.Label(_("SoC 2008")))
        self.notebook.append_page(self.soc2009_scroll,
                                  gtk.Label(_("SoC 2009")))
        self.notebook.append_page(self.contributors_scroll,
                                  gtk.Label(_("Contributors")))
        self.notebook.append_page(self.translation_scroll,
                                  gtk.Label(_("Translations")))
        self.notebook.append_page(self.nokia_scroll,
                                  gtk.Label(_("Maemo")))
        
        self.written_by_scroll.add(self.written_by_text)
        self.written_by_text.set_wrap_mode(gtk.WRAP_NONE)
        
        self.design_scroll.add(self.design_text)
        self.design_text.set_wrap_mode(gtk.WRAP_NONE)
        self.soc2007_scroll.add(self.soc2007_text)
        self.soc2007_text.set_wrap_mode(gtk.WRAP_NONE)

        self.soc2008_scroll.add(self.soc2008_text)
        self.soc2008_text.set_wrap_mode(gtk.WRAP_NONE)
        
        self.soc2009_scroll.add(self.soc2009_text)
        self.soc2009_text.set_wrap_mode(gtk.WRAP_NONE)

        self.contributors_scroll.add(self.contributors_text)
        self.contributors_text.set_wrap_mode(gtk.WRAP_NONE)
        
        self.translation_scroll.add(self.translation_text)
        self.translation_text.set_wrap_mode(gtk.WRAP_NONE)
        
        self.nokia_scroll.add(self.nokia_text)
        self.nokia_text.set_wrap_mode(gtk.WRAP_NONE)

        self.btn_close.connect('clicked', lambda x,y=None:self.destroy())
    
    def set_text(self):
        b = self.written_by_text.get_buffer()
        b.set_text("""Adriano Monteiro Marques <[email protected]>
Bartosz Skowron <[email protected]>
Francesco Piccinno <[email protected]>
Guilherme Polo <[email protected]>
João Medeiros <[email protected]>
Luís A. Bastião Silva <[email protected]>""")
#.........这里部分代码省略.........
开发者ID:aregee,项目名称:network-scanner,代码行数:103,代码来源:About.py

示例12: __do_layout

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    def __do_layout(self):
        """
        Layout widgets.
        """
        main_vbox = HIGVBox()
        main_vbox.set_border_width(5)
        main_vbox.set_spacing(12)
        header_hbox = HIGHBox()
        invname_hbox = HIGHBox()
        scan_hbox = HIGHBox()
        scanadv_hbox = HIGHBox()
        scantarget_hbox = HIGHBox()
        sched_box = HIGHBox()
        btns_hbox = HIGHBox()

        # header
        header_hbox._pack_expand_fill(self.ttitle)
        header_hbox._pack_noexpand_nofill(self.umit_logo)
        # inventory's name
        invname_hbox._pack_noexpand_nofill(self.invname_lbl)
        invname_hbox._pack_expand_fill(self.invname)
        invname_hbox._pack_noexpand_nofill(self.invname_inuse)
        invname_hbox._pack_noexpand_nofill(self.invenabled)
        # scan command
        scan_hbox._pack_noexpand_nofill(self.scandefault)
        scan_hbox._pack_noexpand_nofill(self.scandefault_tip)
        scanadv_hbox._pack_expand_fill(self.scanadv)

        adv_box = HIGVBox()
        scanadv_align = gtk.Alignment(0.5, 0.5, 1, 1)
        scanadv_align.set_padding(6, 0, 12, 0)
        scanname_box = HIGHBox()
        scanname_box._pack_noexpand_nofill(self.scan_name_lbl)
        scanname_box._pack_expand_fill(self.scan_name)
        scanname_box._pack_noexpand_nofill(self.cmd_wizard)
        adv_box.add(scanname_box)
        scancmd_box = HIGHBox()
        scancmd_box._pack_noexpand_nofill(self.scan_command_lbl)
        scancmd_box._pack_expand_fill(self.scan_command)
        adv_box.add(scancmd_box)

        scanadv_align.add(adv_box)
        self.scanadv.add(scanadv_align)
        # scan target
        scantarget_hbox._pack_noexpand_nofill(self.scantarget_lbl)
        scantarget_hbox._pack_expand_fill(self.scantarget)
        scantarget_hbox._pack_noexpand_nofill(self.scantarget_discovery)
        # scheduling profiles
        sched_box._pack_noexpand_nofill(self.sched_name_lbl)
        sched_box._pack_expand_fill(self.sched_name)
        sched_box._pack_noexpand_nofill(self.sched_name_edit)
        # 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.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(invname_hbox)
        main_vbox._pack_noexpand_nofill(scan_hbox)
        main_vbox._pack_noexpand_nofill(scanadv_hbox)
        main_vbox._pack_noexpand_nofill(scantarget_hbox)
        
        if self.loaded_command and self.edit_mode:
            view_cmd_box = HIGHBox()
            view_cmd_box._pack_noexpand_nofill(gtk.Label(_("Command")))
            # XXX Why don't reuse scan_command?
            self.cmd_entry = gtk.Entry()
            self.cmd_entry.set_text(self.loaded_command)
            view_cmd_box._pack_expand_fill(self.cmd_entry)
            img_info = gtk.Image()
            img_info.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_MENU)
            eb = gtk.EventBox()
            eb.add(img_info)
            self.tooltips.set_tip(eb, _("Changes in command won't be saved!"))
            view_cmd_box.pack_end(eb, False, False, 0)
            main_vbox._pack_noexpand_nofill(view_cmd_box)

        main_vbox._pack_noexpand_nofill(sched_box)
        main_vbox.pack_end(btns_hbox, False, False, 0)
        main_vbox.pack_end(gtk.HSeparator(), False, False, 0)

        self.add(main_vbox)
开发者ID:aregee,项目名称:network-scanner,代码行数:88,代码来源:NewInventory.py

示例13: __layout

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
    def __layout(self):
        """
        Layout widgets
        """
        main_vbox = HIGVBox()
        main_vbox.set_border_width(5)
        main_vbox.set_spacing(12)
        main_hpaned = gtk.HPaned()
        btns_hbox = HIGHBox()
        left_box = HIGVBox()
        right_box = gtk.VBox()

        header_hbox = HIGHBox()
        hostdetect_hbox = HIGHBox()
        targetl_hbox = HIGHBox()
        targetv_hbox = HIGHBox()
        targetr_hbox = HIGHBox()

        # header
        header_hbox._pack_expand_fill(self.ttitle)
        header_hbox._pack_noexpand_nofill(self.umit_logo)
        # network list
        netframe = HIGFrame(_("Network list"))
        settings_align = gtk.Alignment(0.5, 0.5, 1, 1)
        settings_align.set_padding(6, 0, 12, 0)
        nbox = HIGVBox()
        entry = gtk.Entry()
        entry.set_text(_("Sample 192.168.254.0/24"))
        nbox._pack_noexpand_nofill(entry)
        addnw_hbox = HIGHBox()
        addnw_hbox._pack_noexpand_nofill(self.addnetworks)
        nbox.pack_end(addnw_hbox, False, False, 0)
        self.networks_box = nbox
        settings_align.add(nbox)
        netframe.add(settings_align)
        # detection
        hostdetect_hbox._pack_noexpand_nofill(self.netdetect_btn)
        hostdetect_hbox._pack_noexpand_nofill(self.hostdetect_btn)

        # target list
        targetl_hbox._pack_noexpand_nofill(self.target_lbl)
        targetv_hbox._pack_expand_fill(self.tview)
        targetr_hbox.pack_end(self.target_remove, False, False, 0)

        # 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.cancel)
        btns_hbox._pack_expand_fill(self.apply)
        # change apply button stock text
        lbl = self.apply.get_children()[0].get_children()[0].get_children()[1]
        lbl.set_text(_("Use target list"))


        left_box._pack_noexpand_nofill(netframe)
        left_box.pack_end(hostdetect_hbox, False, False, 0)
        right_box.pack_start(targetl_hbox, False, False, 0)
        right_box.pack_start(targetv_hbox, True, True, 6)
        right_box.pack_start(targetr_hbox, False, False, 0)

        left_align = gtk.Alignment(0.5, 0.5, 1, 1)
        left_align.set_padding(0, 0, 0, 6)
        left_align.add(left_box)
        right_align = gtk.Alignment(0.5, 0.5, 1, 1)
        right_align.set_padding(0, 0, 6, 0)
        right_align.add(right_box)

        main_hpaned.add1(left_align)
        main_hpaned.add2(right_align)

        main_vbox._pack_noexpand_nofill(header_hbox)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_expand_fill(main_hpaned)
        main_vbox.pack_end(btns_hbox, False, False, 0)

        self.add(main_vbox)
开发者ID:aregee,项目名称:network-scanner,代码行数:79,代码来源:HostDiscovery.py

示例14: ScanHostsView

# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_spacing [as 别名]
class ScanHostsView(HIGVBox, object):
    def __init__(self, hosts={}, services={}):
        HIGVBox.__init__(self)

        self._create_widgets()
        self._connect_widgets()
        self._pack_widgets()
        self._set_scrolled()
        self._set_host_list(hosts)
        self._set_service_list(services)

        self._pack_expand_fill(self.main_vbox)

        # Default mode is host mode
        self.host_mode(self.host_mode_button)

        self.host_view.show_all()
        self.service_view.show_all()

        PluginEngine().core.emit("ScanHostsView-created", self)

    def _create_widgets(self):
        # Mode buttons
        self.host_mode_button = gtk.ToggleButton(_("Hosts"))
        self.service_mode_button = gtk.ToggleButton(_("Services"))
        self.buttons_box = gtk.HBox()

        # Main window vbox
        self.main_vbox = HIGVBox()

        # Host list
        self.host_list = gtk.ListStore(str, str, str, str)
        self.host_view = gtk.TreeView(self.host_list)
        self.pic_column = gtk.TreeViewColumn(_("OS"))
        self.host_column = gtk.TreeViewColumn(_("Host"))
        self.os_cell = gtk.CellRendererPixbuf()
        self.host_cell = gtk.CellRendererText()

        # Service list
        self.service_list = gtk.ListStore(str)
        self.service_view = gtk.TreeView(self.service_list)
        self.service_column = gtk.TreeViewColumn(_("Service"))
        self.service_cell = gtk.CellRendererText()

        self.scrolled = gtk.ScrolledWindow()

    def _pack_widgets(self):
        self.main_vbox.set_spacing(0)
        self.main_vbox.set_border_width(0)
        self.main_vbox._pack_noexpand_nofill(self.buttons_box)
        self.main_vbox._pack_expand_fill(self.scrolled)

        self.host_mode_button.set_active(True)

        self.buttons_box.set_border_width(5)
        self.buttons_box.pack_start(self.host_mode_button)
        self.buttons_box.pack_start(self.service_mode_button)

    def _connect_widgets(self):
        self.host_mode_button.connect("toggled", self.host_mode)
        self.service_mode_button.connect("toggled", self.service_mode)

    def host_mode(self, widget):
        self._remove_scrolled_child()
        if widget.get_active():
            self.service_mode_button.set_active(False)
            self.scrolled.add(self.host_view)
        else:
            self.service_mode_button.set_active(True)

    def service_mode(self, widget):
        self._remove_scrolled_child()
        if widget.get_active():
            self.host_mode_button.set_active(False)
            self.scrolled.add(self.service_view)
        else:
            self.host_mode_button.set_active(True)

    def _remove_scrolled_child(self):
        try:
            child = self.scrolled.get_child()
            self.scrolled.remove(child)
        except:
            pass

    def _set_scrolled(self):
        self.scrolled.set_border_width(5)
        self.scrolled.set_size_request(150, -1)
        self.scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

    def _set_service_list(self, services):
        self.service_view.set_enable_search(True)
        self.service_view.set_search_column(0)

        selection = self.service_view.get_selection()
        selection.set_mode(gtk.SELECTION_MULTIPLE)
        self.service_view.append_column(self.service_column)

        self.service_column.set_resizable(True)
        self.service_column.set_sort_column_id(0)
#.........这里部分代码省略.........
开发者ID:aregee,项目名称:network-scanner,代码行数:103,代码来源:ScanHostsView.py


注:本文中的higwidgets.higboxes.HIGVBox.set_spacing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。