Ejemplo n.º 1
0
    def __init__(self, node, position, parent):
        """
        """
        HIGWindow.__init__(self, gtk.WINDOW_POPUP)
        self.set_decorated(False)
        self.set_keep_above(True)
        self.set_skip_taskbar_hint(True)
        self.move(position[0], position[1])
        self.set_size_request(DIMENSION_NORMAL[0], DIMENSION_NORMAL[1])

        self.__button_press_position = self.get_pointer()

        self.__is_compacted = True
        self.__is_collapsed = False

        self.__node = node
        self.__pressed = False
        self.__parent = parent

        self.connect('button_press_event', self.button_press)
        self.connect('button_release_event', self.button_release)
        self.connect('enter_notify_event', self.enter_notify)
        self.connect('leave_notify_event', self.leave_notify)
        self.connect('motion_notify_event', self.motion_notify)

        self.__title_font = pango.FontDescription('Monospace Bold')

        self.add_events(gtk.gdk.BUTTON_PRESS_MASK | gtk.gdk.BUTTON_RELEASE_MASK
                        | gtk.gdk.POINTER_MOTION_MASK | gtk.gdk.ENTER_NOTIFY
                        | gtk.gdk.LEAVE_NOTIFY
                        | gtk.gdk.POINTER_MOTION_HINT_MASK)

        self.__icon = Application()
        self.__create_widgets()
Ejemplo n.º 2
0
 def __init__(self):
     HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
     self.set_title(_('OpenMonitor Preferences'))
     self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
             
     self.__create_widgets()
     self.__pack_widgets()
     self.load_preference()
Ejemplo n.º 3
0
    def __init__(self):
        HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
        self.set_title(_('Super Peers List'))
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

        self.__create_widgets()
        self.__pack_widgets()
        self.__load_super_peers()
 def __init__(self):
     HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
     self.set_title(_('Super Peers List'))
     self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
     
     self.__create_widgets()
     self.__pack_widgets()
     self.__load_super_peers()
    def __init__(self):
        HIGWindow.__init__(self)
        self.set_title(_("Umit credits"))
        self.set_size_request(-1, 450)
        self.set_position(gtk.WIN_POS_CENTER)

        self.__create_widgets()
        self.__packing()
        self.set_text()
    def __init__(self):
        HIGWindow.__init__(self)

        self.wtitle = _("SMTP Account Editor")

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # schemas name
        self.schema_name_lbl = HIGEntryLabel(_("Schema name"))
        self.schema_name = gtk.combo_box_entry_new_text()
        self.schema_name.connect('changed', self._check_schema)
        # smtp server
        self.smtp_server_lbl = HIGEntryLabel(_("Server"))
        self.smtp_server = gtk.Entry()
        self.smtp_port_lbl = HIGEntryLabel(_("Port"))
        self.smtp_port = gtk.Entry()
        # sending mail..
        self.smtp_mailfrom_lbl = HIGEntryLabel(_("Mail from"))
        self.smtp_mailfrom = gtk.Entry()
        # smtp auth
        self.smtp_need_auth = gtk.CheckButton(
            _("Servers requires authentication"))
        self.smtp_need_auth.connect('toggled', self._auth_need)
        self.smtp_login_lbl = HIGEntryLabel(_("Username"))
        self.smtp_login = gtk.Entry()
        self.smtp_passwd_lbl = HIGEntryLabel(_("Password"))
        self.smtp_passwd = gtk.Entry()
        self.smtp_passwd.set_visibility(False)
        self._auth_need(None)
        # smtp encryption
        self.smtp_encrypt_tls = gtk.CheckButton(_("Use TLS Encryption"))
        """
        Missing: SSL encryption,
                 Other authentication methods.
        """

        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect('clicked', self._show_help)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.apply.connect('clicked', self._save_schema)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect('clicked', self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect('clicked', self._save_schema_and_leave)

        self.load_schemas()

        self.__set_props()
        self.__do_layout()

        self.connect('destroy', self._exit)
Ejemplo n.º 7
0
 def __init__(self):
     HIGWindow.__init__(self)
     self.set_title(_("Umit credits"))
     self.set_size_request(-1, 450)
     self.set_position(gtk.WIN_POS_CENTER)
     
     self.__create_widgets()
     self.__packing()
     self.set_text()
Ejemplo n.º 8
0
 def __init__(self):
     HIGWindow.__init__(self)
     self.set_title(_("About Umit"))
     self.set_position(gtk.WIN_POS_CENTER)
     
     self.__create_widgets()
     self.__packing()
     self.__set_img()
     self.__set_text()
Ejemplo n.º 9
0
    def __init__(self):
        HIGWindow.__init__(self)
        
        self.wtitle = _("SMTP Account Editor")

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # schemas name
        self.schema_name_lbl = HIGEntryLabel(_("Schema name"))
        self.schema_name = gtk.combo_box_entry_new_text()
        self.schema_name.connect('changed', self._check_schema)
        # smtp server
        self.smtp_server_lbl = HIGEntryLabel(_("Server"))
        self.smtp_server = gtk.Entry()
        self.smtp_port_lbl = HIGEntryLabel(_("Port"))
        self.smtp_port = gtk.Entry()
        # sending mail..
        self.smtp_mailfrom_lbl = HIGEntryLabel(_("Mail from"))
        self.smtp_mailfrom = gtk.Entry()
        # smtp auth
        self.smtp_need_auth = gtk.CheckButton(_("Servers requires authentication"))
        self.smtp_need_auth.connect('toggled', self._auth_need)
        self.smtp_login_lbl = HIGEntryLabel(_("Username"))
        self.smtp_login = gtk.Entry()
        self.smtp_passwd_lbl = HIGEntryLabel(_("Password"))
        self.smtp_passwd = gtk.Entry()
        self.smtp_passwd.set_visibility(False)
        self._auth_need(None)
        # smtp encryption
        self.smtp_encrypt_tls = gtk.CheckButton(_("Use TLS Encryption"))

        """
        Missing: SSL encryption,
                 Other authentication methods.
        """ 

        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect('clicked', self._show_help)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.apply.connect('clicked', self._save_schema)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect('clicked', self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect('clicked', self._save_schema_and_leave)
        
        self.load_schemas()
        
        self.__set_props()
        self.__do_layout()

        self.connect('destroy', self._exit)
    def __init__(self):
        HIGWindow.__init__(self)
        self.set_title(_("About Umit"))
        self.set_position(gtk.WIN_POS_CENTER)

        self.__create_widgets()
        self.__packing()
        self.__set_img()
        self.__set_text()
Ejemplo n.º 11
0
 def __init__(self):
     HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
     self.set_title(_('Logs'))
     self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
     self.set_size_request(720,480)
     self.set_border_width(10)
     
     self.__create_widgets()
     self.__pack_widgets()
     self.__connect_widgets()
Ejemplo n.º 12
0
 def __init__(self):
     HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
     self.set_title(_('Logs'))
     self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
     self.set_size_request(720,480)
     self.set_border_width(10)
     
     self.__create_widgets()
     self.__pack_widgets()
     self.__connect_widgets()
    def __init__(self, daddy=None):
        HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
        self.set_title('Profile Manager')
        self.set_position(gtk.WIN_POS_CENTER)
        self.__create_widgets()
        self.add(self.vbox_main)
        self.__fill_widgets()
        self.__pack_widgets()
        self.__scan_notebook = None

        self.daddy = daddy
Ejemplo n.º 14
0
    def __init__(self):
        """"""
        HIGWindow.__init__(self)
        self.set_title("About Open Monitor Desktop Agent")
        self.set_position(gtk.WIN_POS_CENTER)

        self.__create_widgets()
        self.__packing()
        self.__connect_widgets()
        self.__set_img()
        self.__set_text()
Ejemplo n.º 15
0
    def __init__(self):
        """"""
        HIGWindow.__init__(self)
        self.set_title("About Open Monitor Desktop Agent")
        self.set_position(gtk.WIN_POS_CENTER)

        self.__create_widgets()
        self.__packing()
        self.__connect_widgets()
        self.__set_img()
        self.__set_text()
Ejemplo n.º 16
0
 def __init__(self, daddy=None):
     HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
     self.set_title('Profile Manager')
     self.set_position(gtk.WIN_POS_CENTER)
     self.__create_widgets()
     self.add(self.vbox_main)
     self.__fill_widgets()
     self.__pack_widgets()
     self.__scan_notebook = None
     
     self.daddy = daddy
Ejemplo n.º 17
0
    def __init__(self):
        HIGWindow.__init__(self)

        self.engine = PluginEngine()
        self.update_eng = UpdateEngine()

        self.set_title(_('Plugin Manager'))
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_size_request(600, 400)
        self.set_icon_from_file(os.path.join(Path.icons_dir, "umit_16.ico"))

        self.__create_widgets()
        self.__pack_widgets()
Ejemplo n.º 18
0
    def __init__(self):
        HIGWindow.__init__(self)

        self.engine = PluginEngine()
        self.update_eng = UpdateEngine()

        self.set_title(_('Plugin Manager'))
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_size_request(600, 400)
        self.set_icon_from_file(os.path.join(Path.icons_dir, "umit_16.ico"))

        self.__create_widgets()
        self.__pack_widgets()
    def __init__(self):
        HIGWindow.__init__(self)

        self.iimg = gtk.Image()
        self.iimg.set_from_stock(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_DIALOG)

        self.topic = gtk.Label()
        self.topic.set_markup(_("<b>Please wait...</b>"))
        self.message = gtk.Label(
            _("Removing data from Network Inventory database"))

        self.connect('realize', self.start_removal)

        self.__layout()
Ejemplo n.º 20
0
    def __init__(self):
        HIGWindow.__init__(self)

        self.iimg = gtk.Image()
        self.iimg.set_from_stock(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_DIALOG)

        self.topic = gtk.Label()
        self.topic.set_markup(_("<b>Please wait...</b>"))
        self.message = gtk.Label(
            _("Removing data from Network Inventory database"))

        self.connect('realize', self.start_removal)

        self.__layout()
Ejemplo n.º 21
0
    def __init__(self):
        HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)

        self.location_user = Location()  #user location information
        self.location_user.longitude = 0.0
        self.location_user.latitude = 0.0

        self.set_title(_('Events List'))
        self.set_size_request(720, 580)
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

        self.__create_widgets()
        self.__pack_widgets()
        self.__connect_widgets()

        self.__load_events()
Ejemplo n.º 22
0
 def __init__(self):
     HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
     
     self.location_user = Location() #user location information
     self.location_user.longitude = 0.0
     self.location_user.latitude  = 0.0
      
     self.set_title(_('Events List'))
     self.set_size_request(720, 580)
     self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
     
     self.__create_widgets()
     self.__pack_widgets()
     self.__connect_widgets()
     
     self.__load_events()
    def __init__(self, profile_name=None, delete=False):
        HIGWindow.__init__(self)
        self.set_title(_('Profile Editor'))
        self.set_position(gtk.WIN_POS_CENTER)
        self.profile_name = profile_name
        self.__create_widgets()
        self.__pack_widgets()

        self.scan_notebook = None
        self.profilemanager = None

        self.profile = CommandProfile()

        self.deleted = False
        options_used = {}

        if profile_name:
            log.debug("Showing profile %s" % profile_name)
            prof = self.profile.get_profile(profile_name)
            options_used = prof['options']

            # Interface settings
            self.profile_name_entry.set_text(profile_name)
            self.profile_hint_entry.set_text(prof['hint'])
            self.profile_description_text.get_buffer().set_text(
                prof['description'])
            self.profile_annotation_text.get_buffer().set_text(
                prof['annotation'])

            if delete:
                # Removing profile. It must be saved again
                self.remove_profile()

        self.constructor = CommandConstructor(options_used)
        self.options = OptionBuilder(profile_editor_file, self.constructor,
                                     self.update_command)
        log.debug("Option groups: %s" % str(self.options.groups))
        log.debug("Option section names: %s" % str(self.options.section_names))
        #log.debug("Option tabs: %s" % str(self.options.tabs))

        for tab in self.options.groups:
            self.__create_tab(tab, self.options.section_names[tab],
                              self.options.tabs[tab])

        self.update_command()
    def __init__(self, daddy, profile=None):
        HIGWindow.__init__(self)
        self.daddy = daddy

        self.wtitle = _("Scheduling Profiles Editor")
        self.start_profile = profile

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # profiles name
        self.schedp_name_lbl = HIGEntryLabel(_("Scheduling Profile"))
        self.schedp_name = gtk.combo_box_entry_new_text()
        self.schedp_name.connect('changed', self._check_profile)
        # cron format
        self.cron_frame = HIGFrame(_("Schedule"))
        self.cron_minute_lbl = HIGEntryLabel(_("Minute"))
        self.cron_minute = gtk.Entry()
        self.cron_hour_lbl = HIGEntryLabel(_("Hour"))
        self.cron_hour = gtk.Entry()
        self.cron_day_lbl = HIGEntryLabel(_("Day of month"))
        self.cron_day = gtk.Entry()
        self.cron_month_lbl = HIGEntryLabel(_("Month"))
        self.cron_month = gtk.Entry()
        self.cron_weekday_lbl = HIGEntryLabel(_("Weekday"))
        self.cron_weekday = gtk.Entry()
        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect('clicked', self._show_help)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.apply.connect('clicked', self._save_profile)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect('clicked', self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect('clicked', self._save_profile_and_leave)

        self.load_profiles()
        self.__set_props()
        self.__do_layout()

        self.connect('destroy', self._exit)
Ejemplo n.º 25
0
    def __init__(self, daddy, profile=None):
        HIGWindow.__init__(self)
        self.daddy = daddy

        self.wtitle = _("Scheduling Profiles Editor")
        self.start_profile = profile

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # profiles name
        self.schedp_name_lbl = HIGEntryLabel(_("Scheduling Profile"))
        self.schedp_name = gtk.combo_box_entry_new_text()
        self.schedp_name.connect("changed", self._check_profile)
        # cron format
        self.cron_frame = HIGFrame(_("Schedule"))
        self.cron_minute_lbl = HIGEntryLabel(_("Minute"))
        self.cron_minute = gtk.Entry()
        self.cron_hour_lbl = HIGEntryLabel(_("Hour"))
        self.cron_hour = gtk.Entry()
        self.cron_day_lbl = HIGEntryLabel(_("Day of month"))
        self.cron_day = gtk.Entry()
        self.cron_month_lbl = HIGEntryLabel(_("Month"))
        self.cron_month = gtk.Entry()
        self.cron_weekday_lbl = HIGEntryLabel(_("Weekday"))
        self.cron_weekday = gtk.Entry()
        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect("clicked", self._show_help)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.apply.connect("clicked", self._save_profile)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect("clicked", self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect("clicked", self._save_profile_and_leave)

        self.load_profiles()
        self.__set_props()
        self.__do_layout()

        self.connect("destroy", self._exit)
Ejemplo n.º 26
0
 def __init__(self):
     HIGWindow.__init__(self)
     self.set_size_request(600,450)
     self.set_position(gtk.WIN_POS_CENTER)
     
     self.profile = CommandProfile()
     self.constructor = CommandConstructor()
     self.options = OptionBuilder(wizard_file,
                                  self.constructor,
                                  self.update_command)
     
     self.target = '<target>'
     self.profilemanager = False 
     self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
     self.directions = {'Start':self.start_page(),
                        'Choose':self.choose_page(),
                        'Profile':self.profile_page(),
                        'Finish':self.finish_page(),
                        'LastPage':None}
     
     for i in xrange(len(self.options.groups)):
         step = self.options.groups[i]
         last, next = self.__get_pair(i)
         
         self.directions[step] = self.__create_steps(step,
                                     last,
                                     next,
                                     self.options.section_names[step],
                                     self.options.tabs[step])
     
     self.directions['Command'] = self.command_page()
     
     self.main_vbox = HIGVBox()
     self.main_vbox.set_border_width(5)
     self.main_vbox.set_spacing(12)
     self.add(self.main_vbox)
     
     self.__create_wizard_widgets()
     self.set_title(_("Umit Command constructor wizard"))
     
     self.main_vbox._pack_expand_fill(self.directions['Start'])
     self.set_notebook(None)
     
     self.update_command()
Ejemplo n.º 27
0
    def __init__(self):
        HIGWindow.__init__(self)
        self.set_size_request(600, 450)
        self.set_position(gtk.WIN_POS_CENTER)

        self.profile = CommandProfile()
        self.constructor = CommandConstructor()
        self.options = OptionBuilder(wizard_file, self.constructor,
                                     self.update_command)

        self.target = '<target>'
        self.profilemanager = False
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.directions = {
            'Start': self.start_page(),
            'Choose': self.choose_page(),
            'Profile': self.profile_page(),
            'Finish': self.finish_page(),
            'LastPage': None
        }

        for i in xrange(len(self.options.groups)):
            step = self.options.groups[i]
            last, next = self.__get_pair(i)

            self.directions[step] = self.__create_steps(
                step, last, next, self.options.section_names[step],
                self.options.tabs[step])

        self.directions['Command'] = self.command_page()

        self.main_vbox = HIGVBox()
        self.main_vbox.set_border_width(5)
        self.main_vbox.set_spacing(12)
        self.add(self.main_vbox)

        self.__create_wizard_widgets()
        self.set_title(_("Umit Command constructor wizard"))

        self.main_vbox._pack_expand_fill(self.directions['Start'])
        self.set_notebook(None)

        self.update_command()
    def __fullscreen_callback(self, widget=None):
        """
        """
        if self.__fullscreen.get_active():

            self.__fullscreen_window = HIGWindow()
            self.__fullscreen_window.connect('delete-event',
                                             self.__fullscreen_exit)
            self.__notebook = self.__window.get_parent()
            self.__window.reparent(self.__fullscreen_window)
            self.__fullscreen_window.show()
            self.__fullscreen_window.fullscreen()

        else:

            self.__window.reparent(self.__notebook)
            self.__notebook.set_tab_label_text(self.__window, _('Topology'))
            self.__notebook.set_current_page(
                self.__notebook.page_num(self.__window))
            self.__fullscreen_window.hide()
Ejemplo n.º 29
0
    def __init__(self):
        HIGWindow.__init__(self)

        self.tooltips = gtk.Tooltips()
        self.data_lbl = HIGSectionLabel(_("Delete data older than"))
        self.days_lbl = HIGSectionLabel(_("days"))
        self.days = gtk.SpinButton(gtk.Adjustment(value=get_decays()[1],
            lower=0, upper=5000, step_incr=1), 1)

        self.tooltips.set_tip(self.days,
            _("Set value as 0 to disable data removal"))

        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)

        self.cancel.connect("clicked", self._exit)
        self.apply.connect("clicked", self._set_new_decay)

        self.__set_props()
        self.__do_layout()
Ejemplo n.º 30
0
    def __init__(self, profile_name=None, delete=False):
        HIGWindow.__init__(self)
        self.set_title(_('Profile Editor'))
        self.set_position(gtk.WIN_POS_CENTER)
        self.profile_name=profile_name
        self.__create_widgets()
        self.__pack_widgets()

        self.scan_notebook = None
        self.profilemanager = None

        self.profile = CommandProfile()

        self.deleted = False
        options_used = {}

        if profile_name:
            log.debug("Showing profile %s" % profile_name)
            prof = self.profile.get_profile(profile_name)
            options_used = prof['options']

            # Interface settings
            self.profile_name_entry.set_text(profile_name)
            self.profile_hint_entry.set_text(prof['hint'])
            self.profile_description_text.get_buffer().set_text(prof['description'])
            self.profile_annotation_text.get_buffer().set_text(prof['annotation'])

            if delete:
                # Removing profile. It must be saved again
                self.remove_profile()

        self.constructor = CommandConstructor(options_used)
        self.options = OptionBuilder(profile_editor_file, self.constructor, self.update_command)
        log.debug("Option groups: %s" % str(self.options.groups))
        log.debug("Option section names: %s" % str(self.options.section_names))
        #log.debug("Option tabs: %s" % str(self.options.tabs))

        for tab in self.options.groups:
            self.__create_tab(tab, self.options.section_names[tab], self.options.tabs[tab])

        self.update_command()
    def __init__(self):
        """
        """
        HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
        self.set_title(_('OpenMonitor Dashboard'))
        self.set_border_width(10)
        self.set_size_request(1280, 820)
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

        self.cur_tab = CAPACITY

        self.switch_dict = {}
        self.conn_type = None
        self.task_type = None
        self.create_tabs = False

        self.connector = Connector()

        self.__create_widgets()
        self.__pack_widgets()
        self.create_switch()
Ejemplo n.º 32
0
 def __init__(self):
     """
     """
     HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
     self.set_title(_('OpenMonitor Dashboard'))
     self.set_border_width(10)
     self.set_size_request(1280, 820)
     self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
     
     self.cur_tab = CAPACITY
     
     self.switch_dict = {}
     self.conn_type = None
     self.task_type = None
     self.create_tabs = False
     
     self.connector = Connector()
     
     self.__create_widgets()
     self.__pack_widgets()
     self.create_switch()
Ejemplo n.º 33
0
    def __init__(self):
        HIGWindow.__init__(self)

        self.lbl_program_version = gtk.Label(
                ("<span size='30000' weight='heavy'>UMIT %s</span>" % VERSION) +
                ("\n<span size='10000' weight='heavy'>Network Inventory ") +
                _("Build") + (" %s</span>" % __version__))

        self.lbl_program_description = gtk.Label(
                _("UMIT Network Inventory and UMIT Scheduler are UMIT\n") +
                _("extensions developed by") + (" %s\n" % __author__) +
                _("and was sponsored by Google during the Summer of Code "
                    "2007.\nThanks Google!"))

        self.logo_img = gtk.Image()
        self.logo_img.set_from_file(logo)
        self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE)

        self.btn_close.connect('clicked', lambda x, y=None:self.destroy())

        self.__set_props()
        self.__do_layout()
Ejemplo n.º 34
0
 def __init__(self, parent):
     HIGWindow.__init__(self)
     self.set_title(_("Script Manager Progress"))
     self.set_position(gtk.WIN_POS_CENTER)
     self.set_size_request(300, 200)
     self.vbox = HIGVBox()
     self.label = gtk.Label()
     self.vbox.pack_start(self.label)
     self.progress_all = HIGLabeledProgressBar(_("Overall progress"))
     self.vbox.pack_start(self.progress_all)
     self.progress_current = HIGLabeledProgressBar(_("Current source"))
     self.vbox.pack_start(self.progress_current)
     self.btn_cancel = HIGButton(stock=gtk.STOCK_CANCEL)
     self.btn_cancel.connect("clicked", self._cancel_cb)
     self.vbox.pack_start(self.btn_cancel)
     self.add(self.vbox)
     self.show_all()
     self.timeout_id = gobject.timeout_add(100, self.callback)
     self.status = (None, None, None)
     import thread
     self.lock = thread.allocate_lock()
     reload_thread(parent.base, self, self.lock)
Ejemplo n.º 35
0
    def __init__(self):
        HIGWindow.__init__(self)

        self.lbl_program_version = gtk.Label(
            ("<span size='30000' weight='heavy'>UMIT %s</span>" % VERSION) +
            ("\n<span size='10000' weight='heavy'>Network Inventory ") +
            _("Build") + (" %s</span>" % __version__))

        self.lbl_program_description = gtk.Label(
            _("UMIT Network Inventory and UMIT Scheduler are UMIT\n") +
            _("extensions developed by") + (" %s\n" % __author__) +
            _("and was sponsored by Google during the Summer of Code "
              "2007.\nThanks Google!"))

        self.logo_img = gtk.Image()
        self.logo_img.set_from_file(logo)
        self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE)

        self.btn_close.connect('clicked', lambda x, y=None: self.destroy())

        self.__set_props()
        self.__do_layout()
    def __init__(self):
        HIGWindow.__init__(self)

        self.tooltips = gtk.Tooltips()
        self.data_lbl = HIGSectionLabel(_("Delete data older than"))
        self.days_lbl = HIGSectionLabel(_("days"))
        self.days = gtk.SpinButton(
            gtk.Adjustment(value=get_decays()[1],
                           lower=0,
                           upper=5000,
                           step_incr=1), 1)

        self.tooltips.set_tip(self.days,
                              _("Set value as 0 to disable data removal"))

        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)

        self.cancel.connect("clicked", self._exit)
        self.apply.connect("clicked", self._set_new_decay)

        self.__set_props()
        self.__do_layout()
Ejemplo n.º 37
0
    def __init__(self, node, position, parent):
        """
        """
        HIGWindow.__init__(self, gtk.WINDOW_POPUP)
        self.set_decorated(False)
        self.set_keep_above(True)
        self.set_skip_taskbar_hint(True)
        self.move(position[0], position[1])
        self.set_size_request(DIMENSION_NORMAL[0], DIMENSION_NORMAL[1])

        self.__button_press_position = self.get_pointer()

        self.__is_compacted = True
        self.__is_collapsed = False

        self.__node = node
        self.__pressed = False
        self.__parent = parent

        self.connect('button_press_event', self.button_press)
        self.connect('button_release_event', self.button_release)
        self.connect('enter_notify_event', self.enter_notify)
        self.connect('leave_notify_event', self.leave_notify)
        self.connect('motion_notify_event', self.motion_notify)

        self.__title_font = pango.FontDescription('Monospace Bold')

        self.add_events(gtk.gdk.BUTTON_PRESS_MASK |
                        gtk.gdk.BUTTON_RELEASE_MASK |
                        gtk.gdk.POINTER_MOTION_MASK |
                        gtk.gdk.ENTER_NOTIFY |
                        gtk.gdk.LEAVE_NOTIFY |
                        gtk.gdk.POINTER_MOTION_HINT_MASK)

        self.__icon = Application()
        self.__create_widgets()
Ejemplo n.º 38
0
    def __fullscreen_callback(self, widget=None):
        """
        """
        if self.__fullscreen.get_active():

            self.__fullscreen_window = HIGWindow()
            self.__fullscreen_window.connect("delete-event", self.__fullscreen_exit)
            self.__notebook = self.__window.get_parent()
            self.__window.reparent(self.__fullscreen_window)
            self.__fullscreen_window.show()
            self.__fullscreen_window.fullscreen()

        else:

            self.__window.reparent(self.__notebook)
            self.__notebook.set_tab_label_text(self.__window, _("Topology"))
            self.__notebook.set_current_page(self.__notebook.page_num(self.__window))
            self.__fullscreen_window.hide()
class Toolbar(gtk.Toolbar):
    """
    """
    def __init__(self, radialnet, window, control, fisheye):
        """
        """
        gtk.Toolbar.__init__(self)
        self.set_style(gtk.TOOLBAR_BOTH_HORIZ)
        self.set_property("icon-size", gtk.ICON_SIZE_MENU)
        self.set_tooltips(True)

        self.radialnet = radialnet

        self.__window = window
        self.__control_widget = control
        self.__fisheye_widget = fisheye

        self.__state = {'fisheye': SHOW, 'control': SHOW}

        self.__fullscreen_window = None

        self.__create_widgets()

    def __create_widgets(self):
        """
        """
        self.__tools_menu = ToolsMenu(self.radialnet)

        self.__tools_button = gtk.MenuToolButton(gtk.STOCK_PREFERENCES)
        self.__tools_button.set_label(_("Tools"))
        self.__tools_button.set_is_important(True)
        self.__tools_button.set_menu(self.__tools_menu)
        self.__tools_button.connect('clicked', self.__tools_callback)

        self.__control = gtk.ToggleToolButton(gtk.STOCK_PROPERTIES)
        self.__control.set_label(_("Controls"))
        self.__control.set_is_important(True)
        self.__control.connect('clicked', self.__control_callback)
        self.__control.set_tooltip_text(_("Show control panel"))
        self.__control.set_active(False)

        self.__fisheye = gtk.ToggleToolButton(gtk.STOCK_ZOOM_FIT)
        self.__fisheye.set_label(_("Fisheye"))
        self.__fisheye.set_is_important(True)
        self.__fisheye.connect('clicked', self.__fisheye_callback)
        self.__fisheye.set_tooltip_text(_("Enable fisheye"))
        self.__fisheye.set_active(False)

        self.__fullscreen = gtk.ToggleToolButton(gtk.STOCK_FULLSCREEN)
        self.__fullscreen.set_label(_("Fullscreen"))
        self.__fullscreen.set_is_important(True)
        self.__fullscreen.connect('clicked', self.__fullscreen_callback)
        self.__fullscreen.set_tooltip_text(_("Toggle fullscreen"))

        self.__separator = gtk.SeparatorToolItem()
        self.__expander = gtk.SeparatorToolItem()
        self.__expander.set_expand(True)
        self.__expander.set_draw(False)

        self.insert(self.__tools_button, 0)
        self.insert(self.__expander, 1)
        self.insert(self.__control, 2)
        self.insert(self.__fisheye, 3)
        self.insert(self.__fullscreen, 4)

        gobject.timeout_add(REFRESH_RATE, self.__update)

    def disable_controls(self):
        """
        """
        self.__control.set_sensitive(False)
        self.__fisheye.set_sensitive(False)
        self.__tools_menu.disable_dependents()

    def enable_controls(self):
        """
        """
        self.__control.set_sensitive(True)
        self.__fisheye.set_sensitive(True)
        self.__tools_menu.enable_dependents()

    def disable_tools(self):
        self.__tools_menu.disable_dependents()

    def enable_tools(self):
        self.__tools_menu.enable_dependents()

    def __update(self):
        """
        """
        self.__fisheye.set_active(self.radialnet.get_fisheye())

        self.__fisheye_callback()
        self.__control_callback()

        return True

    def __tools_callback(self, widget):
        """
        """
        self.__tools_menu.popup(None, None, None, 1, 0)

    def __control_callback(self, widget=None):
        """
        """
        if self.__control.get_active() != self.__state['control']:

            if self.__control.get_active():
                self.__control_widget.show()
                self.__control_widget.child.show_all()

            else:
                self.__control_widget.hide()
                self.__control_widget.child.hide_all()

            self.__state['control'] = self.__control.get_active()

    def __fisheye_callback(self, widget=None):
        """
        """
        if self.__fisheye.get_active() != self.__state['fisheye']:

            if not self.radialnet.is_in_animation():

                if self.__fisheye.get_active():

                    self.__fisheye_widget.active_fisheye()
                    self.__fisheye_widget.show()

                    for w in self.__fisheye_widget.get_children():
                        w.show_all()

                else:

                    self.__fisheye_widget.deactive_fisheye()
                    self.__fisheye_widget.hide()

                    for w in self.__fisheye_widget.get_children():
                        w.hide_all()

                self.__state['fisheye'] = self.__fisheye.get_active()

    def __fullscreen_exit(self, widget, event):
        """
        """
        self.__fullscreen.set_active(False)

    def __fullscreen_callback(self, widget=None):
        """
        """
        if self.__fullscreen.get_active():

            self.__fullscreen_window = HIGWindow()
            self.__fullscreen_window.connect('delete-event',
                                             self.__fullscreen_exit)
            self.__notebook = self.__window.get_parent()
            self.__window.reparent(self.__fullscreen_window)
            self.__fullscreen_window.show()
            self.__fullscreen_window.fullscreen()

        else:

            self.__window.reparent(self.__notebook)
            self.__notebook.set_tab_label_text(self.__window, _('Topology'))
            self.__notebook.set_current_page(
                self.__notebook.page_num(self.__window))
            self.__fullscreen_window.hide()
Ejemplo n.º 40
0
    def __init__(self, parent):
	HIGWindow.__init__(self)
	self.set_title(_("Script Manager User Templates"))
	self.set_position(gtk.WIN_POS_CENTER)
        self.set_size_request(450, 400)
        self.create_widgets()
    def __init__(self):
        HIGWindow.__init__(self)

        self.__create_widgets()
        self.__pack_widgets()
        self.__set_widgets()
Ejemplo n.º 42
0
    def __init__(self, inventory=None, edit_mode=False):
        """
        If you want to load an inventory at startup, pass it to inventory.
        If you want to run this in edit mode, set to True edit_mode.
        """
        HIGWindow.__init__(self)

        self.schemawin = None
        self.discoverywin = None
        self.edit_mode = edit_mode
        if edit_mode:
            self.wtitle = _("Editing Inventory")
        else:
            self.wtitle = _("New Inventory")

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # inventory
        self.invname_lbl = HIGEntryLabel(_("Inventory's name"))
        self.invname = gtk.Entry()
        self.invname.connect('changed', self._check_invname)
        self.invname_inuse = HIGEntryLabel(_("in use"))
        self.invname_inuse.set_sensitive(False)
        self.invenabled = gtk.CheckButton(_("Enabled"))
        self.invenabled.set_active(True)
        # scan command
        self.scandefault = gtk.CheckButton(_("Use default scan options"))
        img_info = gtk.Image()
        img_info.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_MENU)
        self.scandefault_tip = gtk.EventBox()
        self.scandefault_tip.add(img_info)

        self.scanadv = gtk.Expander(_("Use advanced scan options"))
        self.scan_name_lbl = HIGEntryLabel(_("Scan Profile"))
        self.scan_name = ProfileCombo()
        self.scan_name.update()
        self.scan_name.set_active(0)
        self.scan_name.connect('changed', self._set_scan_command)
        self.cmd_wizard = gtk.Button(stock=gtk.STOCK_CONVERT)
        blbl = self.cmd_wizard.get_children()[0].get_children(
        )[0].get_children()[1]
        blbl.set_text(_("Command Wizard"))
        self.cmd_wizard.connect('clicked', self._open_cmd_wizard)

        self.scan_command_lbl = HIGEntryLabel(_("Command"))
        self.scan_command = gtk.Entry()
        self.scan_command.connect('changed', self._set_scan_type)
        self._set_scan_command(None)
        self.scandefault.set_active(True)
        # scan target
        self.scantarget_lbl = HIGEntryLabel(_("Scan target"))
        self.scantarget = gtk.Entry()
        self.scantarget_discovery = HIGButton(_("Use host discovery"))
        self.scantarget_discovery.connect('clicked', self._open_host_discovery)
        # scheduling profiles
        self.sched_name_lbl = HIGEntryLabel(_("Scheduling Profile"))
        self.sched_name = gtk.combo_box_new_text()
        self.sched_name_edit = gtk.Button(stock=gtk.STOCK_EDIT)
        blbl = self.sched_name_edit.get_children()[0].get_children(
        )[0].get_children()[1]
        blbl.set_text(_("Edit Profiles"))
        self.sched_name_edit.connect('clicked', self._edit_schedprofiles)
        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect('clicked', self._show_help)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect('clicked', self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect('clicked', self._save_inventory_and_leave)

        self.tooltips = gtk.Tooltips()
        self.tooltips.set_tip(self.scandefault_tip,
                              _("nmap -T Aggressive -sV -n -O -v target"))

        # disable controls if edit_mode=True
        if edit_mode:
            self.invname.set_sensitive(False)
            self.scandefault.set_sensitive(False)
            self.scandefault_tip.set_sensitive(False)
            self.scanadv.set_sensitive(False)
            self.scan_name.set_sensitive(False)
            self.scan_command.set_sensitive(False)
            self.scantarget_lbl.set_sensitive(False)
            self.scantarget.set_sensitive(False)
            self.scantarget_discovery.set_sensitive(False)

        self.connect('destroy', self._exit)
        self.profile_running = None  # no SchedProfileEditor instance is running.
        self.load_schemas()
        self._load_pscheds()

        # load an inventory if especified
        self.loaded_command = None
        if inventory:
            self.load_inventory(inventory)

        self.__set_props()
        self.__do_layout()
Ejemplo n.º 43
0
    def __init__(self, daddy=None):
        HIGWindow.__init__(self)

        self.daddy = daddy
        self.wtitle = _("Scan Scheduler Editor")

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # schemas name
        self.schema_name_lbl = HIGEntryLabel(_("Schema Name"))
        self.schema_name = gtk.combo_box_entry_new_text()
        self.schema_name.connect("changed", self._check_schema)
        # target and scan profiles
        # self.target_lbl = HIGEntryLabel(_("Target"))
        # self.target = gtk.Entry()
        self.scan_name_lbl = HIGEntryLabel(_("Scan Profile"))
        self.scan_name = ProfileCombo()
        self.scan_name.update()
        self.scan_name.set_active(0)
        self.scan_name.connect("changed", self._set_scan_command)
        # scan command
        self.scan_command_lbl = HIGEntryLabel(_("Command"))
        self.scan_command = gtk.Entry()
        # scheduling profile
        self.sched_name_lbl = HIGEntryLabel(_("Scheduling Profile"))
        self.sched_name = gtk.combo_box_new_text()
        self.sched_name_edit = gtk.Button(stock=gtk.STOCK_EDIT)
        blbl = self.sched_name_edit.get_children()[0].get_children()[0].get_children()[1]
        blbl.set_text(_("Edit Profiles"))
        self.sched_name_edit.connect("clicked", self._edit_schedprofiles)
        # schema settings
        self.schema_sett_frame = HIGFrame()
        self.setting_saveto = gtk.CheckButton(_("Save outputs to"))
        self.setting_saveto_entry = gtk.Entry()
        self.setting_saveto_browse = gtk.Button(_("..."))
        self.setting_saveto_browse.connect("clicked", self._select_saveto)
        self.setting_mailto = gtk.CheckButton(_("Send output to email"))
        self.setting_mailto_entry = gtk.Entry()
        self.setting_smtp_lbl = HIGEntryLabel(_("SMTP Schema"))
        self.setting_smtp = gtk.combo_box_new_text()
        self.setting_addtoinv = gtk.CheckButton(_("Add to the Inventory"))
        self.setting_enabled = gtk.CheckButton(_("Enabled"))
        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect("clicked", self._show_help)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.apply.connect("clicked", self._save_schema)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect("clicked", self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect("clicked", self._save_schema_and_leave)

        self.load_smtp_schemas()
        self._set_scan_command(None)
        self.profile_running = None  # no SchedProfileEditor instance is running.
        self._load_pscheds()
        self.load_schemas()

        self.__set_props()
        self.__do_layout()

        self.connect("destroy", self._exit)
Ejemplo n.º 44
0
 def set_title(self, title):
     HIGWindow.set_title(self, title)
     self.wizard_title.set_label(self.title_markup % title)
    def __init__(self, daddy=None):
        HIGWindow.__init__(self)

        self.daddy = daddy # TLGraphToolbar instance
        self.wtitle = _("Graph Preferences Editor")

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # profiles
        self.graph_profile_lbl = HIGEntryLabel(_("Profile"))
        self.graph_profile = gtk.combo_box_new_text()
        # horizontal divisors/balloons
        self.hdivs_lbl = HIGEntryLabel(_("Horizontal divisors"))
        self.hdivs = gtk.SpinButton(gtk.Adjustment(value=5, lower=2, upper=10,
            step_incr=1), 1)
        # arc drawing
        self.draw_arc_lbl = HIGEntryLabel('')
        self.draw_arc_lbl.set_markup(_("<b>Points higlight</b>"))
        self.draw_arc_onsel = gtk.RadioButton(label=_("On Selection"))
        self.draw_arc_always = gtk.RadioButton(self.draw_arc_onsel,
            label=_("Always"))
        self.draw_arc_bounds = gtk.RadioButton(label=_("Boundary points only"))
        self.draw_arc_allpts = gtk.RadioButton(self.draw_arc_bounds,
            label=_("Every point"))
        self.balloons = gtk.CheckButton(_("Show balloons on selection"))
        # vertical divisors
        self.draw_vertdiv = gtk.CheckButton(_("Draw vertical lines"))
        self.draw_vertdiv_dash = gtk.RadioButton(label=_("Dashed"))
        self.draw_vertdiv_solid = gtk.RadioButton(self.draw_vertdiv_dash,
            label=_("Solid"))
        # background fill
        self.bg_gradient = gtk.CheckButton(_("Gradient background"))
        self.bg_gradient_vert = gtk.RadioButton(label=_("Vertical gradient"))
        self.bg_gradient_horiz = gtk.RadioButton(self.bg_gradient_vert,
            label=_("Horizontal gradient"))
        # selection fill
        self.selection_fill = gtk.CheckButton(_("On selection do "
            "progressive fill"))
        self.selection_fill_solid = gtk.RadioButton(label=_("Solid fill"))
        self.selection_fill_gradient = gtk.RadioButton(
            self.selection_fill_solid, label=_("Gradient fill"))
        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect('clicked', self._show_help)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.apply.connect('clicked', self._save_pref)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect('clicked', self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect('clicked', self._save_pref_and_leave)


        self.append_profiles()
        start_profile = self.load_options_from_graph()
        self.setup_controls(None, start_profile)

        self.__do_connects()
        self.__set_props()
        self.__do_layout()
Ejemplo n.º 46
0
 def set_title(self, title):
     HIGWindow.set_title(self, title)
     self.wizard_title.set_label(self.title_markup % title)
Ejemplo n.º 47
0
class Toolbar(gtk.Toolbar):
    """
    """

    def __init__(self, radialnet, window, control, fisheye):
        """
        """
        gtk.Toolbar.__init__(self)
        self.set_style(gtk.TOOLBAR_BOTH_HORIZ)
        self.set_property("icon-size", gtk.ICON_SIZE_MENU)
        self.set_tooltips(True)

        self.radialnet = radialnet

        self.__window = window
        self.__control_widget = control
        self.__fisheye_widget = fisheye

        self.__state = {"fisheye": SHOW, "control": SHOW}

        self.__fullscreen_window = None

        self.__create_widgets()

    def __create_widgets(self):
        """
        """
        self.__tools_menu = ToolsMenu(self.radialnet)

        self.__tools_button = gtk.MenuToolButton(gtk.STOCK_PREFERENCES)
        self.__tools_button.set_label(_("Tools"))
        self.__tools_button.set_is_important(True)
        self.__tools_button.set_menu(self.__tools_menu)
        self.__tools_button.connect("clicked", self.__tools_callback)

        self.__control = gtk.ToggleToolButton(gtk.STOCK_PROPERTIES)
        self.__control.set_label(_("Controls"))
        self.__control.set_is_important(True)
        self.__control.connect("clicked", self.__control_callback)
        self.__control.set_tooltip_text(_("Show control panel"))
        self.__control.set_active(False)

        self.__fisheye = gtk.ToggleToolButton(gtk.STOCK_ZOOM_FIT)
        self.__fisheye.set_label(_("Fisheye"))
        self.__fisheye.set_is_important(True)
        self.__fisheye.connect("clicked", self.__fisheye_callback)
        self.__fisheye.set_tooltip_text(_("Enable fisheye"))
        self.__fisheye.set_active(False)

        self.__fullscreen = gtk.ToggleToolButton(gtk.STOCK_FULLSCREEN)
        self.__fullscreen.set_label(_("Fullscreen"))
        self.__fullscreen.set_is_important(True)
        self.__fullscreen.connect("clicked", self.__fullscreen_callback)
        self.__fullscreen.set_tooltip_text(_("Toggle fullscreen"))

        self.__separator = gtk.SeparatorToolItem()
        self.__expander = gtk.SeparatorToolItem()
        self.__expander.set_expand(True)
        self.__expander.set_draw(False)

        self.insert(self.__tools_button, 0)
        self.insert(self.__expander, 1)
        self.insert(self.__control, 2)
        self.insert(self.__fisheye, 3)
        self.insert(self.__fullscreen, 4)

        gobject.timeout_add(REFRESH_RATE, self.__update)

    def disable_controls(self):
        """
        """
        self.__control.set_sensitive(False)
        self.__fisheye.set_sensitive(False)
        self.__tools_menu.disable_dependents()

    def enable_controls(self):
        """
        """
        self.__control.set_sensitive(True)
        self.__fisheye.set_sensitive(True)
        self.__tools_menu.enable_dependents()

    def disable_tools(self):
        self.__tools_menu.disable_dependents()

    def enable_tools(self):
        self.__tools_menu.enable_dependents()

    def __update(self):
        """
        """
        self.__fisheye.set_active(self.radialnet.get_fisheye())

        self.__fisheye_callback()
        self.__control_callback()

        return True

    def __tools_callback(self, widget):
        """
        """
        self.__tools_menu.popup(None, None, None, 1, 0)

    def __control_callback(self, widget=None):
        """
        """
        if self.__control.get_active() != self.__state["control"]:

            if self.__control.get_active():
                self.__control_widget.show()
                self.__control_widget.child.show_all()

            else:
                self.__control_widget.hide()
                self.__control_widget.child.hide_all()

            self.__state["control"] = self.__control.get_active()

    def __fisheye_callback(self, widget=None):
        """
        """
        if self.__fisheye.get_active() != self.__state["fisheye"]:

            if not self.radialnet.is_in_animation():

                if self.__fisheye.get_active():

                    self.__fisheye_widget.active_fisheye()
                    self.__fisheye_widget.show()

                    for w in self.__fisheye_widget.get_children():
                        w.show_all()

                else:

                    self.__fisheye_widget.deactive_fisheye()
                    self.__fisheye_widget.hide()

                    for w in self.__fisheye_widget.get_children():
                        w.hide_all()

                self.__state["fisheye"] = self.__fisheye.get_active()

    def __fullscreen_exit(self, widget, event):
        """
        """
        self.__fullscreen.set_active(False)

    def __fullscreen_callback(self, widget=None):
        """
        """
        if self.__fullscreen.get_active():

            self.__fullscreen_window = HIGWindow()
            self.__fullscreen_window.connect("delete-event", self.__fullscreen_exit)
            self.__notebook = self.__window.get_parent()
            self.__window.reparent(self.__fullscreen_window)
            self.__fullscreen_window.show()
            self.__fullscreen_window.fullscreen()

        else:

            self.__window.reparent(self.__notebook)
            self.__notebook.set_tab_label_text(self.__window, _("Topology"))
            self.__notebook.set_current_page(self.__notebook.page_num(self.__window))
            self.__fullscreen_window.hide()
Ejemplo n.º 48
0
    def __init__(self, inventory=None, edit_mode=False):
        """
        If you want to load an inventory at startup, pass it to inventory.
        If you want to run this in edit mode, set to True edit_mode.
        """
        HIGWindow.__init__(self)

        self.schemawin = None
        self.discoverywin = None
        self.edit_mode = edit_mode
        if edit_mode:
            self.wtitle = _("Editing Inventory")
        else:
            self.wtitle = _("New Inventory")

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # inventory
        self.invname_lbl = HIGEntryLabel(_("Inventory's name"))
        self.invname = gtk.Entry()
        self.invname.connect('changed', self._check_invname)
        self.invname_inuse = HIGEntryLabel(_("in use"))
        self.invname_inuse.set_sensitive(False)
        self.invenabled = gtk.CheckButton(_("Enabled"))
        self.invenabled.set_active(True)
        # scan command
        self.scandefault = gtk.CheckButton(_("Use default scan options"))
        img_info = gtk.Image()
        img_info.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_MENU)
        self.scandefault_tip = gtk.EventBox()
        self.scandefault_tip.add(img_info)

        self.scanadv = gtk.Expander(_("Use advanced scan options"))
        self.scan_name_lbl = HIGEntryLabel(_("Scan Profile"))
        self.scan_name = ProfileCombo()
        self.scan_name.update()
        self.scan_name.set_active(0)
        self.scan_name.connect('changed', self._set_scan_command)
        self.cmd_wizard = gtk.Button(stock=gtk.STOCK_CONVERT)
        blbl = self.cmd_wizard.get_children(
            )[0].get_children()[0].get_children()[1]
        blbl.set_text(_("Command Wizard"))
        self.cmd_wizard.connect('clicked', self._open_cmd_wizard)

        self.scan_command_lbl = HIGEntryLabel(_("Command"))
        self.scan_command = gtk.Entry()
        self.scan_command.connect('changed', self._set_scan_type)
        self._set_scan_command(None)
        self.scandefault.set_active(True)
        # scan target
        self.scantarget_lbl = HIGEntryLabel(_("Scan target"))
        self.scantarget = gtk.Entry()
        self.scantarget_discovery = HIGButton(_("Use host discovery"))
        self.scantarget_discovery.connect('clicked', self._open_host_discovery)
        # scheduling profiles
        self.sched_name_lbl = HIGEntryLabel(_("Scheduling Profile"))
        self.sched_name = gtk.combo_box_new_text()
        self.sched_name_edit = gtk.Button(stock=gtk.STOCK_EDIT)
        blbl = self.sched_name_edit.get_children(
            )[0].get_children()[0].get_children()[1]
        blbl.set_text(_("Edit Profiles"))
        self.sched_name_edit.connect('clicked', self._edit_schedprofiles)
        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect('clicked', self._show_help)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect('clicked', self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect('clicked', self._save_inventory_and_leave)

        self.tooltips = gtk.Tooltips()
        self.tooltips.set_tip(self.scandefault_tip,
            _("nmap -T Aggressive -sV -n -O -v target"))

        # disable controls if edit_mode=True
        if edit_mode:
            self.invname.set_sensitive(False)
            self.scandefault.set_sensitive(False)
            self.scandefault_tip.set_sensitive(False)
            self.scanadv.set_sensitive(False)
            self.scan_name.set_sensitive(False)
            self.scan_command.set_sensitive(False)
            self.scantarget_lbl.set_sensitive(False)
            self.scantarget.set_sensitive(False)
            self.scantarget_discovery.set_sensitive(False)

        self.connect('destroy', self._exit)
        self.profile_running = None # no SchedProfileEditor instance is running.
        self.load_schemas()
        self._load_pscheds()

        # load an inventory if especified
        self.loaded_command = None
        if inventory:
            self.load_inventory(inventory)

        self.__set_props()
        self.__do_layout()
Ejemplo n.º 49
0
    def __init__(self):
        HIGWindow.__init__(self)

        self.__create_widgets()
        self.__pack_widgets()
        self.__set_widgets()
    def __init__(self, daddy=None):
        HIGWindow.__init__(self)

        self.daddy = daddy
        self.wtitle = _("Scan Scheduler Editor")

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # schemas name
        self.schema_name_lbl = HIGEntryLabel(_("Schema Name"))
        self.schema_name = gtk.combo_box_entry_new_text()
        self.schema_name.connect('changed', self._check_schema)
        # target and scan profiles
        #self.target_lbl = HIGEntryLabel(_("Target"))
        #self.target = gtk.Entry()
        self.scan_name_lbl = HIGEntryLabel(_("Scan Profile"))
        self.scan_name = ProfileCombo()
        self.scan_name.update()
        self.scan_name.set_active(0)
        self.scan_name.connect('changed', self._set_scan_command)
        # scan command
        self.scan_command_lbl = HIGEntryLabel(_("Command"))
        self.scan_command = gtk.Entry()
        # scheduling profile
        self.sched_name_lbl = HIGEntryLabel(_("Scheduling Profile"))
        self.sched_name = gtk.combo_box_new_text()
        self.sched_name_edit = gtk.Button(stock=gtk.STOCK_EDIT)
        blbl = self.sched_name_edit.get_children()[0].get_children(
        )[0].get_children()[1]
        blbl.set_text(_("Edit Profiles"))
        self.sched_name_edit.connect('clicked', self._edit_schedprofiles)
        # schema settings
        self.schema_sett_frame = HIGFrame()
        self.setting_saveto = gtk.CheckButton(_("Save outputs to"))
        self.setting_saveto_entry = gtk.Entry()
        self.setting_saveto_browse = gtk.Button(_("..."))
        self.setting_saveto_browse.connect('clicked', self._select_saveto)
        self.setting_mailto = gtk.CheckButton(_("Send output to email"))
        self.setting_mailto_entry = gtk.Entry()
        self.setting_smtp_lbl = HIGEntryLabel(_("SMTP Schema"))
        self.setting_smtp = gtk.combo_box_new_text()
        self.setting_addtoinv = gtk.CheckButton(_("Add to the Inventory"))
        self.setting_enabled = gtk.CheckButton(_("Enabled"))
        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect('clicked', self._show_help)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.apply.connect('clicked', self._save_schema)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect('clicked', self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect('clicked', self._save_schema_and_leave)

        self.load_smtp_schemas()
        self._set_scan_command(None)
        self.profile_running = None  # no SchedProfileEditor instance is running.
        self._load_pscheds()
        self.load_schemas()

        self.__set_props()
        self.__do_layout()

        self.connect('destroy', self._exit)
 def __init__(self):
     HIGWindow.__init__(self)
     self.add(NISettingsBox().get_layout())
     self.__set_props()
Ejemplo n.º 52
0
 def __init__(self):
     HIGWindow.__init__(self)
     self.add(NISettingsBox().get_layout())
     self.__set_props()