def __create_widgets(self): """ """ self.__hbox = BWHBox(spacing=0) self.__vbox = BWVBox(spacing=0) self.__radialnet = RadialNet(LAYOUT_WEIGHTED) self.__control = ControlWidget(self.__radialnet) self.__fisheye = ControlFisheye(self.__radialnet) self.__toolbar = Toolbar(self.__radialnet, self, self.__control, self.__fisheye) self.__statusbar = BWStatusbar() self.__hbox.bw_pack_start_expand_fill(self.__radialnet) self.__hbox.bw_pack_start_noexpand_nofill(self.__control) self.__vbox.bw_pack_start_noexpand_nofill(self.__toolbar) self.__vbox.bw_pack_start_expand_fill(self.__hbox) self.__vbox.bw_pack_start_noexpand_nofill(self.__fisheye) self.__vbox.bw_pack_start_noexpand_nofill(self.__statusbar) self.add(self.__vbox) self.set_title(" ".join([INFO['name'], INFO['version']])) self.set_position(gtk.WIN_POS_CENTER) self.show_all() self.connect('destroy', gtk.main_quit) self.__radialnet.set_no_show_all(True) self.__control.set_no_show_all(True) self.__fisheye.set_no_show_all(True) self.__radialnet.hide() self.__control.hide() self.__fisheye.hide() self.__toolbar.disable_controls()
def _create_widgets(self): self.rn_hbox = gtk.HBox() self.rn_hbox.set_spacing(4) self.rn_vbox = gtk.VBox() # RadialNet's widgets self.radialnet = RadialNet.RadialNet(RadialNet.LAYOUT_WEIGHTED) self.control = ControlWidget(self.radialnet) self.fisheye = ControlFisheye(self.radialnet) self.rn_toolbar = Toolbar(self.radialnet, self, self.control, self.fisheye) self.display_panel = HIGVBox() self.radialnet.set_no_show_all(True) self.slow_vbox = HIGVBox() self.slow_label = gtk.Label() self.slow_vbox.pack_start(self.slow_label, False, False) show_button = gtk.Button(_("Show the topology anyway")) show_button.connect("clicked", self.show_anyway) self.slow_vbox.pack_start(show_button, False, False) self.slow_vbox.show_all() self.slow_vbox.set_no_show_all(True) self.slow_vbox.hide() self.radialnet.show()
def __create_widgets(self): """ """ self.__hbox = BWHBox(spacing=0) self.__vbox = BWVBox(spacing=0) self.__radialnet = RadialNet(LAYOUT_WEIGHTED) self.__control = ControlWidget(self.__radialnet) self.__fisheye = ControlFisheye(self.__radialnet) self.__toolbar = Toolbar(self.__radialnet, self, self.__control, self.__fisheye) self.__statusbar = BWStatusbar() self.__hbox.bw_pack_start_expand_fill(self.__radialnet) self.__hbox.bw_pack_start_noexpand_nofill(self.__control) self.__vbox.bw_pack_start_noexpand_nofill(self.__toolbar) self.__vbox.bw_pack_start_expand_fill(self.__hbox) self.__vbox.bw_pack_start_noexpand_nofill(self.__fisheye) self.__vbox.bw_pack_start_noexpand_nofill(self.__statusbar) self.add(self.__vbox) self.set_title(" ".join([INFO["name"], INFO["version"]])) self.set_position(gtk.WIN_POS_CENTER) self.show_all() self.connect("destroy", gtk.main_quit) self.__radialnet.set_no_show_all(True) self.__control.set_no_show_all(True) self.__fisheye.set_no_show_all(True) self.__radialnet.hide() self.__control.hide() self.__fisheye.hide() self.__toolbar.disable_controls()
class Application(BWMainWindow): """ """ def __init__(self): """ """ BWMainWindow.__init__(self) self.set_default_size(DIMENSION[0], DIMENSION[1]) self.set_icon(Pixmaps().get_pixbuf('logo')) self.__create_widgets() def __create_widgets(self): """ """ self.__hbox = BWHBox(spacing=0) self.__vbox = BWVBox(spacing=0) self.__radialnet = RadialNet(LAYOUT_WEIGHTED) self.__control = ControlWidget(self.__radialnet) self.__fisheye = ControlFisheye(self.__radialnet) self.__toolbar = Toolbar(self.__radialnet, self, self.__control, self.__fisheye) self.__statusbar = BWStatusbar() self.__hbox.bw_pack_start_expand_fill(self.__radialnet) self.__hbox.bw_pack_start_noexpand_nofill(self.__control) self.__vbox.bw_pack_start_noexpand_nofill(self.__toolbar) self.__vbox.bw_pack_start_expand_fill(self.__hbox) self.__vbox.bw_pack_start_noexpand_nofill(self.__fisheye) self.__vbox.bw_pack_start_noexpand_nofill(self.__statusbar) self.add(self.__vbox) self.set_title(" ".join([INFO['name'], INFO['version']])) self.set_position(gtk.WIN_POS_CENTER) self.show_all() self.connect('destroy', gtk.main_quit) self.__radialnet.set_no_show_all(True) self.__control.set_no_show_all(True) self.__fisheye.set_no_show_all(True) self.__radialnet.hide() self.__control.hide() self.__fisheye.hide() self.__toolbar.disable_controls() def parse_nmap_xml_file(self, file): """ """ try: self.__parser = XMLReader(file) self.__parser.parse() except: text = 'It is not possible open file: %s.' % file alert = BWAlertDialog(self, primary_text='Error opening file.', secondary_text=text) alert.show_all() return False self.__radialnet.set_empty() self.__radialnet.set_graph(make_graph_from_nmap_parser(self.__parser)) self.__radialnet.show() self.__toolbar.enable_controls() return True def start(self): """ """ gtk.main()