本文整理汇总了Python中higwidgets.higboxes.HIGVBox.set_border_width方法的典型用法代码示例。如果您正苦于以下问题:Python HIGVBox.set_border_width方法的具体用法?Python HIGVBox.set_border_width怎么用?Python HIGVBox.set_border_width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higboxes.HIGVBox
的用法示例。
在下文中一共展示了HIGVBox.set_border_width方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TabBox
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [as 别名]
class TabBox(gtk.ScrolledWindow):
"""
it's a page of TabsWidget
"""
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):
""" Overwrite me, it's subclass """
# Box Interface
def pack_start(self, *args):
self.__main_box.pack_start(*args)
def pack_end(self, *args):
self.__main_box.pack_end(*args)
def destroy(self):
pass
示例2: __create_tab
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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))
示例3: __do_layout
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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)
示例4: LogsWindow
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [as 别名]
class LogsWindow(HIGWindow):
"""
Logs Window
"""
def __init__(self):
HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
self.set_title(_('Logs'))
self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self.set_size_request(720,480)
self.set_border_width(10)
self.__create_widgets()
self.__pack_widgets()
self.__connect_widgets()
#test
#from umit.icm.agent.gui.Notifications import *
#t = NotificationUpdate(mode=new_release_mode,text="test",timeout=10000)
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 __pack_widgets(self):
self.main_vbox._pack_expand_fill(self.LogsGUI_vbox)
self.main_vbox._pack_noexpand_nofill(self.btn_box)
self.LogsGUI_vbox._pack_expand_fill(self.LogsGUI_hbox1)
self.LogsGUI_vbox._pack_noexpand_nofill(self.LogsGUI_hbox2)
self.LogsGUI_hbox1._pack_expand_fill(self.LogsGUI_subbox)
self.btn_box.set_layout(gtk.BUTTONBOX_END)
self.btn_box.set_spacing(8)
self.btn_box.pack_start(self.close_button)
self.add(self.main_vbox)
def __connect_widgets(self):
""""""
self.close_button.connect('clicked', lambda x: self.destroy())
示例5: __do_layout
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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)
示例6: SuperPeerListWindow
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [as 别名]
class SuperPeerListWindow(HIGWindow):
def __init__(self):
HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
self.set_title(_('Super Peers List'))
self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self.__create_widgets()
self.__pack_widgets()
self.__load_super_peers()
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.main_vbox._pack_expand_fill(self.SuperPeersBox_hbox1)
self.btn_box.set_layout(gtk.BUTTONBOX_END)
self.btn_box.set_spacing(3)
self.btn_box.pack_start(self.ok_button)
self.btn_box.pack_start(self.cancel_button)
self.main_vbox.pack_start(self.btn_box)
self.main_vbox.set_border_width(8)
self.SuperPeersBox_vbox.pack_start(self.SuperPeersBox_hbox1, True, True, 5)
self.SuperPeersBox_vbox.pack_start(self.SuperPeersBox_hbox2, True, True, 5)
def __save_super_peers(self):
self.destroy()
def __load_super_peers(self):
text = ""
for peer_entry in theApp.peer_manager.super_peers.values():
text = text + "%s:%d\n" % (peer_entry.IP, peer_entry.Port)
self.SuperPeersBox_subbox.textbuffer.set_text(text)
示例7: quit
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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()
示例8: on_delete
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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()
示例9: __do_layout
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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())
#.........这里部分代码省略.........
示例10: About
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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)
#.........这里部分代码省略.........
示例11: __layout
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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)
示例12: Wizard
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [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()
#.........这里部分代码省略.........
示例13: SystemPage
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [as 别名]
class SystemPage(HIGScrolledWindow):
"""
"""
def __init__(self, node):
"""
"""
HIGScrolledWindow.__init__(self)
self.__node = node
self.__font = pango.FontDescription('Monospace')
self.__create_widgets()
def __create_widgets(self):
"""
"""
self.__vbox = HIGVBox()
self.__vbox.set_border_width(6)
self.__cell = gtk.CellRendererText()
self.__general_frame = HIGExpanderRNet('General information')
self.__sequences_frame = HIGExpanderRNet('Sequences')
self.__os_frame = HIGExpanderRNet('Operating System')
self.__sequences_frame._add(gtk.Label('No sequence information.'))
self.__os_frame._add(gtk.Label('No OS information.'))
# general information widgets
self.__general = HIGTableRNet(3, 2)
self.__address_label = HIGSectionLabel('Address:')
self.__address_list = gtk.combo_box_entry_new_text()
self.__address_list.child.set_editable(False)
for address in self.__node.get_info('addresses'):
params = address['addrtype'], address['addr']
address_text = SYSTEM_ADDRESS_TEXT % params
if address.get('vendor', None):
address_text += " (%s)" % address['vendor']
self.__address_list.append_text(address_text)
self.__address_list.set_active(0)
self.__general._attach_next(self.__address_label,
yoptions=gtk.FILL,
xoptions=gtk.FILL)
self.__general._attach_next(self.__address_list, yoptions=gtk.FILL)
if self.__node.get_info('hostnames') is not None:
self.__hostname_label = HIGSectionLabel('Hostname:')
self.__hostname_list = gtk.combo_box_entry_new_text()
self.__hostname_list.child.set_editable(False)
for hostname in self.__node.get_info('hostnames'):
params = hostname['type'], hostname['name']
self.__hostname_list.append_text(SYSTEM_ADDRESS_TEXT % params)
self.__hostname_list.set_active(0)
self.__general._attach_next(self.__hostname_label,
yoptions=gtk.FILL,
xoptions=gtk.FILL)
self.__general._attach_next(self.__hostname_list,
yoptions=gtk.FILL)
if self.__node.get_info('uptime') is not None:
self.__uptime_label = HIGSectionLabel('Last boot:')
seconds = self.__node.get_info('uptime')['seconds']
lastboot = self.__node.get_info('uptime')['lastboot']
text = '%s (%s seconds).' % (lastboot, seconds)
self.__uptime_value = HIGLabel(text)
self.__uptime_value.set_selectable(True)
self.__uptime_value.set_line_wrap(False)
self.__general._attach_next(self.__uptime_label,
yoptions=gtk.FILL,
xoptions=gtk.FILL)
self.__general._attach_next(self.__uptime_value,
yoptions=gtk.FILL)
self.__general_frame._add(self.__general)
self.__general_frame.set_expanded(True)
# sequences information widgets
self.__sequences = HIGTableRNet(5, 3)
sequences = self.__node.get_info('sequences')
if len(sequences) > 0:
#.........这里部分代码省略.........
示例14: ServicesPage
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [as 别名]
class ServicesPage(gtk.Notebook):
"""
"""
def __init__(self, node):
"""
"""
gtk.Notebook.__init__(self)
self.set_border_width(6)
self.set_tab_pos(gtk.POS_TOP)
self.__node = node
self.__font = pango.FontDescription('Monospace')
self.__create_widgets()
def __create_widgets(self):
"""
"""
self.__cell = gtk.CellRendererText()
# texteditor widgets
self.__texteditor = HIGTextEditor()
self.__texteditor._modify_font(self.__font)
self.__texteditor._set_editable(False)
self.__texteditor.set_border_width(0)
self.__select_combobox = gtk.combo_box_new_text()
self.__select_combobox.connect('changed', self.__change_text_value)
self.__viewer = HIGVBox(spacing=6)
self.__viewer.set_border_width(6)
self.__viewer._pack_noexpand_nofill(self.__select_combobox)
self.__viewer._pack_expand_fill(self.__texteditor)
self.__text = list()
# ports information
number_of_ports = len(self.__node.get_info('ports'))
self.__ports_label = HIGLabel('Ports (%s)' % number_of_ports)
self.__ports_scroll = HIGScrolledWindow()
self.__ports_store = gtk.TreeStore(gobject.TYPE_INT,
gobject.TYPE_STRING,
gobject.TYPE_STRING,
gobject.TYPE_STRING,
gobject.TYPE_STRING,
gobject.TYPE_STRING,
gobject.TYPE_BOOLEAN)
self.__ports_treeview = gtk.TreeView(self.__ports_store)
for port in self.__node.get_info('ports'):
pstate = port['state']['state']
if pstate:
color = SERVICE_COLORS[port['state']['state']]
else:
# XXX port state is not always available
color = '#fff'
if port['service'].has_key('name'):
service_name = port['service']['name']
else:
service_name = '<unknown>'
if port['service'].has_key('method'):
service_method = port['service']['method']
else:
service_method = '<none>'
reference = self.__ports_store.append(None,
[port['id'],
port['protocol'],
port['state']['state'],
service_name,
service_method,
color,
True])
for key in port['state']:
self.__ports_store.append(reference,
[port['id'],
'state',
key,
port['state'][key],
'',
'white',
True])
for key in port['service']:
if key in ['servicefp', 'extrainfo']:
text = '[%d] service: %s' % (port['id'], key)
self.__select_combobox.append_text(text)
#.........这里部分代码省略.........
示例15: OSFingerprintReport
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import set_border_width [as 别名]
#.........这里部分代码省略.........
can modify it, relicense it, incorporate it into programs such as Nmap, etc."
)
)
self.btn_ok = gtk.Button(stock=gtk.STOCK_OK)
self.btn_cancel = gtk.Button(stock=gtk.STOCK_CANCEL)
self.hbox = HIGHBox()
self.table = HIGTable()
def _pack_widgets(self):
self.notes_scrolled.add(self.notes_text)
self.notes_scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.notes_scrolled.set_size_request(400, 150)
self.notes_text.set_wrap_mode(gtk.WRAP_WORD)
self.fingerprint_icon.set_from_stock(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_DIALOG)
self.fingerprint_icon.set_padding(10, 0)
self.fingerprint_text.set_line_wrap(True)
self.fingerprint_text.set_use_markup(True)
self.table.attach_label(self.submitted_label, 0, 1, 0, 1)
self.table.attach_entry(self.submitted_entry, 1, 2, 0, 1)
self.table.attach_label(self.target_device_label, 0, 1, 1, 2)
self.table.attach_entry(self.target_device_entry, 1, 2, 1, 2)
self.table.attach_label(self.classification_label, 0, 1, 2, 3)
self.table.attach_entry(self.classification_combo, 1, 2, 2, 3)
self.table.attach_label(self.notes_label, 0, 2, 3, 4)
self.table.attach_entry(self.notes_scrolled, 0, 2, 4, 5)
self.hbox.set_border_width(12)
self.hbox._pack_noexpand_nofill(self.fingerprint_icon)
self.hbox._pack_expand_fill(self.fingerprint_text)
self.button_box.set_layout(gtk.BUTTONBOX_END)
self.button_box.pack_start(self.btn_ok)
self.button_box.pack_start(self.btn_cancel)
self.vbox.set_border_width(6)
self.vbox._pack_noexpand_nofill(self.hbox)
self.vbox._pack_expand_fill(self.table)
self.vbox._pack_noexpand_nofill(self.button_box)
self.add(self.vbox)
def _connect_widgets(self):
self.btn_ok.connect("clicked", self.send_report)
self.btn_cancel.connect("clicked", self.close)
self.connect("delete-event", self.close)
def close(self, widget=None, event=None):
self.destroy()
def send_report(self, widget):
if self.target_device == "":
cancel_dialog = HIGAlertDialog(
type=gtk.MESSAGE_ERROR,
message_format=_(
"Operating System \
Fingerprint report is incomplete!"
),
secondary_text=_(
"The Operating \
System Fingerprint report is incomplete. Please, try to provide as much \