Beispiel #1
0
        public BaseClientWindow(string title, string configNameSpace, int defaultWidth, int defaultHeight) : base(title)
        {
            elements_service = ServiceManager.Get <GtkElementsService> ();
            action_service   = ServiceManager.Get <InterfaceActionService> ();

            ConfigureWindow();

            window_controller = new PersistentWindowController(this, configNameSpace, defaultWidth, defaultHeight, WindowPersistOptions.All);
            window_controller.Restore();

            elements_service.PrimaryWindow = this;

            AddAccelGroup(action_service.UIManager.AccelGroup);

            InitializeWindow();

            try {
                if (System.IO.File.Exists(accel_map_file))
                {
                    Gtk.AccelMap.Load(accel_map_file);
                }
            } catch (Exception e) {
                Hyena.Log.Exception("Failed to load custom AccelMap", e);
            }
        }
Beispiel #2
0
        public void Initialize()
        {
            // TODO check for updates and other cool stuff
            version_updater.CheckForUpdates (false);

            elements_service = ServiceManager.Get<GtkElementsService> ();
            interface_action_service = ServiceManager.Get<InterfaceActionService> ();

            if (!ServiceStart ()) {
                ServiceManager.ServiceStarted += OnServiceStarted;
            }

            // add check for updates action
            interface_action_service.GlobalActions.Add (new Gtk.ActionEntry[] {
                new Gtk.ActionEntry ("CheckForUpdatesAction", null,
                    Catalog.GetString("Check for Updates"), null,
                    null, CheckForUpdatesEvent)
            });

            // merge check for updates menu item
            interface_action_service.UIManager.AddUiFromString (@"
              <ui>
                <menubar name=""MainMenu"">
                  <menu name=""HelpMenu"" action=""HelpMenuAction"">
                    <placeholder name=""CheckForUpdatesPlaceholder"">
                    <menuitem name=""CheckForUpdates"" action=""CheckForUpdatesAction""/>
                    </placeholder>
                  </menu>
                </menubar>
              </ui>
            ");
        }
Beispiel #3
0
        public BaseClientWindow(string title, WindowConfiguration windowConfiguration)
            : base(title)
        {
            elements_service = ServiceManager.Get<GtkElementsService> ();
            action_service = ServiceManager.Get<InterfaceActionService> ();

            ConfigureWindow ();

            window_controller = new PersistentWindowController (this, windowConfiguration, WindowPersistOptions.All);
            window_controller.Restore ();

            elements_service.PrimaryWindow = this;

            AddAccelGroup (action_service.UIManager.AccelGroup);

            InitializeWindow ();

            try {
                if (System.IO.File.Exists (accel_map_file)) {
                    Gtk.AccelMap.Load (accel_map_file);
                }
            } catch (Exception e) {
                Hyena.Log.Exception ("Failed to load custom AccelMap", e);
            }
        }
        void IExtensionService.Initialize ()
        {
            elements_service = ServiceManager.Get<GtkElementsService> ();
            interface_action_service = ServiceManager.Get<InterfaceActionService> ();

            if (!ServiceStartup ()) {
                ServiceManager.ServiceStarted += OnServiceStarted;
            }
        }
Beispiel #5
0
        private void OnServiceStarted (ServiceStartedArgs args)
        {
            if (args.Service is Banshee.Gui.InterfaceActionService) {
                interface_action_service = (InterfaceActionService)args.Service;
            } else if (args.Service is GtkElementsService) {
                elements_service = (GtkElementsService)args.Service;
            } else if (args.Service is SourceManager) {
                source_manager = ServiceManager.SourceManager;
            } else if (args.Service is PlayerEngineService) {
                player = ServiceManager.PlayerEngine;
            }

            ServiceStartup ();
        }
Beispiel #6
0
        void IExtensionService.Initialize ()
        {
            elements_service = ServiceManager.Get<GtkElementsService> ();
            interface_action_service = ServiceManager.Get<InterfaceActionService> ();

            var notif_addin = AddinManager.Registry.GetAddin("Banshee.NotificationArea");

            if (notif_addin != null && notif_addin.Enabled) {
                Log.Debug("NotificationArea conflicts with ApplicationIndicator, disabling NotificationArea");
                notif_addin.Enabled = false;
            }

            AddinManager.AddinLoaded += OnAddinLoaded;

            if (!ServiceStartup ()) {
                ServiceManager.ServiceStarted += OnServiceStarted;
            }
        }
Beispiel #7
0
        protected BaseClientWindow(string title, WindowConfiguration windowConfiguration) : base(title)
        {
            elements_service = ServiceManager.Get <GtkElementsService> ();
            action_service   = ServiceManager.Get <InterfaceActionService> ();

            ConfigureWindow(windowConfiguration);

            elements_service.PrimaryWindow = this;

            AddAccelGroup(action_service.UIManager.AccelGroup);

            InitializeWindow();

            try {
                if (System.IO.File.Exists(accel_map_file))
                {
                    Gtk.AccelMap.Load(accel_map_file);
                }
            } catch (Exception e) {
                Log.Error("Failed to load custom AccelMap", e);
            }
        }
        protected BaseClientWindow(string title, WindowConfiguration windowConfiguration)
            : base(title)
        {
            elements_service = ServiceManager.Get<GtkElementsService> ();
            action_service = ServiceManager.Get<InterfaceActionService> ();

            ConfigureWindow (windowConfiguration);

            elements_service.PrimaryWindow = this;

            AddAccelGroup (action_service.UIManager.AccelGroup);

            InitializeWindow ();

            try {
                if (System.IO.File.Exists (accel_map_file)) {
                    Gtk.AccelMap.Load (accel_map_file);
                }
            } catch (Exception e) {
                Log.Error ("Failed to load custom AccelMap", e);
            }
        }
Beispiel #9
0
        private void OnFullScreen(object o, EventArgs args)
        {
            Gtk.ToggleAction action = this["FullScreenAction"] as Gtk.ToggleAction;
            if (action == null)
            {
                return;
            }

            if (Fullscreen != null)
            {
                Fullscreen(action.Active);
                return;
            }

            GtkElementsService service = ServiceManager.Get <GtkElementsService> ();

            if (service == null || action == null)
            {
                return;
            }

            Gtk.Window window = service.PrimaryWindow;

            if (window == null)
            {
                return;
            }
            else if (action.Active)
            {
                window.Fullscreen();
            }
            else
            {
                window.Unfullscreen();
            }
        }
Beispiel #10
0
        public void Dispose ()
        {
            if (panel != null) {
                panel.Dispose ();
                panel = null;
            }

            interface_action_service = null;
            elements_service = null;
        }
Beispiel #11
0
        public void Dispose ()
        {
            if (disposed) {
                return;
            }

            if (current_nf != null) {
                try {
                    current_nf.Close ();
                } catch {}
            }

            // Hide the AppIndicator before disposing
            indicator.Status = Status.Passive;
            indicator.Dispose();
            indicator = null;

            ServiceManager.PlayerEngine.DisconnectEvent (OnPlayerEvent);

            elements_service.PrimaryWindowClose = null;

            Gtk.Action close_action = interface_action_service.GlobalActions["CloseAction"];
            if (close_action != null) {
                interface_action_service.GlobalActions.Remove (close_action);
            }

            if (ui_manager_id >= 0) {
                interface_action_service.RemoveActionGroup ("AppIndicator");
                interface_action_service.UIManager.RemoveUi ((uint)ui_manager_id);
                ui_manager_id = -1;
            }

            elements_service = null;
            interface_action_service = null;

            AddinManager.AddinLoaded -= OnAddinLoaded;

            disposed = true;
        }
Beispiel #12
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;
        }
        private void OnServiceStarted(ServiceStartedArgs args)
        {
            if (args.Service is GtkElementsService)
                elements_service = (GtkElementsService)args.Service;

            ServiceStartup ();
        }
        void IExtensionService.Initialize()
        {
            if (!ServiceManager.DbConnection.TableExists ("MoodPaths")) {
                ServiceManager.DbConnection.Execute (@"
                    CREATE TABLE MoodPaths (
                        TrackID     INTEGER UNIQUE,
                        FileName  STRING,
                        LastAttempt INTEGER NOT NULL
                    )");
            }

            elements_service = ServiceManager.Get<GtkElementsService> ();

            if (!ServiceStartup ()) {
                ServiceManager.ServiceStarted += OnServiceStarted;
                ServiceManager.SourceManager.SourceAdded += OnSourceAdded;
            }
        }
        public void Dispose()
        {
            if (disposed) {
                return;
            }

            if (current_nf != null) {
                try {
                    current_nf.Close ();
                } catch {}
            }

            if (notif_area != null) {
                notif_area.Dispose ();
                notif_area = null;
            }

            ServiceManager.PlayerEngine.DisconnectEvent (OnPlayerEvent);

            elements_service.PrimaryWindowClose = null;

            Gtk.Action close_action = interface_action_service.GlobalActions["CloseAction"];
            if (close_action != null) {
                interface_action_service.GlobalActions.Remove (close_action);
            }

            if (ui_manager_id >= 0) {
                interface_action_service.RemoveActionGroup ("NotificationArea");
                interface_action_service.UIManager.RemoveUi ((uint)ui_manager_id);
                ui_manager_id = -1;
            }

            actions = null;
            elements_service = null;
            interface_action_service = null;

            disposed = true;
        }
Beispiel #16
0
        public void Dispose()
        {
            if (view_menu != null && menu_item != null) {
                view_menu.Remove (menu_item);
            }

            if (panel != null) {
                panel.Dispose ();
                panel = null;
            }

            interface_action_service = null;
            elements_service = null;
        }
        private void OnServiceStarted(ServiceStartedArgs args)
        {
            if (args.Service is Banshee.Gui.InterfaceActionService) {
                interface_action_service = (InterfaceActionService)args.Service;
            } else if (args.Service is GtkElementsService) {
                elements_service = (GtkElementsService)args.Service;
            }

            ServiceStartup ();
        }
Beispiel #18
0
 void OnServiceStarted(ServiceStartedArgs args)
 {
     if (args.Service is GtkElementsService) {
         elements_service = (GtkElementsService)args.Service;
         ServiceStart ();
     } else if (args.Service is InterfaceActionService) {
         interface_action_service = (InterfaceActionService)args.Service;
         ServiceStart ();
     }
 }