Exemplo n.º 1
0
        private void CloseWindow(object o, EventArgs args)
        {
            try {
                if (NotifyOnCloseSchema.Get())
                {
                    Gdk.Pixbuf image = IconThemeUtils.LoadIcon(48, Banshee.ServiceStack.Application.IconName);
                    if (image != null)
                    {
                        image = image.ScaleSimple(icon_size, icon_size, Gdk.InterpType.Bilinear);
                    }

                    Notification nf = new Notification(
                        Catalog.GetString("Still Running"),
                        Catalog.GetString("Banshee was closed to the notification area. " +
                                          "Use the <i>Quit</i> option to end your session."),
                        image, notif_area.Widget);
                    nf.Urgency = Urgency.Low;
                    nf.Timeout = 4500;
                    nf.Show();

                    NotifyOnCloseSchema.Set(false);
                }
            } catch {
            }

            elements_service.PrimaryWindow.SetVisible(false);
        }
Exemplo n.º 2
0
        private void CloseWindow(object o, EventArgs args)
        {
            try {
                if (NotifyOnCloseSchema.Get())
                {
                    Notification nf = new Notification(
                        AddinManager.CurrentLocalizer.GetString("Still Running"),
                        AddinManager.CurrentLocalizer.GetString(
                            "Banshee was closed to the notification area. " +
                            "Use the <i>Quit</i> option to end your session."),
                        "media-player-banshee");
                    nf.Urgency = Urgency.Low;
                    nf.Show();

                    NotifyOnCloseSchema.Set(false);
                }
            } catch (Exception e) {
                Hyena.Log.Warning("Error while trying to notify of window close.", e.Message, false);
            }

            PrimaryWindowVisible = false;
        }