Example #1
0
        public void Dispose()
        {
            if (current_nf != null)
            {
                try {
                    current_nf.Close();
                } catch {}
            }

            UninstallPreferences();

            ServiceManager.PlayerEngine.DisconnectEvent(OnPlayerEvent);

            elements_service.PrimaryWindowClose = null;

            interface_action_service.UIManager.RemoveUi(ui_manager_id);
            Gtk.Action close_action = interface_action_service.GlobalActions["CloseAction"];
            if (close_action != null)
            {
                interface_action_service.GlobalActions.Remove(close_action);
            }
            interface_action_service.GlobalActions.UpdateAction("QuitAction", true);

            AddinManager.AddinLoaded -= OnAddinLoaded;

            sound_menu               = null;
            elements_service         = null;
            interface_action_service = null;
        }
Example #2
0
        private bool ServiceStartup()
        {
            if (elements_service == null || interface_action_service == null)
            {
                return(false);
            }

            interface_action_service.GlobalActions.Add(new ActionEntry [] {
                new ActionEntry("CloseAction", Stock.Close,
                                Catalog.GetString("_Close"), "<Control>W",
                                Catalog.GetString("Close"), CloseWindow)
            });
            ui_manager_id = interface_action_service.UIManager.AddUiFromString(@"
              <ui>
                <menubar name=""MainMenu"">
                  <menu name=""MediaMenu"" action=""MediaMenuAction"">
                    <placeholder name=""ClosePlaceholder"">
                    <menuitem name=""Close"" action=""CloseAction""/>
                    </placeholder>
                  </menu>
                </menubar>
              </ui>
            ");
            interface_action_service.GlobalActions.UpdateAction("QuitAction", false);

            InstallPreferences();
            sound_menu = new SoundMenuProxy();
            if (Enabled)
            {
                sound_menu.Register(true);
            }

            ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent,
                                                     PlayerEvent.StartOfStream |
                                                     PlayerEvent.EndOfStream |
                                                     PlayerEvent.TrackInfoUpdated |
                                                     PlayerEvent.StateChange);

            artwork_manager_service = ServiceManager.Get <ArtworkManager> ();
            artwork_manager_service.AddCachedSize(icon_size);

            RegisterCloseHandler();

            ServiceManager.ServiceStarted -= OnServiceStarted;

            return(true);
        }
Example #3
0
        private bool ServiceStartup()
        {
            if (elements_service == null || interface_action_service == null) {
                return false;
            }

            interface_action_service.GlobalActions.Add (new ActionEntry [] {
                new ActionEntry ("CloseAction", Stock.Close,
                    Catalog.GetString ("_Close"), "<Control>W",
                    Catalog.GetString ("Close"), CloseWindow)
            });
            ui_manager_id = interface_action_service.UIManager.AddUiFromString (@"
              <ui>
                <menubar name=""MainMenu"">
                  <menu name=""MediaMenu"" action=""MediaMenuAction"">
                    <placeholder name=""ClosePlaceholder"">
                    <menuitem name=""Close"" action=""CloseAction""/>
                    </placeholder>
                  </menu>
                </menubar>
              </ui>
            ");
            interface_action_service.GlobalActions.UpdateAction ("QuitAction", false);

            InstallPreferences ();
            sound_menu = new SoundMenuProxy ();
            if (Enabled) {
                sound_menu.Register (true);
            }

            ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent,
               PlayerEvent.StartOfStream |
               PlayerEvent.EndOfStream |
               PlayerEvent.TrackInfoUpdated |
               PlayerEvent.StateChange);

            artwork_manager_service = ServiceManager.Get<ArtworkManager> ();
            artwork_manager_service.AddCachedSize (icon_size);

            RegisterCloseHandler ();

            ServiceManager.ServiceStarted -= OnServiceStarted;

            return true;
        }
Example #4
0
        public void Dispose()
        {
            if (current_nf != null) {
                try {
                    current_nf.Close ();
                } catch {}
            }

            UninstallPreferences ();

            ServiceManager.PlayerEngine.DisconnectEvent (OnPlayerEvent);

            elements_service.PrimaryWindowClose = null;

            interface_action_service.UIManager.RemoveUi (ui_manager_id);
            Gtk.Action close_action = interface_action_service.GlobalActions["CloseAction"];
            if (close_action != null) {
                interface_action_service.GlobalActions.Remove (close_action);
            }
            interface_action_service.GlobalActions.UpdateAction ("QuitAction", true);

            AddinManager.AddinLoaded -= OnAddinLoaded;

            sound_menu = null;
            elements_service = null;
            interface_action_service = null;
        }