Ejemplo n.º 1
0
        private bool DrawAppIndicator()
        {
            try {
                indicator = new ApplicationIndicator("banshee",
                                                     (IconThemeUtils.HasIcon("banshee-panel")) ?
                                                     "banshee-panel" :
                                                     Banshee.ServiceStack.Application.IconName,
                                                     Category.ApplicationStatus);

                // Load the menu
                Gtk3.Menu menu = (Gtk3.Menu)interface_action_service.UIManager.GetWidget("/AppIndicatorTrayMenu");
                menu.Show();

                //This cannot be enabled at the moment because of the Gtk3/Gtk2 conflict. Need to find a solution
                //indicator.Menu = menu;

                // Show the tray icon
                indicator.Status = Status.Active;

                if (!QuitOnCloseSchema.Get())
                {
                    RegisterCloseHandler();
                }
            } catch (Exception e) {
                Hyena.Log.Warning("Error while trying to create the Application Indicator.", e.Message, false);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        private bool BuildNotificationArea()
        {
            if (Environment.OSVersion.Platform == PlatformID.Unix)
            {
                try {
                    notif_area = new X11NotificationAreaBox();
                } catch {
                }
            }

            if (notif_area == null)
            {
                notif_area = new GtkNotificationAreaBox(elements_service.PrimaryWindow);
            }

            if (notif_area == null)
            {
                return(false);
            }

            notif_area.Disconnected   += OnNotificationAreaDisconnected;
            notif_area.Activated      += OnNotificationAreaActivated;
            notif_area.PopupMenuEvent += OnNotificationAreaPopupMenuEvent;

            if (!QuitOnCloseSchema.Get())
            {
                RegisterCloseHandler();
            }

            return(true);
        }
Ejemplo n.º 3
0
        private bool BuildNotificationArea()
        {
            if (PersistenceSupported)
            {
                Log.Debug("Notification daemon supports persistence, no status icon needed");
                return(true);
            }

            notif_area = new GtkNotificationAreaBox(elements_service.PrimaryWindow);

            if (notif_area == null)
            {
                return(false);
            }

            notif_area.Disconnected   += OnNotificationAreaDisconnected;
            notif_area.Activated      += OnNotificationAreaActivated;
            notif_area.PopupMenuEvent += OnNotificationAreaPopupMenuEvent;

            if (!QuitOnCloseSchema.Get())
            {
                RegisterCloseHandler();
            }

            return(true);
        }