本文整理汇总了Python中higwidgets.higtables.HIGTable.attach_label方法的典型用法代码示例。如果您正苦于以下问题:Python HIGTable.attach_label方法的具体用法?Python HIGTable.attach_label怎么用?Python HIGTable.attach_label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higtables.HIGTable
的用法示例。
在下文中一共展示了HIGTable.attach_label方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UpdatePage
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class UpdatePage(HIGVBox):
""""""
def __init__(self):
"""Constructor"""
HIGVBox.__init__(self)
self.__create_widgets()
self.__pack_widgets()
self.__load_list()
self.__connect_widgets()
self.__init_db_text()
def __create_widgets(self):
""""""
self.update_switch_hbox = HIGHBox()
self.update_settings_hbox = HIGHBox()
self.update_db_hbox = HIGHBox()
self.update_switch_section = HIGSectionLabel(_("Update News Detect"))
self.update_switch_table = HIGTable()
self.update_settings_section = HIGSectionLabel(_("Update Settings"))
self.update_settings_table = HIGTable()
self.update_db_section = HIGSectionLabel(_("Update Database"))
self.update_db_table = HIGTable()
self.update_check = gtk.CheckButton(_("Automatically update"))
self.update_switch_check = gtk.CheckButton(_("Software Update Detect Switch"))
self.update_times_label = HIGEntryLabel(_("Auto detect update news"))
self.update_method_label = HIGEntryLabel(_("Update method"))
self.update_time_store = gtk.ListStore(str)
self.update_time_entry = gtk.ComboBoxEntry(self.update_time_store, 0)
self.update_method_store = gtk.ListStore(str)
self.update_method_entry = gtk.ComboBoxEntry(self.update_method_store, 0)
self.update_db_label = HIGEntryLabel()
self.update_db_clear_button = gtk.Button(_("Clear Update Information"))
def __pack_widgets(self):
""""""
self.set_border_width(12)
self._pack_noexpand_nofill(self.update_switch_section)
self._pack_noexpand_nofill(self.update_switch_hbox)
self._pack_noexpand_nofill(hig_box_space_holder())
self._pack_noexpand_nofill(self.update_settings_section)
self._pack_noexpand_nofill(self.update_settings_hbox)
self._pack_noexpand_nofill(self.update_db_section)
self._pack_noexpand_nofill(self.update_db_hbox)
self.update_switch_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.update_switch_hbox._pack_expand_fill(self.update_switch_table)
self.update_settings_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.update_settings_hbox._pack_expand_fill(self.update_settings_table)
self.update_db_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.update_db_hbox._pack_expand_fill(self.update_db_table)
self.update_switch_table.attach_label(self.update_check, 0, 2, 0, 1)
self.update_switch_table.attach_label(self.update_switch_check, 0, 2, 1, 2)
self.update_settings_table.attach_label(self.update_times_label, 0, 1, 0, 1)
self.update_settings_table.attach_entry(self.update_time_entry, 1, 2, 0, 1)
self.update_settings_table.attach_label(self.update_method_label, 0, 1, 1, 2)
self.update_settings_table.attach_entry(self.update_method_entry, 1, 2, 1, 2)
self.update_db_table.attach_label(self.update_db_label, 1, 3, 0, 1)
self.update_db_table.attach(self.update_db_clear_button, 0, 1, 0, 1)
def __init_db_text(self):
""""""
rs = g_db_helper.select("select * from updates")
count = len(rs)
self.update_db_label.set_text(str(_("%d records in update database now."%(count))))
def __connect_widgets(self):
""""""
self.update_check.connect('toggled',lambda w:self.__change_widgets_status())
self.update_db_clear_button.connect("clicked", lambda w:self.__clear_update_db())
def __clear_update_db(self):
""""""
g_db_helper.execute("delete from updates")
g_db_helper.commit()
self.update_db_label.set_text(str(_("Clear software update database!")))
def __change_widgets_status(self):
""""""
if self.update_check.get_active():
self.__disable_widgets()
else:
self.__enable_widgets()
def __load_list(self):
""""""
for s in update_time_str.keys():
#print s
self.update_time_store.append([s])
for s in update_method_str.keys():
#print s
#.........这里部分代码省略.........
示例2: PeerInfoPage
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class PeerInfoPage(HIGVBox):
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
HIGVBox.__init__(self)
self.__create_widgets()
self.__pack_widgets()
def __create_widgets(self):
""""""
self.peerinfo_hbox = HIGHBox()
self.cloudagg_hbox = HIGHBox()
self.superpeers_hbox = HIGHBox()
self.pref_location_hbox = HIGHBox()
self.peerinfo_section = HIGSectionLabel(_("Peer Info"))
self.peerinfo_table = HIGTable()
self.pref_location_section = HIGSectionLabel(_("Preferred Locations"))
self.pref_location_table = HIGTable()
self.cloudagg_section = HIGSectionLabel(_("Cloud Aggregator"))
self.cloudagg_table = HIGTable()
self.cloudagg_subhbox = HIGHBox()
self.superpeers_section = HIGSectionLabel(_("Super Peers"))
self.superpeers_table = HIGTable()
self.peerid_label = HIGEntryLabel(_("Peer ID:"))
self.email_label = HIGEntryLabel(_("Email Address:"))
self.test_version_label = HIGEntryLabel(_("Test Sets Version:"))
self.peerid_label2 = HIGEntryLabel()
self.email_entry = gtk.Entry()
self.test_version_label2 = HIGEntryLabel()
self.longitude_label = HIGLabel(_("longitude:"))
self.longitude_entry = gtk.Entry()
self.latitude_label = HIGLabel(_("latitude:"))
self.latitude_entry = gtk.Entry()
self.cloudagg_entry = gtk.Entry()
self.cloudagg_button = HIGButton(_("Reset"))
self.cloudagg_button.connect('clicked', lambda w: self.reset_aggregator_url())
self.cloudagg_button.set_size_request(80, 28)
self.superpeers_ip_label = HIGLabel(_("IP:"))
self.superpeers_ip_entry = gtk.Entry()
self.superpeers_ip_entry.set_size_request(160, 26)
self.superpeers_port_label = HIGLabel(_("Port:"))
self.superpeers_port_entry = gtk.Entry()
self.superpeers_port_entry.set_size_request(80, 26)
self.superpeers_subhbox = HIGHBox()
self.btn_box = gtk.HButtonBox()
self.superpeers_button1 = HIGButton(_("Add"))
self.superpeers_button1.connect('clicked',lambda w:self.add_superpeer())
self.superpeers_button2 = HIGButton(_("Show all"))
self.superpeers_button2.connect('clicked', lambda w:
self.show_super_peer_list_window())
def __pack_widgets(self):
self.set_border_width(12)
self._pack_noexpand_nofill(self.peerinfo_section)
self._pack_noexpand_nofill(self.peerinfo_hbox)
self._pack_noexpand_nofill(self.pref_location_section)
self._pack_noexpand_nofill(self.pref_location_hbox)
self._pack_noexpand_nofill(self.cloudagg_section)
self._pack_noexpand_nofill(self.cloudagg_hbox)
self._pack_noexpand_nofill(self.superpeers_section)
self._pack_noexpand_nofill(self.superpeers_hbox)
self.peerinfo_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.peerinfo_hbox._pack_expand_fill(self.peerinfo_table)
self.pref_location_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.pref_location_hbox._pack_expand_fill(self.pref_location_table)
self.cloudagg_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.cloudagg_hbox._pack_expand_fill(self.cloudagg_table)
self.superpeers_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.superpeers_hbox._pack_expand_fill(self.superpeers_table)
self.peerinfo_table.attach_label(self.peerid_label, 0, 1, 0, 1)
self.peerinfo_table.attach_label(self.email_label, 0, 1, 2, 3)
self.peerinfo_table.attach_label(self.test_version_label, 0, 1, 1, 2)
self.peerinfo_table.attach_label(self.test_version_label2, 1, 2, 1, 2)
self.peerinfo_table.attach_label(self.peerid_label2, 1, 2, 0, 1)
self.peerinfo_table.attach_entry(self.email_entry, 1, 2, 2, 3)
self.pref_location_table.attach(self.longitude_label,0,1,0,1)
self.pref_location_table.attach(self.longitude_entry,1,2,0,1)
self.pref_location_table.attach(self.latitude_label,2,3,0,1)
self.pref_location_table.attach(self.latitude_entry,3,4,0,1)
self.cloudagg_subhbox._pack_expand_fill(self.cloudagg_entry)
self.cloudagg_subhbox._pack_noexpand_nofill(self.cloudagg_button)
#.........这里部分代码省略.........
示例3: __do_layout
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [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: OSFingerprintReport
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
#.........这里部分代码省略.........
self.notes_scrolled = gtk.ScrolledWindow()
self.notes_text = gtk.TextView()
self.fingerprint_icon = gtk.Image()
self.fingerprint_text = gtk.Label(
_(
"This form allows you to \
contribute new operating system fingerprints to the Nmap database. Thanks for \
helping! <b>Please do not fill this out unless you are sure that you know \
what application is running on the machine you are submitting</b>. Incorrect \
entries can pollute the database. By submitting fingerprints you are \
transfering any copyright interest in the data to Fyodor so that he \
can modify it, relicense it, incorporate it into programs such as Nmap, etc."
)
)
self.btn_ok = gtk.Button(stock=gtk.STOCK_OK)
self.btn_cancel = gtk.Button(stock=gtk.STOCK_CANCEL)
self.hbox = HIGHBox()
self.table = HIGTable()
def _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()
示例5: GeneralPage
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class GeneralPage(HIGVBox):
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
HIGVBox.__init__(self)
self.__create_widgets()
self.__pack_widgets()
self.__information_load()
def __create_widgets(self):
self.general_hbox = HIGHBox()
self.version_hbox = HIGHBox()
################
#Version Section
self.version_section = HIGSectionLabel(_("Version"))
self.version_table = HIGTable()
self.version_label = HIGEntryLabel(_("Software Version:"))
self.version2_label = HIGEntryLabel()
self.testver_label = HIGEntryLabel(_("Service Test Version:"))
self.testver2_label = HIGEntryLabel()
self.attribute_label = HIGEntryLabel(_("Agent Attribute:"))
self.attribute2_label = HIGEntryLabel()
################
#General Section
self.general_section = HIGSectionLabel(_("General"))
self.general_table = HIGTable()
self.startup_check = gtk.CheckButton(_("Startup OpenMonitor on system startup"))
self.notification_check = gtk.CheckButton(_("Show Desktop Notifications"))
self.login_ckeck = gtk.CheckButton(_("Enable Auto login"))
def __pack_widgets(self):
""""""
self.set_border_width(12)
self._pack_noexpand_nofill(self.version_section)
self._pack_noexpand_nofill(self.version_hbox)
self._pack_noexpand_nofill(self.general_section)
self._pack_noexpand_nofill(self.general_hbox)
self.version_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.version_hbox._pack_expand_fill(self.version_table)
self.general_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.general_hbox._pack_expand_fill(self.general_table)
self.version_table.attach_label(self.version_label, 0, 2, 0, 1)
self.version_table.attach_label(self.version2_label, 2, 4, 0, 1)
self.version_table.attach_label(self.testver_label, 0, 2, 1, 2)
self.version_table.attach_label(self.testver2_label, 2, 4, 1, 2)
self.version_table.attach_label(self.attribute_label, 0, 2, 2, 3)
self.version_table.attach_label(self.attribute2_label, 2, 4, 2, 3)
self.general_table.attach_label(self.startup_check, 0, 2, 2, 3)
self.general_table.attach_label(self.notification_check, 0, 3, 3, 4)
self.general_table.attach_label(self.login_ckeck, 0, 4, 4, 5)
def startup_set(self,is_start_up=True):
""""""
start = StartUP()
if is_start_up:
start.set_startup()
else:
start.clear_startup()
def __information_load(self):
"""
"""
from umit.icm.agent.Version import VERSION
from umit.icm.agent.test import TEST_PACKAGE_VERSION
from umit.icm.agent.Global import *
self.version2_label.set_text(str(VERSION))
self.testver2_label.set_text(str(TEST_PACKAGE_VERSION))
peer_attribute = g_db_helper.get_information(key='peer',default="Desktop Agent")
self.attribute2_label.set_text(peer_attribute)
示例6: BugReport
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
#.........这里部分代码省略.........
self.description_scrolled = gtk.ScrolledWindow()
self.description_text = gtk.TextView()
self.bug_icon = gtk.Image()
self.bug_text = gtk.Label(_("This Bug Report dialog allows you "
"to easily tell us about a problem that you may have found on "
"Umit. Doing so, you help us to help you, by fixing and "
"improving Umit faster than usual."))
if self.crashreport:
# Create a button to show details
self.show_details = HIGStockButton(gtk.STOCK_DIALOG_INFO,
_("Show Details"))
self.hbox = HIGHBox()
self.table = HIGTable()
def _pack_widgets(self):
self.description_scrolled.add(self.description_text)
self.description_scrolled.set_policy(gtk.POLICY_AUTOMATIC,
gtk.POLICY_AUTOMATIC)
self.description_scrolled.set_size_request(400, 150)
self.description_text.set_wrap_mode(gtk.WRAP_WORD)
self.bug_icon.set_from_stock(gtk.STOCK_DIALOG_INFO,
gtk.ICON_SIZE_DIALOG)
self.bug_icon.set_padding(10, 0)
self.bug_text.set_line_wrap(True)
self.hbox.set_border_width(12)
nextpos = (0, 1)
if not self.crashreport:
self.table.attach_label(self.category_label, 0, 1, 0, 1)
self.table.attach_entry(self.category_combo, 1, 2, 0, 1)
nextpos = (1, 2)
self.table.attach_label(self.email_label, 0, 1, *nextpos)
self.table.attach_entry(self.email_entry, 1, 2, *nextpos)
nextpos = (2, 3)
if not self.crashreport:
self.table.attach_label(self.summary_label, 0, 1, 2, 3)
self.table.attach_entry(self.summary_entry, 1, 2, 2, 3)
nextpos = (3, 4)
self.table.attach_label(self.description_label, 0, 2, *nextpos)
nextpos = nextpos[0] + 1, nextpos[1] + 1
self.table.attach_entry(self.description_scrolled, 0, 2, *nextpos)
self.hbox._pack_noexpand_nofill(self.bug_icon)
self.hbox._pack_expand_fill(self.bug_text)
self.vbox.pack_start(self.hbox, False, False)
self.vbox.pack_start(self.table)
# Just need because in crash report some aditional
# information will be show
if self.crashreport:
# Add a button to action-area
spaceholder = hig_box_space_holder()
self.action_area.pack_end(spaceholder)
self.action_area.pack_end(self.show_details)
# Put "Show details" to left side respecting HIG
self.action_area.reorder_child(self.show_details,0)
self.action_area.reorder_child(spaceholder, 1)
示例7: __do_layout
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [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()
schedsn_hbox = HIGHBox()
sett_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)
# target and scan profile
schema_table.attach_label(self.scan_name_lbl, 0, 1, 1, 2)
schema_table.attach_entry(self.scan_name, 1, 2, 1, 2)
# scan command
schema_table.attach_label(self.scan_command_lbl, 0, 1, 2, 3)
schema_table.attach_label(self.scan_command, 1, 2, 2, 3)
# scheduling profile
schedsn_hbox._pack_expand_fill(self.sched_name)
schedsn_hbox._pack_noexpand_nofill(self.sched_name_edit)
schema_table.attach_label(self.sched_name_lbl, 0, 1, 3, 4)
schema_table.attach_entry(schedsn_hbox, 1, 2, 3, 4)
# settings frame
settings_align = gtk.Alignment(0.5, 0.5, 1, 1)
settings_align.set_padding(6, 0, 12, 0)
schemasett_hbox = HIGVBox()
# saveto
sett_hbox = HIGHBox()
sett_hbox._pack_expand_fill(self.setting_saveto_entry)
sett_hbox._pack_noexpand_nofill(self.setting_saveto_browse)
sett_table.attach_label(self.setting_saveto, 0, 1, 0, 1)
sett_table.attach_entry(sett_hbox, 1, 2, 0, 1)
# mailto, smtp
sett_hbox = HIGHBox()
sett_hbox._pack_expand_fill(self.setting_mailto_entry)
sett_hbox._pack_noexpand_nofill(self.setting_smtp_lbl)
sett_hbox._pack_expand_fill(self.setting_smtp)
sett_table.attach_label(self.setting_mailto, 0, 1, 1, 2)
sett_table.attach_entry(sett_hbox, 1, 2, 1, 2)
schemasett_hbox._pack_noexpand_nofill(sett_table)
# add to inventory
sett_hbox = HIGHBox()
sett_hbox._pack_noexpand_nofill(self.setting_addtoinv)
schemasett_hbox._pack_noexpand_nofill(sett_hbox)
# enabled/disabled
sett_hbox = HIGHBox()
sett_hbox._pack_noexpand_nofill(self.setting_enabled)
schemasett_hbox._pack_noexpand_nofill(sett_hbox)
settings_align.add(schemasett_hbox)
self.schema_sett_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(schema_table)
main_vbox._pack_noexpand_nofill(gtk.HSeparator())
main_vbox._pack_noexpand_nofill(self.schema_sett_frame)
main_vbox.pack_end(btns_hbox, False, False, 0)
self.add(main_vbox)
示例8: ExposeSettings
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class ExposeSettings(TabBox, object):
def __init__(self):
TabBox.__init__(self, _('Expose Settings'))
self._pack_widgets()
self._create_events()
# Default propertys
self.page_inside = expose_conf.page_inside
def _create_widgets(self):
#self._create_fonts_widgets()
self._create_tabs_widgets()
def _create_fonts_widgets(self):
self._box_fonts_frame = HIGFrame(_('Fonts'))
def _create_tabs_widgets(self):
# Tabs
self._frame_tabs = HIGFrame(_('Tabs'))
self._box_tabs = HIGVBox()
self._radio_inside = gtk.RadioButton(None, _('Scans inside Umit'))
self._radio_outside = gtk.RadioButton(self._radio_inside,\
_('Scans outside Umit'))
# Toolbar:
self._frame_toolbar = HIGFrame(_('Toolbar'))
self._lbl_tlb_size = gtk.Label(_('Toolbar Size: '))
self._lbl_tlb_style = gtk.Label(_('Toolbar Style: '))
self._cmb_tlb_size = gtk.combo_box_new_text()
self._cmb_tlb_size.append_text(_('Small'))
self._cmb_tlb_size.append_text(_('Medium'))
self._cmb_tlb_size.append_text(_('Larger'))
self._cmb_tlb_size.append_text(_('System Default'))
self._cmb_tlb_style = gtk.combo_box_new_text()
self._cmb_tlb_style.append_text(_('Icons'))
self._cmb_tlb_style.append_text(_('Text'))
self._cmb_tlb_style.append_text(_('Both'))
self._tbl_tlb = HIGTable()
def _pack_widgets(self):
# Pack Tabs
self.pack_start(self._frame_tabs, False, False)
self._frame_tabs.add(self._box_tabs)
self._box_tabs.pack_start(self._radio_inside, False, False)
self._box_tabs.pack_start(self._radio_outside, False, False)
# Pack Toolbar
self.pack_start(self._frame_toolbar, False, False)
self._frame_toolbar.add(self._tbl_tlb)
self._tbl_tlb.attach_label(self._lbl_tlb_size,0,1,0,1)
self._tbl_tlb.attach_entry(self._cmb_tlb_size, 1,2,0,1)
self._tbl_tlb.attach_label(self._lbl_tlb_style,0,1,1,2)
self._tbl_tlb.attach_entry(self._cmb_tlb_style, 1,2,1,2)
# Pack Fonts
#self.pack_start(self._box_fonts_frame)
def _create_events(self):
self._radio_inside.connect("toggled", self.update_page)
self._radio_outside.connect("toggled", self.update_page)
def update_page(self, widget):
print "lol"
if not widget.get_active():
return
# Widget is enable.
## But which is enable?
print "updating page!"
if widget == self._radio_inside:
expose_conf.page_inside = True
elif widget == self._radio_outside:
expose_conf.page_inside = False
# API
def get_page_inside(self):
print "get page"
if self._radio_inside.get_active():
return True
else:
return False
def set_page_inside(self, page):
if page:
self._radio_inside.set_active(True)
#.........这里部分代码省略.........
示例9: RegistrationDialog
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class RegistrationDialog(HIGDialog):
""""""
#----------------------------------------------------------------------
def __init__(self, title=_('Registration')):
"""Constructor"""
HIGDialog.__init__(self, title=title,
buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self._create_widgets()
self._pack_widgets()
# Register callbacks
self.connect("response", self.check_response)
def _create_widgets(self):
self.username_label = HIGLabel(_("Username"))
self.username_entry = gtk.Entry()
self.password_label = HIGLabel(_("Password"))
self.password_entry = HIGPasswordEntry()
self.retype_password_label = HIGLabel(_("Retype password"))
self.retype_password_entry = HIGPasswordEntry()
self.registration_icon = gtk.Image()
self.registration_text = gtk.Label(_("If you don't have an ICM account,"
"please register a new account."))
self.hbox = HIGHBox()
self.table = HIGTable()
def _pack_widgets(self):
self.registration_icon.set_from_stock(gtk.STOCK_DIALOG_INFO,
gtk.ICON_SIZE_DIALOG)
self.registration_icon.set_padding(10, 0)
self.registration_text.set_line_wrap(True)
self.hbox.set_border_width(12)
self.hbox._pack_noexpand_nofill(self.registration_icon)
self.hbox._pack_expand_fill(self.registration_text)
self.vbox.pack_start(self.hbox, False, False)
self.table.attach_label(self.username_label, 0, 1, 0, 1)
self.table.attach_entry(self.username_entry, 1, 2, 0, 1)
self.table.attach_label(self.password_label, 0, 1, 1, 2)
self.table.attach_entry(self.password_entry, 1, 2, 1, 2)
self.table.attach_label(self.retype_password_label, 0, 1, 2, 3)
self.table.attach_entry(self.retype_password_entry, 1, 2, 2, 3)
self.vbox.pack_start(self.table)
def check_response(self, widget, response_id):
if response_id == gtk.RESPONSE_ACCEPT: # clicked on Ok btn
self.register()
elif response_id in (gtk.RESPONSE_DELETE_EVENT, gtk.RESPONSE_CANCEL,
gtk.RESPONSE_NONE):
self.destroy()
def register(self):
username = self.username_entry.get_text()
password = self.password_entry.get_text()
theApp.aggregator.register(username, password)
示例10: ServiceFingerprintReport
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class ServiceFingerprintReport(gtk.Window, object):
def __init__(self, service_name, fingerprint, ip):
gtk.Window.__init__(self)
self.set_title(_('Service Fingerprint Report'))
self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self._create_widgets()
self._pack_widgets()
self._connect_widgets()
self.fingerprint = fingerprint
self.ip = ip
self.service_name = service_name
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.service_name_label = HIGHintSectionLabel(_("Service Name"),
_("E.g. smtp, pop-3, \
http, domain, ssh, etc. Umit tries to automaticly fill this field for you, \
based on the Nmap \"SERVICE\" output field. If it is correct, you don't need \
to worry about filling out this field. "))
self.service_name_entry = gtk.Entry()
self.platform_label = HIGHintSectionLabel(_("Platform/OS"),
_('The operating system \
or embedded device the service is running on - Examples are "Linux 2.4.X", \
"Windows XP", "Cisco 3640 router", "Netgear MR814 WAP"'))
self.platform_entry = gtk.Entry()
self.service_description_label = HIGHintSectionLabel(_("Service \
Description"),
_("Please try to \
include vendor name, app name, and version number as applicable. It is OK to \
leave this blank for embedded devices where you have described the hardware \
above and don't have any further details on the service name/version. Here \
are a few examples: ISC Bind 9.2.2, Sendmail 8.12.9/8.10.2, Microsoft Exchange \
5.5.2656.59, Network Associates WebShield 4.5"))
self.service_description_entry = gtk.Entry()
self.notes_label = HIGHintSectionLabel(_("Notes"),
_("Further info on the device \
or service, any special customizations, etc. If it isn't obvious, please let \
me know what the service is (Virus scanning email gateway, Gnutella-protocol \
P2P app, print server web configuration port, 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 service/version fingerprints to the Nmap database. Thanks for \
helping! <b>Please do not fill this out unless you are sure that you know what \
application is running on the machine you are submitting</b>. Incorrect \
entries can pollute the database. By submitting fingerprints you are \
transfering any copyright interest in the data to Fyodor so that he \
can modify it, relicense it, incorporate it into programs such as Nmap, etc."))
self.btn_ok = gtk.Button(stock=gtk.STOCK_OK)
self.btn_cancel = gtk.Button(stock=gtk.STOCK_CANCEL)
self.hbox = HIGHBox()
self.table = HIGTable()
def _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.platform_label, 0, 1, 1, 2)
self.table.attach_entry(self.platform_entry, 1, 2, 1, 2)
self.table.attach_label(self.service_name_label, 0, 1, 2, 3)
self.table.attach_entry(self.service_name_entry, 1, 2, 2, 3)
self.table.attach_label(self.service_description_label, 0, 1, 3, 4)
self.table.attach_entry(self.service_description_entry, 1, 2, 3, 4)
self.table.attach_label(self.notes_label, 0, 2, 4, 5)
self.table.attach_entry(self.notes_scrolled, 0, 2, 5, 6)
self.hbox.set_border_width(12)
self.hbox._pack_noexpand_nofill(self.fingerprint_icon)
#.........这里部分代码省略.........
示例11: DiffLegendWindow
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class DiffLegendWindow(HIGDialog, object):
def __init__(self, colors):
# Shows colors and chars legend
HIGDialog.__init__(self, title=_('Color Descriptions'),
buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
self.colors = colors
self._create_widgets()
self._pack_widgets()
self._connect_widgets()
def _create_widgets(self):
self.table = HIGTable()
self.unchanged_button = gtk.ColorButton(self.colors.unchanged)
self.unchanged_label = gtk.Label(_("Property remained <b>U</b>nchanged"))
self.added_button = gtk.ColorButton(self.colors.added)
self.added_label = gtk.Label(_("Property was <b>A</b>dded"))
self.modified_button = gtk.ColorButton(self.colors.modified)
self.modified_label = gtk.Label(_("Property was <b>M</b>odified"))
self.not_present_button = gtk.ColorButton(self.colors.not_present)
self.not_present_label = gtk.Label(_("Property is <b>N</b>ot present"))
def _pack_widgets(self):
self.unchanged_label.set_use_markup(True)
self.added_label.set_use_markup(True)
self.modified_label.set_use_markup(True)
self.not_present_label.set_use_markup(True)
self.table.attach_label(self.unchanged_button, 0, 1, 0, 1)
self.table.attach_entry(self.unchanged_label, 1, 2, 0, 1)
self.table.attach_label(self.added_button, 0, 1, 1, 2)
self.table.attach_entry(self.added_label, 1, 2, 1, 2)
self.table.attach_label(self.modified_button, 0, 1, 2, 3)
self.table.attach_entry(self.modified_label, 1, 2, 2, 3)
self.table.attach_label(self.not_present_button, 0, 1, 3, 4)
self.table.attach_entry(self.not_present_label, 1, 2, 3, 4)
self.vbox.pack_start(self.table)
self.vbox.show_all()
def _connect_widgets(self):
self.unchanged_button.connect("color-set",
self.set_color,
"unchanged")
self.added_button.connect("color-set",
self.set_color,
"added")
self.modified_button.connect("color-set",
self.set_color,
"modified")
self.not_present_button.connect("color-set",
self.set_color,
"not_present")
def set_color(self, widget, prop):
self.colors.__setattr__(prop, widget.get_color())
示例12: SearchGUI
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
#.........这里部分代码省略.........
self.result_scrolled.set_policy(gtk.POLICY_AUTOMATIC,
gtk.POLICY_AUTOMATIC)
self.result_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.result_hbox._pack_expand_fill(self.result_scrolled)
## Search Notebook
self.search_vbox._pack_expand_fill(self.search_notebook)
self.search_vbox._pack_expand_fill(self.search_button)
self.search_notebook.set_border_width(1)
self.search_vbox.set_border_width(12)
# General page
self.general_vbox.set_border_width(12)
self.general_vbox._pack_noexpand_nofill(self.general_section)
self.general_vbox._pack_noexpand_nofill(self.general_hbox)
#self.general_vbox._pack_noexpand_nofill(self.general_start_section)
#self.general_vbox._pack_noexpand_nofill(self.general_start_hbox)
#self.general_vbox._pack_noexpand_nofill(self.general_finish_section)
#self.general_vbox._pack_noexpand_nofill(self.general_finish_hbox)
self.general_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.general_hbox._pack_expand_fill(self.general_table)
#self.general_start_hbox._pack_noexpand_nofill(hig_box_space_holder())
#self.general_start_hbox._pack_noexpand_nofill(self.general_started_range)
#self.general_finish_hbox._pack_noexpand_nofill(hig_box_space_holder())
#self.general_finish_hbox._pack_expand_fill(self.general_finished_range)
self.general_table.attach_label(self.general_keyword_label, 0, 1, 0, 1)
self.general_table.attach_label(self.general_profile_label, 0, 1, 1, 2)
self.general_table.attach_label(self.general_option_label, 0, 1, 2, 3)
self.general_table.attach_entry(self.general_keyword_entry, 1, 2, 0, 1)
self.general_table.attach_entry(self.general_profile_combo, 1, 2, 1, 2)
self.general_table.attach_entry(self.general_option_combo, 1, 2, 2, 3)
self.search_notebook.append_page(self.general_vbox,
gtk.Label(_("General")))
# Host page
self.host_vbox.set_border_width(12)
self.host_vbox._pack_noexpand_nofill(self.host_section)
self.host_vbox._pack_noexpand_nofill(self.host_hbox)
#self.host_vbox._pack_noexpand_nofill(self.host_uptime_section)
#self.host_vbox._pack_noexpand_nofill(self.host_uptime_hbox)
#self.host_vbox._pack_noexpand_nofill(self.host_lastboot_section)
#self.host_vbox._pack_noexpand_nofill(self.host_lastboot_hbox)
self.host_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.host_hbox._pack_expand_fill(self.host_table)
#self.host_uptime_hbox._pack_noexpand_nofill(hig_box_space_holder())
#self.host_uptime_hbox._pack_noexpand_nofill(self.host_uptime_range)
#self.host_lastboot_hbox._pack_noexpand_nofill(hig_box_space_holder())
#self.host_lastboot_hbox._pack_expand_fill(self.host_lastboot_range)
self.host_table.attach_label(self.host_target_label, 0, 1, 0, 1)
self.host_table.attach_label(self.host_mac_label, 0, 1, 1, 2)
示例13: FeedbackPage
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class FeedbackPage(HIGVBox):
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
HIGVBox.__init__(self)
self.__create_widgets()
self.__pack_widgets()
self.__set_values()
def __create_widgets(self):
self.suggestion_hbox = HIGHBox()
self.report_hbox = HIGHBox()
self.suggestion_section = HIGSectionLabel(_("Test Suggestion"))
self.suggestion_table = HIGTable()
self.report_section = HIGSectionLabel(_("Bug Report"))
self.report_table = HIGTable()
# Website Suggestion
self.website_suggestion_table = HIGTable()
self.website_suggestion_slabel = HIGSectionLabel(_("Website Suggestion"))
self.website_url_subhbox = HIGHBox()
self.website_url_label = HIGEntryLabel(_("URL:"))
self.website_url_entry = gtk.Entry()
self.website_suggestion_sendbtn = HIGButton(_('Send'))
self.website_suggestion_sendbtn.set_size_request(60, 25)
self.website_suggestion_sendbtn.connect(
'clicked', lambda x: self.send_website_suggestion())
# Service Suggestion
self.service_suggestion_table = HIGTable()
self.service_suggestion_slabel = HIGSectionLabel(_("Service Suggestion"))
self.service_name_subhbox = HIGHBox()
self.service_name_label = HIGEntryLabel(_("Name:"))
self.service_list_store = gtk.ListStore(str)
self.service_name_entry = gtk.ComboBoxEntry(self.service_list_store, 0)
self.service_host_subhbox = HIGHBox()
self.service_host_label = HIGEntryLabel(_("Hostname:"))
self.service_host_entry = gtk.Entry()
self.service_ip_subhbox = HIGHBox()
self.service_ip_label = HIGEntryLabel(_("IP:"))
self.service_ip_entry = gtk.Entry()
self.service_port_label = HIGEntryLabel(_("PORT:"))
self.service_port_entry = gtk.Entry()
self.service_suggestion_sendbtn = HIGButton(_('Send'))
self.service_suggestion_sendbtn.set_size_request(60, 25)
self.service_suggestion_sendbtn.connect(
'clicked', lambda x: self.send_service_suggestion())
self.report_namelabel = HIGEntryLabel(_("Your Name:"))
self.report_nameentry = gtk.Entry()
#self.report_nameentry.set_has_frame(True)
self.report_nameentry.set_size_request(100, 26)
self.report_emaillabel = HIGEntryLabel(_("Email:"))
self.report_emailentry = gtk.Entry()
self.report_emailentry.set_size_request(198, 26)
self.report_subhbox1 = HIGHBox()
self.report_sw = gtk.ScrolledWindow()
self.report_sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.report_textview = gtk.TextView()
self.report_textbuffer = self.report_textview.get_buffer()
self.report_textview.set_editable(True)
self.report_textview.set_wrap_mode(True)
self.report_textview.set_border_width(2)
self.report_sw.add(self.report_textview)
self.report_sw.show()
self.report_textview.show()
self.report_subhbox2 = HIGHBox()
self.report_sendbtn = HIGButton(_('Send'))
self.report_sendbtn.set_size_request(60, 25)
self.report_sendbtn.connect('clicked', lambda x: self.send_bug_report())
self.report_subhbox3 = HIGHBox()
def __pack_widgets(self):
self.set_border_width(12)
self._pack_noexpand_nofill(self.suggestion_section)
self._pack_noexpand_nofill(self.suggestion_hbox)
self._pack_noexpand_nofill(self.report_section)
self._pack_noexpand_nofill(self.report_hbox)
#self.suggestion_hbox._pack_noexpand_nofill(hig_box_space_holder())
#self.suggestion_hbox._pack_expand_fill(self.suggestion_table)
#self.report_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.report_hbox._pack_expand_fill(self.report_table)
self.suggestion_hbox._pack_expand_fill(self.suggestion_table)
#self.suggestion_hbox._pack_expand_fill(self.service_suggestion_table)
self.suggestion_table.attach_label(self.website_suggestion_slabel,
0, 2, 0, 1)
self.suggestion_table.attach_label(self.website_url_label,
0, 1, 1, 2)
self.suggestion_table.attach_entry(self.website_url_entry,
1, 2, 1, 2)
self.suggestion_table.attach(self.website_suggestion_sendbtn,
0, 2, 2, 3, gtk.PACK_START)
#.........这里部分代码省略.........
示例14: AdvancedPage
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class AdvancedPage(HIGVBox):
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
HIGVBox.__init__(self)
self.__create_widgets()
self.__pack_widgets()
self._load_list_()
def __create_widgets(self):
""""""
self.timer_hbox = HIGHBox()
self.timer_section = HIGSectionLabel(_("Timeout Setting (seconds)"))
self.timer_table = HIGTable()
self.other_hbox = HIGHBox()
self.other_section = HIGSectionLabel(_("Others"))
self.other_table = HIGTable()
self.task_assign_label = HIGEntryLabel(_("Task Assign"))
self.task_scheduler_label = HIGEntryLabel(_("Task Scheduler"))
self.report_uploader_label = HIGEntryLabel(_("Report Uploader"))
self.test_fetch_label = HIGEntryLabel(_("Test sets Fetch"))
self.task_assign_entry = gtk.Entry()
self.task_scheduler_entry = gtk.Entry()
self.report_uploader_entry = gtk.Entry()
self.test_fetch_entry = gtk.Entry()
self.language_label = HIGEntryLabel(_("Language"))
self.language_store = gtk.ListStore(str)
self.language_entry = gtk.ComboBoxEntry(self.language_store,0)
def __pack_widgets(self):
self.set_border_width(12)
self._pack_noexpand_nofill(self.timer_section)
self._pack_noexpand_nofill(self.timer_hbox)
self._pack_noexpand_nofill(self.other_section)
self._pack_noexpand_nofill(self.other_hbox)
self.timer_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.timer_hbox._pack_expand_fill(self.timer_table)
self.other_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.other_hbox._pack_expand_fill(self.other_table)
self.timer_table.attach_label(self.task_assign_label,0,1,0,1)
self.timer_table.attach_label(self.task_assign_entry,1,3,0,1)
self.timer_table.attach_label(self.task_scheduler_label,0,1,1,2)
self.timer_table.attach_label(self.task_scheduler_entry,1,3,1,2)
self.timer_table.attach_label(self.report_uploader_label,0,1,2,3)
self.timer_table.attach_label(self.report_uploader_entry,1,3,2,3)
self.timer_table.attach_label(self.test_fetch_label,0,1,3,4)
self.timer_table.attach_label(self.test_fetch_entry,1,3,3,4)
self.other_table.attach_label(self.language_label,0,2,0,1)
self.other_table.attach_label(self.language_entry,2,4,0,1)
def _load_list_(self):
""""""
for s in Language_store.keys():
self.language_store.append([s])
示例15: DiffColors
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import attach_label [as 别名]
class DiffColors(TabBox, object):
def __init__(self, colors):
self.colors = colors
TabBox.__init__(self, _('Diff Colors'))
self._pack_widgets()
self._connect_widgets()
def _create_widgets(self):
self.vbox = HIGVBox()
self.table = HIGTable()
self.unchanged_button = gtk.ColorButton(self.colors.unchanged)
self.unchanged_label = gtk.Label(_("Property remained <b>U</b>nchanged"))
self.added_button = gtk.ColorButton(self.colors.added)
self.added_label = gtk.Label(_("Property was <b>A</b>dded"))
self.modified_button = gtk.ColorButton(self.colors.modified)
self.modified_label = gtk.Label(_("Property was <b>M</b>odified"))
self.not_present_button = gtk.ColorButton(self.colors.not_present)
self.not_present_label = gtk.Label(_("Property is <b>N</b>ot present"))
def _pack_widgets(self):
self.unchanged_label.set_use_markup(True)
self.added_label.set_use_markup(True)
self.modified_label.set_use_markup(True)
self.not_present_label.set_use_markup(True)
self.table.attach_label(self.unchanged_button, 0, 1, 0, 1)
self.table.attach_entry(self.unchanged_label, 1, 2, 0, 1)
self.table.attach_label(self.added_button, 0, 1, 1, 2)
self.table.attach_entry(self.added_label, 1, 2, 1, 2)
self.table.attach_label(self.modified_button, 0, 1, 2, 3)
self.table.attach_entry(self.modified_label, 1, 2, 2, 3)
self.table.attach_label(self.not_present_button, 0, 1, 3, 4)
self.table.attach_entry(self.not_present_label, 1, 2, 3, 4)
self.vbox.pack_start(self.table)
self.pack_start(self.vbox, False, False)
def _connect_widgets(self):
self.unchanged_button.connect("color-set",
self.set_color,
"unchanged")
self.added_button.connect("color-set",
self.set_color,
"added")
self.modified_button.connect("color-set",
self.set_color,
"modified")
self.not_present_button.connect("color-set",
self.set_color,
"not_present")
def set_color(self, widget, prop):
self.colors.__setattr__(prop, widget.get_color())