Exemplo n.º 1
0
    def __init__(self, window):
        self.indicator = AppIndicator3.Indicator(
            'project_name', '',
            AppIndicator3.IndicatorCategory.APPLICATION_STATUS)
        self.indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE)

        icon_uri = get_media_file("project_name.svg")
        icon_path = icon_uri.replace("file:///", '')
        self.indicator.set_icon(icon_path)

        #Uncomment and choose an icon for attention state.
        #self.indicator.set_attention_icon("ICON-NAME")

        self.menu = Gtk.Menu()

        # Add items to Menu and connect signals.

        #Adding preferences button
        #window represents the main Window object of your app
        self.preferences = Gtk.MenuItem("Preferences")
        self.preferences.connect("activate",
                                 window.on_mnu_preferences_activate)
        self.preferences.show()
        self.menu.append(self.preferences)

        self.quit = Gtk.MenuItem("Quit")
        self.quit.connect("activate", window.on_mnu_close_activate)
        self.quit.show()
        self.menu.append(self.quit)

        # Add more items here

        self.menu.show()
        self.indicator.set_menu(self.menu)
Exemplo n.º 2
0
 def __init__(self):
     super().__init__()
     if not hasattr(self, "_indicator"):
         try:
             self._indicator = appindicator.Indicator(
                 "gtg", "indicator-messages",
                 appindicator.CATEGORY_APPLICATION_STATUS)
         except Exception:
             self._indicator = None
Exemplo n.º 3
0
    def ubuntu_trayicon(self, logo_filename):
        trayicon = appindicator.Indicator(
            'XX-Net', 'indicator-messages',
            appindicator.CATEGORY_APPLICATION_STATUS)
        trayicon.set_status(appindicator.STATUS_ACTIVE)
        trayicon.set_attention_icon('indicator-messages-new')
        trayicon.set_icon(logo_filename)
        trayicon.set_menu(self.make_menu())

        return trayicon
Exemplo n.º 4
0
    def __init__(self):

        self.ind = appindicator.Indicator(
            APPINDICATOR_ID, os.path.join(GLADE_TEMPLATE_FOLDER, "mic.png"),
            appindicator.CATEGORY_APPLICATION_STATUS)
        self.ind.set_status(appindicator.STATUS_ACTIVE)

        self.menu_setup()
        self.ind.set_menu(self.menu)
        self.progress = 0
        self.last_signal = None

        gobject.timeout_add(100, self.updateIcon)
Exemplo n.º 5
0
    def init_systray(self):
        # Build the systray icon
        if self.systray_icon:
            return

        if self.systray_indicator:
            self.systray_icon = AppIndicator3.Indicator("virt-manager",
                                "virt-manager-icon",
                                AppIndicator3.CATEGORY_OTHER)
            self.systray_icon.set_status(AppIndicator3.STATUS_ACTIVE)
            self.systray_icon.set_menu(self.systray_menu)

        else:
            self.systray_icon = Gtk.StatusIcon()
            self.systray_icon.set_visible(True)
            self.systray_icon.set_property("icon-name", "virt-manager")
            self.systray_icon.connect("activate", self.systray_activate)
            self.systray_icon.connect("popup-menu", self.systray_popup)
            self.systray_icon.set_tooltip_text(_("Virtual Machine Manager"))
Exemplo n.º 6
0
    def __init__(self, handler, main_window=None):
        """
        constructor

        handler -- a e3common.Handler.TrayIconHandler object
        """
        gui.BaseTray.__init__(self, handler)

        app_name_hax = "emesene-%s" % uuid.uuid1()
        self.indicator = appindicator.new_with_path(
            app_name_hax,
            self._get_icon_name(self.handler.theme.image_theme.logo_panel),
            appindicator.CATEGORY_APPLICATION_STATUS,
            self._get_icon_directory(self.handler.theme.image_theme.logo_panel))

        if hasattr(self.indicator.props, 'title'):
            self.indicator.set_property('title', 'emesene')

        self.main_window = main_window

        self.menu = None
        self.set_login()
        self.indicator.set_status(appindicator.STATUS_ACTIVE)
Exemplo n.º 7
0
 def ubuntu_trayicon(self, logo_filename):
     trayicon = appindicator.Indicator('XX-Net', 'indicator-messages', appindicator.CATEGORY_APPLICATION_STATUS)
     trayicon.set_status(appindicator.STATUS_ACTIVE)