示例#1
0
    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)
示例#2
0
    def _pack_widgets(self):
        self.opt_vbox.set_border_width(12)
        self.opt_vbox._pack_noexpand_nofill(self.opt_local_section)
        self.opt_vbox._pack_noexpand_nofill(self.opt_local_hbox)

        self.opt_vbox._pack_noexpand_nofill(self.opt_base_section)
        self.opt_vbox._pack_noexpand_nofill(self.opt_base_hbox)

        self.opt_local_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.opt_local_hbox._pack_expand_fill(self.opt_local_table)

        self.opt_base_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.opt_base_hbox._pack_expand_fill(self.opt_base_table)

        self.opt_local_table.attach_label(self.opt_path_label, 0, 1, 0, 1)
        self.opt_local_table.attach_label(self.opt_extension_label, 0, 1, 1, 2)

        self.opt_local_table.attach_entry(self.opt_path_entry, 1, 2, 0, 1)
        self.opt_local_table.attach_entry(self.opt_extension_entry, 1, 2, 1, 2)

        self.opt_base_table.attach_label(self.opt_savetime_label, 0, 1, 0, 1)
        self.opt_base_table.attach_label(self.opt_save_check, 0, 2, 1, 2)
        self.opt_base_table.attach_label(self.opt_search_check, 0, 2, 2, 3)

        self.opt_base_table.attach_entry(self.opt_savetime_entry, 1, 2, 0, 1)
        self.pack_start(self.opt_vbox, False, False)
示例#3
0
    def _pack_widgets(self):

        self.hbox.set_border_width(8)
        
        self.table.set_focus_chain(self.orders)
        
        self.table.attach(self.logo_image,0,7,0,5,gtk.FILL,gtk.FILL,0,0)
        self.table.attach(self.username_label,0,1,5,6,gtk.FILL,gtk.FILL,0,0)
        self.table.attach(self.username_entry,1,5,5,6,gtk.FILL|gtk.EXPAND,gtk.FILL|gtk.EXPAND,0,0)
        self.table.attach(self.password_label,0,1,6,7,gtk.FILL,gtk.FILL,0,0)
        self.table.attach(self.password_entry,1,5,6,7,gtk.FILL|gtk.EXPAND,gtk.FILL|gtk.EXPAND,0,0) 
        self.table.attach(self.register_button,5,6,5,6,gtk.FILL,gtk.FILL,0,0)  
        self.table.attach(self.forgot_password,5,6,6,7,gtk.FILL,gtk.FILL,0,0)
        self.table.attach(self.auto_login_checkbtn,1,3,7,8,gtk.FILL,gtk.FILL,0,0)   
 
        self.hbox._pack_expand_fill(self.table)
        self.vbox.pack_start(self.hbox, False, False)                                  

        spaceholder1 = hig_box_space_holder()
        spaceholder2 = hig_box_space_holder()
        spaceholder3 = hig_box_space_holder()
        self.action_area.pack_end(spaceholder1)
        self.action_area.pack_end(spaceholder2)
        self.action_area.pack_end(spaceholder3)
        self.action_area.pack_end(self.settings_button)
        self.action_area.reorder_child(self.settings_button, 0)
        self.action_area.reorder_child(spaceholder1, 1)        
        self.action_area.reorder_child(spaceholder2, 2)
        self.action_area.reorder_child(spaceholder3, 2)
 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 __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)
示例#6
0
    def _pack_widgets(self):
        self.opt_vbox.set_border_width(12)
        self.opt_vbox._pack_noexpand_nofill(self.opt_local_section)
        self.opt_vbox._pack_noexpand_nofill(self.opt_local_hbox)

        self.opt_vbox._pack_noexpand_nofill(self.opt_base_section)
        self.opt_vbox._pack_noexpand_nofill(self.opt_base_hbox)

        self.opt_local_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.opt_local_hbox._pack_expand_fill(self.opt_local_table)

        self.opt_base_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.opt_base_hbox._pack_expand_fill(self.opt_base_table)

        self.opt_local_table.attach_label(self.opt_path_label, 0, 1, 0, 1)
        self.opt_local_table.attach_label(self.opt_extension_label, 0, 1, 1, 2)

        self.opt_local_table.attach_entry(self.opt_path_entry, 1, 2, 0, 1)
        self.opt_local_table.attach_entry(self.opt_extension_entry, 1, 2, 1, 2)

        self.opt_base_table.attach_label(self.opt_savetime_label, 0, 1, 0, 1)
        self.opt_base_table.attach_label(self.opt_save_check, 0, 2, 1, 2)
        self.opt_base_table.attach_label(self.opt_search_check, 0, 2, 2, 3)

        self.opt_base_table.attach_entry(self.opt_savetime_entry, 1, 2, 0, 1)
        self.pack_start(self.opt_vbox, False, False)
    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 __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 __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 __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)
        self.cloudagg_table.attach_entry(self.cloudagg_subhbox, 0, 1, 0, 1)

        self.btn_box.set_layout(gtk.BUTTONBOX_END)
        self.btn_box.set_spacing(8)
        self.btn_box.pack_start(self.superpeers_button1)
        self.btn_box.pack_start(self.superpeers_button2)
        self.superpeers_subhbox._pack_expand_fill(self.superpeers_ip_label)
        self.superpeers_subhbox._pack_expand_fill(self.superpeers_ip_entry)
        self.superpeers_subhbox._pack_expand_fill(self.superpeers_port_label)
        self.superpeers_subhbox._pack_expand_fill(self.superpeers_port_entry)
        self.superpeers_subhbox._pack_noexpand_nofill(self.btn_box)
        self.superpeers_table.attach_label(self.superpeers_subhbox, 0, 1, 0, 1)
示例#11
0
    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)
        self.cloudagg_table.attach_entry(self.cloudagg_subhbox, 0, 1, 0, 1)

        self.btn_box.set_layout(gtk.BUTTONBOX_END)
        self.btn_box.set_spacing(8)
        self.btn_box.pack_start(self.superpeers_button1)
        self.btn_box.pack_start(self.superpeers_button2)
        self.superpeers_subhbox._pack_expand_fill(self.superpeers_ip_label)
        self.superpeers_subhbox._pack_expand_fill(self.superpeers_ip_entry)
        self.superpeers_subhbox._pack_expand_fill(self.superpeers_port_label)
        self.superpeers_subhbox._pack_expand_fill(self.superpeers_port_entry)
        self.superpeers_subhbox._pack_noexpand_nofill(self.btn_box)
        self.superpeers_table.attach_label(self.superpeers_subhbox, 0, 1, 0, 1)
    def __pack_widgets(self):
        self.add(self.main_vbox)

        # Packing widgets to main_vbox

        self.main_vbox._pack_noexpand_nofill(self.command_expander)
        self.main_vbox._pack_expand_fill(self.notebook)
        self.main_vbox._pack_noexpand_nofill(self.buttons_hbox)

        # Packing command_entry on command_expander
        self.command_expander.hbox.pack_start(self.command_entry)

        # Packing profile information tab on notebook
        self.notebook.append_page(self.profile_info_vbox,
                                  gtk.Label(_('Profile')))
        self.profile_info_vbox.set_border_width(5)
        table = HIGTable()
        self.profile_info_vbox._pack_noexpand_nofill(self.profile_info_label)
        self.profile_info_vbox._pack_noexpand_nofill(HIGSpacer(table))

        self.profile_annotation_scroll.add(self.profile_annotation_text)
        self.profile_description_scroll.add(self.profile_description_text)

        vbox_desc = HIGVBox()
        vbox_desc._pack_noexpand_nofill(self.profile_description_label)
        vbox_desc._pack_expand_fill(hig_box_space_holder())

        vbox_ann = HIGVBox()
        vbox_ann._pack_noexpand_nofill(self.profile_annotation_label)
        vbox_ann._pack_expand_fill(hig_box_space_holder())
        table.attach(self.profile_name_label, 0, 1, 0, 1)
        table.attach(self.profile_name_entry, 1, 2, 0, 1)
        #table.attach(self.profile_hint_label,0,1,1,2,xoptions=0)
        table.attach(self.profile_hint_label, 0, 1, 1, 2)
        table.attach(self.profile_hint_entry, 1, 2, 1, 2)
        table.attach(vbox_desc, 0, 1, 2, 3)
        table.attach(self.profile_description_scroll, 1, 2, 2, 3)
        table.attach(vbox_ann, 0, 1, 3, 4)
        table.attach(self.profile_annotation_scroll, 1, 2, 3, 4)

        # Packing buttons on button_hbox
        self.buttons_hbox.pack_start(self.help_button)
        #self.buttons_hbox.pack_start(self.delete_button)
        self.buttons_hbox.pack_start(self.cancel_button)
        self.buttons_hbox.pack_start(self.ok_button)

        self.buttons_hbox.set_border_width(5)
        self.buttons_hbox.set_spacing(6)
示例#13
0
    def _pack_widgets(self):
        self._pack_noexpand_nofill(self.diff_title)
        self._pack_expand_fill(self.diff_box)
        self.diff_box._pack_noexpand_nofill(hig_box_space_holder())
        self.diff_box._pack_expand_fill(self.diff_scrolled)

        self.diff_scrolled.add(self.diff_view)
示例#14
0
    def __init__(self):
        HIGVBox.__init__(self)
        self.set_spacing(12)
        
        table = HIGTable()
        self.hbox = HIGHBox()
        
        self.description = HIGEntryLabel(_("""You wish to create a new profile,\
 or just want to quickly create a command and run it once?"""))
        self.profile_radio = gtk.RadioButton(None, _('Profile'))
        self.command_radio = gtk.RadioButton(self.profile_radio, _('Command'))
        self.command_radio.connect('toggled', self.enable_target)
        self.profile_radio.connect('toggled', self.disable_target)
        
        self.target_label = HIGEntryLabel(_("Target"))
        self.target_entry = gtk.Entry()
        self.set_completion()
        
        self.hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.hbox._pack_noexpand_nofill(self.target_label)
        self.hbox._pack_expand_fill(self.target_entry)
        
        self.bar = ForwardBar()
        
        self._pack_noexpand_nofill(self.description)
        self._pack_expand_fill(table)
        self._pack_noexpand_nofill(self.bar)
        
        table.attach(self.profile_radio,0,1,0,1, yoptions=0)
        table.attach(self.command_radio,0,1,1,2, yoptions=0)
        table.attach(self.hbox,0,1,2,3, yoptions=0)
        
        self.disable_target()
示例#15
0
    def set_scan_infos(self, scan_info):
        for scan in scan_info:
            exp = gtk.Expander('<b>%s - %s</b>' %
                               (_('Scan Info'), scan['type'].capitalize()))
            exp.set_use_markup(True)
            hbox = HIGHBox()
            table = HIGTable()
            table.set_border_width(5)
            table.set_row_spacings(6)
            table.set_col_spacings(6)

            table.attach(HIGEntryLabel(_('Scan type:')), 0, 1, 0, 1)
            table.attach(HIGEntryLabel(scan['type']), 1, 2, 0, 1)

            table.attach(HIGEntryLabel(_('Protocol:')), 0, 1, 1, 2)
            table.attach(HIGEntryLabel(scan['protocol']), 1, 2, 1, 2)

            table.attach(HIGEntryLabel(_('# scanned ports:')), 0, 1, 2, 3)
            table.attach(HIGEntryLabel(scan['numservices']), 1, 2, 2, 3)

            table.attach(HIGEntryLabel(_('Services:')), 0, 1, 3, 4)
            table.attach(self.get_service_view(scan['services'].split(',')),\
                                               1,2,3,4)

            hbox._pack_noexpand_nofill(hig_box_space_holder())
            hbox._pack_noexpand_nofill(table)

            exp.add(hbox)
            self._pack_noexpand_nofill(exp)
示例#16
0
    def _pack_widgets(self):
        self._pack_noexpand_nofill(self.diff_title)
        self._pack_expand_fill(self.diff_box)
        self.diff_box._pack_noexpand_nofill(hig_box_space_holder())
        self.diff_box._pack_expand_fill(self.diff_scrolled)

        self.diff_scrolled.add(self.diff_view)
 def set_scan_infos(self, scan_info):
     for scan in scan_info:
         exp = gtk.Expander('<b>%s - %s</b>' % (_('Scan Info'),
                                                scan['type'].capitalize()))
         exp.set_use_markup(True)
         hbox = HIGHBox()
         table = HIGTable()
         table.set_border_width(5)
         table.set_row_spacings(6)
         table.set_col_spacings(6)
         
         table.attach(HIGEntryLabel(_('Scan type:')),0,1,0,1)
         table.attach(HIGEntryLabel(scan['type']),1,2,0,1)
         
         table.attach(HIGEntryLabel(_('Protocol:')),0,1,1,2)
         table.attach(HIGEntryLabel(scan['protocol']),1,2,1,2)
         
         table.attach(HIGEntryLabel(_('# scanned ports:')),0,1,2,3)
         table.attach(HIGEntryLabel(scan['numservices']),1,2,2,3)
         
         table.attach(HIGEntryLabel(_('Services:')),0,1,3,4)
         table.attach(self.get_service_view(scan['services'].split(',')),\
                                            1,2,3,4)
         
         hbox._pack_noexpand_nofill(hig_box_space_holder())
         hbox._pack_noexpand_nofill(table)
         
         exp.add (hbox)
         self._pack_noexpand_nofill(exp)
示例#18
0
    def __init__(self):
        HIGVBox.__init__(self)
        self.set_spacing(12)

        table = HIGTable()
        self.hbox = HIGHBox()

        self.description = HIGEntryLabel(
            _("""You wish to create a new profile,\
 or just want to quickly create a command and run it once?"""))
        self.profile_radio = gtk.RadioButton(None, _('Profile'))
        self.command_radio = gtk.RadioButton(self.profile_radio, _('Command'))
        self.command_radio.connect('toggled', self.enable_target)
        self.profile_radio.connect('toggled', self.disable_target)

        self.target_label = HIGEntryLabel(_("Target"))
        self.target_entry = gtk.Entry()
        self.set_completion()

        self.hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.hbox._pack_noexpand_nofill(self.target_label)
        self.hbox._pack_expand_fill(self.target_entry)

        self.bar = ForwardBar()

        self._pack_noexpand_nofill(self.description)
        self._pack_expand_fill(table)
        self._pack_noexpand_nofill(self.bar)

        table.attach(self.profile_radio, 0, 1, 0, 1, yoptions=0)
        table.attach(self.command_radio, 0, 1, 1, 2, yoptions=0)
        table.attach(self.hbox, 0, 1, 2, 3, yoptions=0)

        self.disable_target()
示例#19
0
    def __pack_widgets(self):
        self.add(self.main_vbox)

        # Packing widgets to main_vbox

        self.main_vbox._pack_noexpand_nofill(self.command_expander)
        self.main_vbox._pack_expand_fill(self.notebook)
        self.main_vbox._pack_noexpand_nofill(self.buttons_hbox)

        # Packing command_entry on command_expander
        self.command_expander.hbox.pack_start(self.command_entry)

        # Packing profile information tab on notebook
        self.notebook.append_page(self.profile_info_vbox, gtk.Label(_('Profile')))
        self.profile_info_vbox.set_border_width(5)
        table = HIGTable()
        self.profile_info_vbox._pack_noexpand_nofill(self.profile_info_label)
        self.profile_info_vbox._pack_noexpand_nofill(HIGSpacer(table))

        self.profile_annotation_scroll.add(self.profile_annotation_text)
        self.profile_description_scroll.add(self.profile_description_text)

        vbox_desc = HIGVBox()
        vbox_desc._pack_noexpand_nofill(self.profile_description_label)
        vbox_desc._pack_expand_fill(hig_box_space_holder())

        vbox_ann = HIGVBox()
        vbox_ann._pack_noexpand_nofill(self.profile_annotation_label)
        vbox_ann._pack_expand_fill(hig_box_space_holder())
        table.attach(self.profile_name_label,0,1,0,1)
        table.attach(self.profile_name_entry,1,2,0,1)
        #table.attach(self.profile_hint_label,0,1,1,2,xoptions=0)
        table.attach(self.profile_hint_label,0,1,1,2)
        table.attach(self.profile_hint_entry,1,2,1,2)
        table.attach(vbox_desc,0,1,2,3)
        table.attach(self.profile_description_scroll,1,2,2,3)
        table.attach(vbox_ann,0,1,3,4)
        table.attach(self.profile_annotation_scroll,1,2,3,4)

        # Packing buttons on button_hbox
        self.buttons_hbox.pack_start(self.help_button)
        #self.buttons_hbox.pack_start(self.delete_button)
        self.buttons_hbox.pack_start(self.cancel_button)
        self.buttons_hbox.pack_start(self.ok_button)

        self.buttons_hbox.set_border_width(5)
        self.buttons_hbox.set_spacing(6)
    def create_table_hbox(self):
        table = HIGTable()
        hbox = HIGHBox()

        hbox._pack_noexpand_nofill(hig_box_space_holder())
        hbox._pack_noexpand_nofill(table)

        return table, hbox
 def create_table_hbox(self):
     table = HIGTable()
     hbox = HIGHBox()
     
     hbox._pack_noexpand_nofill(hig_box_space_holder())
     hbox._pack_noexpand_nofill(table)
     
     return table, hbox
    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)
示例#23
0
    def __do_layout(self):
        """
        Layout widgets in window.
        """
        main_vbox = HIGVBox()
        main_vbox.set_border_width(5)
        main_vbox.set_spacing(12)
        header_hbox = HIGHBox()
        schema_table = HIGTable()
        auth_table = HIGTable()
        btns_hbox = HIGHBox()

        header_hbox._pack_expand_fill(self.ttitle)
        header_hbox._pack_noexpand_nofill(self.umit_logo)
        
        # schema name
        schema_table.attach_label(self.schema_name_lbl, 0, 1, 0, 1)
        schema_table.attach_entry(self.schema_name, 1, 2, 0, 1)
        
        # smtp server
        schema_table.attach_label(self.smtp_server_lbl, 0, 1, 1, 2)
        schema_table.attach_entry(self.smtp_server, 1, 2, 1, 2)

        # smtp server port
        schema_table.attach_label(self.smtp_port_lbl, 0, 1, 2, 3)
        schema_table.attach_entry(self.smtp_port, 1, 2, 2, 3)
        
        # smtp mail from
        schema_table.attach_label(self.smtp_mailfrom_lbl, 0, 1, 3, 4)
        schema_table.attach_entry(self.smtp_mailfrom, 1, 2, 3, 4)
        
        # smtp user
        auth_table.attach_label(self.smtp_login_lbl, 0, 1, 0, 1)
        auth_table.attach_entry(self.smtp_login, 1, 2, 0, 1)
        
        # smtp passwd
        auth_table.attach_label(self.smtp_passwd_lbl, 0, 1, 1, 2)
        auth_table.attach_label(self.smtp_passwd, 1, 2, 1, 2)
        
        # bottom buttons
        btns_hbox.set_homogeneous(True)
        btns_hbox._pack_expand_fill(self.help)
        btns_hbox._pack_expand_fill(hig_box_space_holder())
        btns_hbox._pack_expand_fill(self.apply)
        btns_hbox._pack_expand_fill(self.cancel)
        btns_hbox._pack_expand_fill(self.ok)
                
        main_vbox._pack_noexpand_nofill(header_hbox)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_noexpand_nofill(schema_table)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_noexpand_nofill(self.smtp_need_auth)
        main_vbox._pack_noexpand_nofill(auth_table)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_noexpand_nofill(self.smtp_encrypt_tls)
        main_vbox.pack_end(btns_hbox, False, False, 0)
        
        self.add(main_vbox)
    def __init__(self, label):
        gtk.Expander.__init__(self)
		
        self.set_use_markup(True)
        self.set_label(label)
		
        self.hbox = HIGHBox()
        self.hbox.set_border_width(5)
        self.hbox._pack_noexpand_nofill(hig_box_space_holder())
		
        self.add(self.hbox)
    def __init__(self, label):
        gtk.Expander.__init__(self)
		
        self.set_use_markup(True)
        self.set_label(label)
		
        self.hbox = HIGHBox()
        self.hbox.set_border_width(5)
        self.hbox._pack_noexpand_nofill(hig_box_space_holder())
		
        self.add(self.hbox)
示例#26
0
    def __init__(self):
        HIGVBox.__init__(self)
        self.set_spacing(12)
        
        self.description = HIGEntryLabel(_("""Umit generated the nmap command. \
Click Apply to finish this wizard."""))
        spacer = hig_box_space_holder()
        self.bar = ApplyBar()
        
        self._pack_noexpand_nofill(self.description)
        self._pack_expand_fill(spacer)
        self._pack_noexpand_nofill(self.bar)
 def __pack_widgets(self):   
     """
     """
     ######
     #BOXS     
     self.left_box._pack_noexpand_nofill(self.grade_box)
     self.left_box._pack_expand_fill(self.webtest_box)
     self.right_box._pack_noexpand_nofill(self.refresh_btn)
     self.right_box._pack_expand_fill(self.service_box)
     
     ##########
     #Grade Box
     self.grade_box._pack_noexpand_nofill(hig_box_space_holder()) 
     self.grade_box._pack_noexpand_nofill(self.grade_title)
     self.grade_box._pack_noexpand_nofill(hig_box_space_holder()) 
     self.grade_box._pack_noexpand_nofill(self.mark_box) 
     self.grade_box._pack_noexpand_nofill(hig_box_space_holder())      
                        
     #############
     #Website Test
     self.webtest_box._pack_noexpand_nofill(self.webtest_title)
     self.webtest_box._pack_noexpand_nofill(hig_box_space_holder()) 
     self.webtest_box._pack_noexpand_nofill(self.webtest_status_label)
     self.webtest_box._pack_noexpand_nofill(self.webtest_speed_label)
     self.webtest_box._pack_noexpand_nofill(self.webtest_throttled_label)                   
     ############
     #Service Box                
     self.service_box._pack_noexpand_nofill(hig_box_space_holder())
     self.service_box._pack_expand_fill(self.display_bar)
     self.service_box._pack_noexpand_nofill(hig_box_space_holder())         
     
     self.pack_start(self.left_box,True,True,2)
     self.pack_start(self.right_box,True,True,4)   
     self.show_all()
示例#28
0
 def __pack_widgets(self):   
     """
     """
     ######
     #BOXS     
     self.left_box._pack_noexpand_nofill(self.grade_box)
     self.left_box._pack_expand_fill(self.webtest_box)
     self.right_box._pack_noexpand_nofill(self.refresh_btn)
     self.right_box._pack_expand_fill(self.service_box)
     
     ##########
     #Grade Box
     self.grade_box._pack_noexpand_nofill(hig_box_space_holder()) 
     self.grade_box._pack_noexpand_nofill(self.grade_title)
     self.grade_box._pack_noexpand_nofill(hig_box_space_holder()) 
     self.grade_box._pack_noexpand_nofill(self.mark_box) 
     self.grade_box._pack_noexpand_nofill(hig_box_space_holder())      
                        
     #############
     #Website Test
     self.webtest_box._pack_noexpand_nofill(self.webtest_title)
     self.webtest_box._pack_noexpand_nofill(hig_box_space_holder()) 
     self.webtest_box._pack_noexpand_nofill(self.webtest_status_label)
     self.webtest_box._pack_noexpand_nofill(self.webtest_speed_label)
     self.webtest_box._pack_noexpand_nofill(self.webtest_throttled_label)                   
     ############
     #Service Box                
     self.service_box._pack_noexpand_nofill(hig_box_space_holder())
     self.service_box._pack_expand_fill(self.display_bar)
     self.service_box._pack_noexpand_nofill(hig_box_space_holder())         
     
     self.pack_start(self.left_box,True,True,2)
     self.pack_start(self.right_box,True,True,4)   
     self.show_all()
    def __do_layout(self):
        """
        Layout window widgets.
        """
        main_vbox = HIGVBox()
        main_vbox.set_border_width(5)
        main_vbox.set_spacing(12)
        header_hbox = HIGHBox()
        schedp_hbox = HIGHBox()
        cron_box = HIGVBox()
        cron_table = HIGTable(5, 2)
        btns_hbox = HIGHBox()

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

        schedp_hbox._pack_noexpand_nofill(self.schedp_name_lbl)
        schedp_hbox._pack_expand_fill(self.schedp_name)

        # cron format
        settings_align = gtk.Alignment(0.5, 0.5, 1, 1)
        settings_align.set_padding(6, 0, 12, 0)

        cron_table.attach(self.cron_minute_lbl, 0, 1, 0, 1)
        cron_table.attach(self.cron_minute, 1, 2, 0, 1)
        cron_table.attach(self.cron_hour_lbl, 0, 1, 1, 2)
        cron_table.attach(self.cron_hour, 1, 2, 1, 2)
        cron_table.attach(self.cron_day_lbl, 0, 1, 2, 3)
        cron_table.attach(self.cron_day, 1, 2, 2, 3)
        cron_table.attach(self.cron_month_lbl, 0, 1, 3, 4)
        cron_table.attach(self.cron_month, 1, 2, 3, 4)
        cron_table.attach(self.cron_weekday_lbl, 0, 1, 4, 5)
        cron_table.attach(self.cron_weekday, 1, 2, 4, 5)

        cron_box._pack_noexpand_nofill(cron_table)
        settings_align.add(cron_box)
        self.cron_frame.add(settings_align)

        # bottom buttons
        btns_hbox.set_homogeneous(True)
        btns_hbox._pack_expand_fill(self.help)
        btns_hbox._pack_expand_fill(hig_box_space_holder())
        btns_hbox._pack_expand_fill(self.apply)
        btns_hbox._pack_expand_fill(self.cancel)
        btns_hbox._pack_expand_fill(self.ok)

        main_vbox._pack_noexpand_nofill(header_hbox)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_noexpand_nofill(schedp_hbox)
        main_vbox._pack_noexpand_nofill(self.cron_frame)
        main_vbox.pack_end(btns_hbox, False, False, 0)
        self.add(main_vbox)
    def __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)
示例#31
0
    def __init__(self):
        HIGVBox.__init__(self)
        self.set_spacing(12)

        self.description = HIGEntryLabel(
            _("""Umit generated the nmap command. \
Click Apply to finish this wizard."""))
        spacer = hig_box_space_holder()
        self.bar = ApplyBar()

        self._pack_noexpand_nofill(self.description)
        self._pack_expand_fill(spacer)
        self._pack_noexpand_nofill(self.bar)
 def __pack_widgets(self):
     """"""
     self.hbox.pack_end(self.label,False,False)
     self.hbox.pack_end(hig_box_space_holder(),True,False)
     
     self.vbox.pack_start(self.hbox,True,False)
     
     self.fixed.put(self.vbox,0,0)
     self.add(self.fixed)
     self.set_background(self, None, self.mask, self.pixmap)
     self.shape_combine_mask(self.mask,0,0)
     self.show_all()
     
     gobject.timeout_add(self.timeout,self.destroy)
示例#33
0
    def __pack_widgets(self):
        """"""
        self.hbox.pack_end(self.label, False, False)
        self.hbox.pack_end(hig_box_space_holder(), True, False)

        self.vbox.pack_start(self.hbox, True, False)

        self.fixed.put(self.vbox, 0, 0)
        self.add(self.fixed)
        self.set_background(self, None, self.mask, self.pixmap)
        self.shape_combine_mask(self.mask, 0, 0)
        self.show_all()

        gobject.timeout_add(self.timeout, self.destroy)
示例#34
0
    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 _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)
    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())
示例#37
0
    def set_command_info(self, info):
        # Fix aligment!
        self.command_expander.set_use_markup(True)
        self.command_table.set_border_width(5)
        self.command_table.set_row_spacings(6)
        self.command_table.set_col_spacings(6)

        try:
            self.info_command_label.set_text(info['command'])
        except:
            pass

        try:
            self.info_nmap_version_label.set_text(info['version'])
        except:
            pass

        try:
            self.info_verbose_label.set_text(info['verbose'])
        except:
            pass

        try:
            self.info_debug_label.set_text(info['debug'])
        except:
            pass

        self.command_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.command_hbox._pack_noexpand_nofill(self.command_table)

        self.command_table.attach(self.command_label, 0, 1, 0, 1)
        self.command_table.attach(self.info_command_label, 1, 2, 0, 1)

        self.command_table.attach(self.nmap_version_label, 0, 1, 1, 2)
        self.command_table.attach(self.info_nmap_version_label, 1, 2, 1, 2)

        self.command_table.attach(self.verbose_label, 0, 1, 2, 3)
        self.command_table.attach(self.info_verbose_label, 1, 2, 2, 3)

        self.command_table.attach(self.debug_label, 0, 1, 3, 4)
        self.command_table.attach(self.info_debug_label, 1, 2, 3, 4)

        self.command_expander.add(self.command_hbox)
        self._pack_noexpand_nofill(self.command_expander)
        self.command_expander.set_expanded(True)
示例#38
0
 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 __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 __init__(self, image, time=1700):
        gtk.Window.__init__(self, gtk.WINDOW_POPUP)
        self.set_position(gtk.WIN_POS_CENTER)

        splash_img = gtk.gdk.pixbuf_new_from_file(image)
        pixmap, mask = splash_img.render_pixmap_and_mask()
        width, height = pixmap.get_size()
        del splash_img

        self.set_app_paintable(True)
        self.set_size_request(width, height)
        self.set_resizable(False)
        self.realize()

        self.verbox = gtk.VBox()
        self.version = gtk.Label("%s" % VERSION)

        self.version.set_use_markup(True)
        self.version.set_markup("<span size='19000' weight='heavy'>\
%s</span>" % VERSION)

        self.hor = gtk.HBox()
        self.hor.pack_end(self.version, True, False)
        self.hor.pack_end(hig_box_space_holder(), True, False)

        # These constants are derived from the dimensions of the open space in
        # the splash graphic. We attempt to center the version number.
        self.verbox.set_size_request(152, 56)
        self.verbox.pack_start(self.hor, True, False)

        fixed = gtk.Fixed()
        fixed.put(self.verbox, width - 152, height - (height - 26))
        self.add(fixed)

        self.hid = self.connect("expose-event", self.set_bg, mask, pixmap)
        self.set_bg(self, None, mask, pixmap)
        self.show_all()

        while gtk.events_pending():
            gtk.main_iteration()
        gobject.timeout_add(time, self.destroy)
示例#41
0
    def __init__(self, image, time=1700):
        gtk.Window.__init__(self, gtk.WINDOW_POPUP)
        self.set_position(gtk.WIN_POS_CENTER)

        splash_img = gtk.gdk.pixbuf_new_from_file(image)
        pixmap, mask = splash_img.render_pixmap_and_mask()
        width, height = pixmap.get_size()
        del splash_img

        self.set_app_paintable(True)
        self.set_size_request(width, height)
        self.set_resizable(False)
        self.realize()

        self.verbox = gtk.VBox()
        self.version = gtk.Label("%s" % VERSION)

        self.version.set_use_markup(True)
        self.version.set_markup("<span size='19000' weight='heavy'>\
%s</span>" % VERSION)

        self.hor = gtk.HBox()
        self.hor.pack_end(self.version, True, False)
        self.hor.pack_end(hig_box_space_holder(), True, False)

        # These constants are derived from the dimensions of the open space in
        # the splash graphic. We attempt to center the version number.
        self.verbox.set_size_request(152, 56)
        self.verbox.pack_start(self.hor, True, False)

        fixed = gtk.Fixed()
        fixed.put(self.verbox, width - 152, height - (height-26))
        self.add(fixed)

        self.hid = self.connect("expose-event", self.set_bg, mask, pixmap)
        self.set_bg(self, None, mask, pixmap)
        self.show_all()

        while gtk.events_pending():
            gtk.main_iteration()
        gobject.timeout_add(time, self.destroy)
示例#42
0
 def __init__(self, help=True, cancel=True, back=True, apply=True):
     HIGHBox.__init__(self)
     self.set_homogeneous(True)
     
     self.help = HIGButton(stock=gtk.STOCK_HELP)
     self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
     self.back = HIGButton(stock=gtk.STOCK_GO_BACK)
     self.apply = HIGButton(stock=gtk.STOCK_APPLY)
     
     self._pack_expand_fill(self.help)
     self._pack_expand_fill(hig_box_space_holder())
     self._pack_expand_fill(self.cancel)
     self._pack_expand_fill(self.back)
     self._pack_expand_fill(self.apply)
     
     if not help:
         self.help.set_sensitive(False)
     if not cancel:
         self.cancel.set_sensitive(False)
     if not back:
         self.back.set_sensitive(False)
     if not apply:
         self.apply.set_sensitive(False)
示例#43
0
    def __init__(self, help=True, cancel=True, back=True, apply=True):
        HIGHBox.__init__(self)
        self.set_homogeneous(True)

        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.back = HIGButton(stock=gtk.STOCK_GO_BACK)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)

        self._pack_expand_fill(self.help)
        self._pack_expand_fill(hig_box_space_holder())
        self._pack_expand_fill(self.cancel)
        self._pack_expand_fill(self.back)
        self._pack_expand_fill(self.apply)

        if not help:
            self.help.set_sensitive(False)
        if not cancel:
            self.cancel.set_sensitive(False)
        if not back:
            self.back.set_sensitive(False)
        if not apply:
            self.apply.set_sensitive(False)
示例#44
0
 def __init__(self, help=True, cancel=True, back=True, forward=True):
     HIGHBox.__init__(self)
     self.set_homogeneous(True)
     
     self.help = HIGButton(stock=gtk.STOCK_HELP)
     self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
     self.back = HIGButton(stock=gtk.STOCK_GO_BACK)
     self.forward = HIGButton(stock=gtk.STOCK_GO_FORWARD)
     
     self._pack_expand_fill(self.help)
     self._pack_expand_fill(hig_box_space_holder())
     self._pack_expand_fill(self.cancel)
     self._pack_expand_fill(self.back)
     self._pack_expand_fill(self.forward)
     
     if not help:
         self.help.set_sensitive(False)
     if not cancel:
         self.cancel.set_sensitive(False)
     if not back:
         self.back.set_sensitive(False)
     if not forward:
         self.forward.set_sensitive(False)
示例#45
0
    def __init__(self, help=True, cancel=True, back=True, forward=True):
        HIGHBox.__init__(self)
        self.set_homogeneous(True)

        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.back = HIGButton(stock=gtk.STOCK_GO_BACK)
        self.forward = HIGButton(stock=gtk.STOCK_GO_FORWARD)

        self._pack_expand_fill(self.help)
        self._pack_expand_fill(hig_box_space_holder())
        self._pack_expand_fill(self.cancel)
        self._pack_expand_fill(self.back)
        self._pack_expand_fill(self.forward)

        if not help:
            self.help.set_sensitive(False)
        if not cancel:
            self.cancel.set_sensitive(False)
        if not back:
            self.back.set_sensitive(False)
        if not forward:
            self.forward.set_sensitive(False)
 def set_command_info(self, info):
     # Fix aligment!
     self.command_expander.set_use_markup(True)
     self.command_table.set_border_width(5)
     self.command_table.set_row_spacings(6)
     self.command_table.set_col_spacings(6)
     
     try:self.info_command_label.set_text(info['command'])
     except:pass
     
     try:self.info_nmap_version_label.set_text(info['version'])
     except:pass
     
     try:self.info_verbose_label.set_text(info['verbose'])
     except:pass
     
     try:self.info_debug_label.set_text(info['debug'])
     except:pass
     
     self.command_hbox._pack_noexpand_nofill(hig_box_space_holder())
     self.command_hbox._pack_noexpand_nofill(self.command_table)
     
     self.command_table.attach(self.command_label,0,1,0,1)
     self.command_table.attach(self.info_command_label,1,2,0,1)
     
     self.command_table.attach(self.nmap_version_label,0,1,1,2)
     self.command_table.attach(self.info_nmap_version_label,1,2,1,2)
     
     self.command_table.attach(self.verbose_label,0,1,2,3)
     self.command_table.attach(self.info_verbose_label,1,2,2,3)
     
     self.command_table.attach(self.debug_label,0,1,3,4)
     self.command_table.attach(self.info_debug_label,1,2,3,4)
     
     self.command_expander.add(self.command_hbox)
     self._pack_noexpand_nofill(self.command_expander)
     self.command_expander.set_expanded(True)
示例#47
0
    def set_general_info(self, info):
        # Fix aligment!
        self.general_expander.set_use_markup(True)
        self.general_table.set_border_width(5)
        self.general_table.set_row_spacings(6)
        self.general_table.set_col_spacings(6)

        try:
            self.info_start_label.set_text(info['start'])
        except:
            pass

        try:
            self.info_finished_label.set_text(info['finish'])
        except:
            pass

        try:
            self.info_hosts_up_label.set_text(info['hosts_up'])
        except:
            pass

        try:
            self.info_hosts_down_label.set_text(info['hosts_down'])
        except:
            pass

        try:
            self.info_hosts_scanned_label.set_text(info['hosts_scanned'])
        except:
            pass

        #try:
        self.info_open_label.set_text(info['open_ports'])
        #except:pass

        #try:
        self.info_filtered_label.set_text(info['filtered_ports'])
        #except:pass

        #try:
        self.info_closed_label.set_text(info['closed_ports'])
        #except:pass

        self.general_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.general_hbox._pack_noexpand_nofill(self.general_table)

        self.general_table.attach(self.start_label, 0, 1, 0, 1)
        self.general_table.attach(self.info_start_label, 1, 2, 0, 1)

        self.general_table.attach(self.finished_label, 0, 1, 1, 2)
        self.general_table.attach(self.info_finished_label, 1, 2, 1, 2)

        self.general_table.attach(self.host_up_label, 0, 1, 2, 3)
        self.general_table.attach(self.info_hosts_up_label, 1, 2, 2, 3)

        self.general_table.attach(self.host_down_label, 0, 1, 3, 4)
        self.general_table.attach(self.info_hosts_down_label, 1, 2, 3, 4)

        self.general_table.attach(self.host_scanned_label, 0, 1, 4, 5)
        self.general_table.attach(self.info_hosts_scanned_label, 1, 2, 4, 5)

        self.general_table.attach(self.open_label, 0, 1, 5, 6)
        self.general_table.attach(self.info_open_label, 1, 2, 5, 6)

        self.general_table.attach(self.filtered_label, 0, 1, 6, 7)
        self.general_table.attach(self.info_filtered_label, 1, 2, 6, 7)

        self.general_table.attach(self.closed_label, 0, 1, 7, 8)
        self.general_table.attach(self.info_closed_label, 1, 2, 7, 8)

        self.general_expander.add(self.general_hbox)
        self._pack_noexpand_nofill(self.general_expander)
        self.general_expander.set_expanded(True)
示例#48
0
 def _pack_hbox (self):
     self.hbox.set_border_width(5)
     self.hbox._pack_noexpand_nofill (hig_box_space_holder())
     self.hbox._pack_expand_fill(self.scrolled)
示例#49
0
    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)
示例#50
0
 def _pack_hbox (self):
     self.hbox._pack_noexpand_nofill(hig_box_space_holder())
     self.hbox._pack_expand_fill(self.table)
    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())
        main_vbox._pack_noexpand_nofill(bgfill_vbox)
        main_vbox._pack_noexpand_nofill(gtk.HSeparator())
        main_vbox._pack_noexpand_nofill(selectfill_vbox)
        main_vbox.pack_end(btns_hbox, False, False, 0)
        main_vbox.pack_end(gtk.HSeparator(), False, False, 0)
        self.add(main_vbox)
    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)
示例#53
0
    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)
示例#54
0
 def _pack_hbox(self):
     self.hbox._pack_noexpand_nofill(hig_box_space_holder())
     self.hbox._pack_expand_fill(self.table)
示例#55
0
 def _pack_hbox(self):
     self.hbox.set_border_width(5)
     self.hbox._pack_noexpand_nofill(hig_box_space_holder())
     self.hbox._pack_expand_fill(self.scrolled)
示例#56
0
    def _pack_widgets(self):
        # Packing result section
        self.result_vbox.set_border_width(12)
        self.result_vbox._pack_noexpand_nofill(self.result_section)
        self.result_vbox._pack_expand_fill(self.result_hbox)

        self.result_scrolled.set_size_request(185, -1)
        #self.result_scrolled.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        self.result_scrolled.add(self.result_view)
        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)
        self.host_table.attach_label(self.host_ipv4_label, 0, 1, 2, 3)
        self.host_table.attach_label(self.host_ipv6_label, 0, 1, 3, 4)

        self.host_table.attach_entry(self.host_target_combo, 1, 2, 0, 1)
        self.host_table.attach_entry(self.host_mac_entry, 1, 2, 1, 2)
        self.host_table.attach_entry(self.host_ipv4_entry, 1, 2, 2, 3)
        self.host_table.attach_entry(self.host_ipv6_entry, 1, 2, 3, 4)
        
        self.search_notebook.append_page(self.host_vbox, gtk.Label(_("Host")))

        # Service page
        self.serv_vbox.set_border_width(12)
        self.serv_vbox._pack_noexpand_nofill(self.serv_section)
        self.serv_vbox._pack_noexpand_nofill(self.serv_hbox)
        
        self.serv_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.serv_hbox._pack_expand_fill(self.serv_table)

        self.serv_table.attach_label(self.serv_port_label, 0, 1, 0, 1)
        self.serv_table.attach_label(self.serv_portstate_label, 0, 1, 1, 2)
        self.serv_table.attach_label(self.serv_product_label, 0, 1, 2, 3)
        self.serv_table.attach_label(self.serv_service_label, 0, 1, 3, 4)

        self.serv_table.attach_entry(self.serv_port_entry, 1, 2, 0, 1)
        self.serv_table.attach_entry(self.serv_portstate_check, 1, 2, 1, 2)
        self.serv_table.attach_entry(self.serv_product_entry, 1, 2, 2, 3)
        self.serv_table.attach_entry(self.serv_service_combo, 1, 2, 3, 4)
        
        self.search_notebook.append_page(self.serv_vbox,
                                         gtk.Label(_("Service")))

        # OS page
        self.os_vbox.set_border_width(12)
        self.os_vbox._pack_noexpand_nofill(self.os_section)
        self.os_vbox._pack_noexpand_nofill(self.os_hbox)

        self.os_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.os_hbox._pack_expand_fill(self.os_table)

        self.os_table.attach_label(self.os_osclass_label, 0, 1, 0, 1)
        self.os_table.attach_label(self.os_osmatch_label, 0, 1, 1, 2)

        self.os_table.attach_entry(self.os_osclass_combo, 1, 2, 0, 1)
        self.os_table.attach_entry(self.os_osmatch_combo, 1, 2, 1, 2)

        self.search_notebook.append_page(self.os_vbox, gtk.Label(_("OS")))

        # Search options page
        self.opt_vbox.set_border_width(12)
        self.opt_vbox._pack_noexpand_nofill(self.opt_local_section)
        self.opt_vbox._pack_noexpand_nofill(self.opt_local_hbox)
        
        self.opt_vbox._pack_noexpand_nofill(self.opt_base_section)
        self.opt_vbox._pack_noexpand_nofill(self.opt_base_hbox)

        self.opt_local_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.opt_local_hbox._pack_expand_fill(self.opt_local_table)

        self.opt_base_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.opt_base_hbox._pack_expand_fill(self.opt_base_table)

        self.opt_local_table.attach_label(self.opt_path_label, 0, 1, 0, 1)
        self.opt_local_table.attach_label(self.opt_extension_label, 0, 1, 1, 2)
        
        self.opt_local_table.attach_entry(self.opt_path_entry, 1, 2, 0, 1)
        self.opt_local_table.attach_entry(self.opt_extension_entry, 1, 2, 1, 2)

        self.opt_base_table.attach_label(self.opt_savetime_label, 0, 1, 0, 1)
        self.opt_base_table.attach_label(self.opt_save_check, 0, 2, 1, 2)
        self.opt_base_table.attach_label(self.opt_search_check, 0, 2, 2, 3)

        self.opt_base_table.attach_entry(self.opt_savetime_entry, 1, 2, 0, 1)


        self.search_notebook.append_page(self.opt_vbox,
                                         gtk.Label(_("Search options")))

        self.pack1(self.search_vbox, True, False)
        self.pack2(self.result_vbox, True, False)