Ejemplo n.º 1
0
        private void UpdateActions()
        {
            InterfaceActionService uia_service = ServiceManager.Get <InterfaceActionService> ();

            if (uia_service == null)
            {
                return;
            }

            Gtk.Action rip_action = uia_service.GlobalActions["RipDiscAction"];
            if (rip_action != null)
            {
                string title            = disc_model.Title;
                int    max_title_length = 20;
                title = title.Length > max_title_length
                    ? String.Format("{0}\u2026", title.Substring (0, max_title_length).Trim())
                    : title;

                rip_action.Label      = String.Format(Catalog.GetString("Import \u201f{0}\u201d"), title);
                rip_action.ShortLabel = Catalog.GetString("Import CD");
                rip_action.IconName   = "media-import-audio-cd";
                rip_action.Sensitive  = AudioCdRipper.Supported && disc_model.EnabledCount > 0;
            }

            Gtk.Action duplicate_action = uia_service.GlobalActions["DuplicateDiscAction"];
            if (duplicate_action != null)
            {
                duplicate_action.IconName = "media-cdrom";
                duplicate_action.Visible  = AudioCdDuplicator.Supported;
            }
        }
Ejemplo n.º 2
0
        private void InstallInterfaceActions()
        {
            InterfaceActionService action_service = ServiceManager.Get <InterfaceActionService> ();

            lyrics_action_group = new ActionGroup("Lyrics");

            lyrics_action_group.Add(new ActionEntry[] {
                new ActionEntry("LyricsAction", null,
                                AddinManager.CurrentLocalizer.GetString("L_yrics"), null,
                                AddinManager.CurrentLocalizer.GetString("Manage Lyrics"), null),
                new ActionEntry("FetchLyricsAction", null,
                                AddinManager.CurrentLocalizer.GetString("_Download Lyrics"), null,
                                AddinManager.CurrentLocalizer.GetString("Download lyrics for all tracks"), OnFetchLyrics)
            });

            lyrics_action_group.Add(new ToggleActionEntry[] {
                new ToggleActionEntry("ShowLyricsAction", null,
                                      AddinManager.CurrentLocalizer.GetString("Show Lyrics"), "<control>T",
                                      AddinManager.CurrentLocalizer.GetString("Show Lyrics in a separate window"), null, false)
            });

            lyrics_action_group.GetAction("ShowLyricsAction").Activated += OnToggleWindow;
            lyrics_action_group.GetAction("ShowLyricsAction").Sensitive  = ServiceManager.PlayerEngine.CurrentTrack != null ? true : false;

            action_service.AddActionGroup(lyrics_action_group);

            ui_manager_id = action_service.UIManager.AddUiFromResource("LyricsMenu.xml");
        }
Ejemplo n.º 3
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            Banshee.Base.ThreadAssist.ProxyToMain(delegate {
                Gtk.Action fetch_action = action_service.GlobalActions["FetchCoverArtAction"];
                if (fetch_action != null)
                {
                    action_service.GlobalActions.Remove(fetch_action);
                }

                action_service.RemoveActionGroup("CoverArt");
                action_service.UIManager.RemoveUi(ui_manager_id);

                actions        = null;
                action_service = null;

                ServiceManager.SourceManager.MusicLibrary.TracksAdded   -= OnTracksAdded;
                ServiceManager.SourceManager.MusicLibrary.TracksChanged -= OnTracksChanged;

                disposed = true;
            });
        }
Ejemplo n.º 4
0
        private void UpdateActions()
        {
            InterfaceActionService uia_service = ServiceManager.Get <InterfaceActionService> ();

            Gtk.Action action = uia_service.TrackActions["BurnDiscAction"];

            bool visible   = false;
            bool sensitive = false;

            DatabaseSource source = ServiceManager.SourceManager.ActiveSource as DatabaseSource;

            // FIXME: Figure out how to handle non-music-library sources
            if (source != null)
            {
                if (source is MusicLibrarySource || source.Parent is MusicLibrarySource)
                {
                    visible = true;
                }

                sensitive = source.TrackModel.Selection.Count > 0;
            }

            action.Sensitive = sensitive;
            action.Visible   = visible;
        }
        void IExtensionService.Initialize()
        {
            Log.Debug("[RadioStationFetcherService] <Initialize> START");

            action_service = ServiceManager.Get <InterfaceActionService> ();
            actions        = new ActionGroup("Radio-station fetcher");

            // Add sources
            ActionEntry[] source_actions =
            {
                new ActionEntry("RadioStationFetcherAction",                                              null,
                                AddinManager.CurrentLocalizer.GetString("_Radiostation fetcher"),         null,
                                null,                                                                     null),
                new ActionEntry("ShoutcastAction",                                                        null,
                                AddinManager.CurrentLocalizer.GetString("_Shoutcast"),                    null,
                                AddinManager.CurrentLocalizer.GetString("Fetch stations from shoutcast"), delegate {
                    shoutcast.ShowDialog();
                }),
                new ActionEntry("XiphAction",                                                             null,
                                AddinManager.CurrentLocalizer.GetString("_Xiph"),                         null,
                                AddinManager.CurrentLocalizer.GetString("Fetch stations from Xiph"),      delegate {
                    xiph.ShowDialog();
                })
            };

            actions.Add(source_actions);

            action_service.UIManager.InsertActionGroup(actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource("RadioStationFetcherMenu.xml");

            Log.Debug("[RadioStationFetcherService] <Initialize> END");
        }
Ejemplo n.º 6
0
        private bool SetupInterfaceActions()
        {
            action_service = ServiceManager.Get <InterfaceActionService> ();

            if (action_service.FindActionGroup("ClutterFlowView") == null)
            {
                clutterflow_actions = new ActionGroup("ClutterFlowView");

                ToggleActionEntry [] tae = new ToggleActionEntry [] { new ToggleActionEntry("ClutterFlowVisibleAction", null,
                                                                                            AddinManager.CurrentLocalizer.GetString("Show ClutterFlow Browser"), null,
                                                                                            AddinManager.CurrentLocalizer.GetString("Show or hide the ClutterFlow browser"),
                                                                                            null, ClutterFlowSchemas.ShowClutterFlow.Get()) };
                clutterflow_actions.Add(tae);

                action_service.AddActionGroup(clutterflow_actions);
                ui_manager_id = action_service.UIManager.AddUiFromString(menu_xml);
            }

            source_manager.ActiveSourceChanged += HandleActiveSourceChanged;

            BrowserAction.Activated += OnToggleBrowser;
            CfBrowsAction.Activated += OnToggleClutterFlow;

            return(true);
        }
Ejemplo n.º 7
0
        private BookmarkUI()
        {
            action_service = ServiceManager.Get <InterfaceActionService> ("InterfaceActionService");

            actions = new ActionGroup("Bookmarks");

            actions.Add(new ActionEntry [] {
                new ActionEntry("BookmarksAction", null,
                                Catalog.GetString("_Bookmarks"), null,
                                null, null),
                new ActionEntry("BookmarksAddAction", Stock.Add,
                                Catalog.GetString("_Add Bookmark"), "<control>D",
                                Catalog.GetString("Bookmark the Position in the Current Track"),
                                HandleNewBookmark)
            });

            action_service.UIManager.InsertActionGroup(actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource("BookmarksMenu.xml");
            bookmark_item = action_service.UIManager.GetWidget("/MainMenu/ToolsMenu/Bookmarks") as ImageMenuItem;
            new_item      = action_service.UIManager.GetWidget("/MainMenu/ToolsMenu/Bookmarks/Add") as ImageMenuItem;

            bookmark_menu           = bookmark_item.Submenu as Menu;
            bookmark_item.Selected += HandleMenuShown;

            remove_item           = new ImageMenuItem(Catalog.GetString("_Remove Bookmark"));
            remove_item.Sensitive = false;
            remove_item.Image     = new Image(Stock.Remove, IconSize.Menu);

            remove_item.Submenu = remove_menu = new Menu();
            bookmark_menu.Append(remove_item);

            LoadBookmarks();
        }
Ejemplo n.º 8
0
        private void BuildHeader()
        {
            source_actions_align = new Gtk.Alignment(0f, .5f, 1f, 0f)
            {
                RightPadding = 0,
                LeftPadding  = 0,
                NoShowAll    = true
            };

            if (Hyena.PlatformDetection.IsMeeGo)
            {
                source_actions_align.RightPadding = 5;
                source_actions_align.TopPadding   = 5;
            }

            footer = new VBox();

            source_actions_box = new EventBox()
            {
                Visible = true
            };

            BuildSearchEntry();

            InterfaceActionService uia = ServiceManager.Get <InterfaceActionService> ();

            if (uia != null)
            {
                Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                if (action != null)
                {
                    MenuItem item = new SeparatorMenuItem();
                    item.Show();
                    search_entry.Menu.Append(item);

                    item            = new ImageMenuItem(Stock.Help, null);
                    item.Activated += delegate { action.Activate(); };
                    item.Show();
                    search_entry.Menu.Append(item);
                }
            }

            source_actions_box.ShowAll();
            source_actions_align.Add(source_actions_box);
            source_actions_align.Hide();
            search_entry.Show();


            context_pane = new Banshee.ContextPane.ContextPane();
            context_pane.ExpandHandler = b => {
                SetChildPacking(content.Widget, !b, true, 0, PackType.Start);
                SetChildPacking(context_pane, b, b, 0, PackType.End);
            };

            // Top to bottom, their order is reverse of this:
            PackEnd(footer, false, false, 0);
            PackEnd(context_pane, false, false, 0);
            PackEnd(source_actions_align, false, false, 0);
            PackEnd(new ConnectedMessageBar(), false, true, 0);
        }
Ejemplo n.º 9
0
        public FileSystemQueueSource() : base(Catalog.GetString("File System Queue"),
                                              Catalog.GetString("File System Queue"), "file-system-queue", 30)
        {
            TypeUniqueId = "file-system-queue";
            Properties.SetStringList("Icon.Name", "system-file-manager");
            Properties.Set <bool> ("AutoAddSource", false);
            IsLocal = true;

            ServiceManager.Get <DBusCommandService> ().ArgumentPushed += OnCommandLineArgument;

            AfterInitialized();

            InterfaceActionService uia_service = ServiceManager.Get <InterfaceActionService> ();

            uia_service.GlobalActions.AddImportant(
                new ActionEntry("ClearFileSystemQueueAction", Stock.Clear,
                                Catalog.GetString("Clear"), null,
                                Catalog.GetString("Remove all tracks from the file system queue"),
                                OnClearFileSystemQueue)
                );

            uia_service.GlobalActions.Add(new ToggleActionEntry [] {
                new ToggleActionEntry("ClearFileSystemQueueOnQuitAction", null,
                                      Catalog.GetString("Clear on Quit"), null,
                                      Catalog.GetString("Clear the file system queue when quitting"),
                                      OnClearFileSystemQueueOnQuit, ClearOnQuitSchema.Get())
            });

            uia_service.UIManager.AddUiFromResource("GlobalUI.xml");

            Properties.SetString("ActiveSourceUIResource", "ActiveSourceUI.xml");
            Properties.SetString("GtkActionPath", "/FileSystemQueueContextMenu");

            actions_loaded = true;

            UpdateActions();
            ServiceManager.SourceManager.ActiveSourceChanged += delegate { ThreadAssist.ProxyToMain(UpdateActions); };
            TrackModel.Reloaded += OnTrackModelReloaded;

            Reload();

            play_enqueued = ApplicationContext.CommandLine.Contains("play-enqueued");

            foreach (string path in ApplicationContext.CommandLine.Files)
            {
                // If it looks like a URI with a protocol, leave it as is
                if (System.Text.RegularExpressions.Regex.IsMatch(path, "^\\w+\\:\\/"))
                {
                    Log.DebugFormat("URI file : {0}", path);
                    Enqueue(path);
                }
                else
                {
                    Log.DebugFormat("Relative file : {0} -> {1}", path, Path.GetFullPath(path));
                    Enqueue(Path.GetFullPath(path));
                }
            }

            StorageName = null;
        }
Ejemplo n.º 10
0
        private void SetupActions()
        {
            InterfaceActionService uia_service = ServiceManager.Get <InterfaceActionService> ();

            if (uia_service == null)
            {
                return;
            }

            uia_service.GlobalActions.AddImportant(new Gtk.ActionEntry [] {
                new Gtk.ActionEntry("RipDiscAction", null,
                                    Catalog.GetString("Import CD"), null,
                                    Catalog.GetString("Import this audio CD to the library"),
                                    OnImportDisc)
            });

            uia_service.GlobalActions.AddImportant(
                new Gtk.ActionEntry("DuplicateDiscAction", null,
                                    Catalog.GetString("Duplicate CD"), null,
                                    Catalog.GetString("Duplicate this audio CD"),
                                    OnDuplicateDisc)
                );

            global_interface_id = uia_service.UIManager.AddUiFromResource("GlobalUI.xml");
        }
Ejemplo n.º 11
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>
            ");
        }
Ejemplo n.º 12
0
        void IExtensionService.Initialize()
        {
            Hyena.Log.Debug("Initializing LCD service");

            action_service = ServiceManager.Get <InterfaceActionService> ();
            actions        = new ActionGroup("LCD");
            actions.Add(new ActionEntry [] {
                new ActionEntry("LCDAction", null,
                                AddinManager.CurrentLocalizer.GetString("LCD"), null,
                                null, null),
                new ActionEntry("LCDConfigureAction", Stock.Properties,
                                AddinManager.CurrentLocalizer.GetString("_Configure..."), null,
                                AddinManager.CurrentLocalizer.GetString("Configure the LCD plugin"), OnConfigure)
            });
            action_service.UIManager.InsertActionGroup(actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource("LCDMenu.xml");

            ScreensCreate();

            lcdclient            = new LCDClient(Host, Port);
            lcdclient.Connected += OnConnected;
            parser = new LCDParser();
            ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent,
                                                     PlayerEvent.Iterate |
                                                     PlayerEvent.StartOfStream |
                                                     PlayerEvent.EndOfStream |
                                                     PlayerEvent.TrackInfoUpdated |
                                                     PlayerEvent.StateChange);
        }
Ejemplo n.º 13
0
        protected virtual void OnHalfResolutionToggled(object sender, System.EventArgs e)
        {
            InterfaceActionService ias = ServiceManager.Get <InterfaceActionService>();

            halfResolution = ((ToggleAction)ias.GlobalActions[LOW_RES_ACTION]).Active;
            needsResize    = true;
        }
        public CompositeTrackSourceContents() : base("albumartist")
        {
            if (ServiceManager.Contains("InterfaceActionService"))
            {
                action_service = ServiceManager.Get <InterfaceActionService> ();

                if (action_service.FindActionGroup("BrowserConfiguration") == null)
                {
                    configure_browser_actions = new ActionGroup("BrowserConfiguration");

                    configure_browser_actions.Add(new ActionEntry [] {
                        new ActionEntry("BrowserContentMenuAction", null,
                                        Catalog.GetString("Browser Content"), null,
                                        Catalog.GetString("Configure the filters available in the browser"), null)
                    });

                    configure_browser_actions.Add(new ToggleActionEntry [] {
                        new ToggleActionEntry("ShowArtistFilterAction", null,
                                              Catalog.GetString("Show Artist Filter"), null,
                                              Catalog.GetString("Show a list of artists to filter by"), null, ArtistFilterVisible.Get())
                    });

                    configure_browser_actions.Add(new RadioActionEntry [] {
                        new RadioActionEntry("ShowTrackArtistFilterAction", null,
                                             Catalog.GetString("Show all Artists"), null,
                                             Catalog.GetString("Show all artists in the artist filter"), 0),

                        new RadioActionEntry("ShowAlbumArtistFilterAction", null,
                                             Catalog.GetString("Show Album Artists"), null,
                                             Catalog.GetString("Show only album artists, not artists with only single tracks"), 1),
                    }, ArtistFilterType.Get().Equals("artist") ? 0 : 1, null);

                    configure_browser_actions.Add(new ToggleActionEntry [] {
                        new ToggleActionEntry("ShowGenreFilterAction", null,
                                              Catalog.GetString("Show Genre Filter"), null,
                                              Catalog.GetString("Show a list of genres to filter by"), null, GenreFilterVisible.Get())
                    });

                    configure_browser_actions.Add(new ToggleActionEntry [] {
                        new ToggleActionEntry("ShowYearFilterAction", null,
                                              Catalog.GetString("Show Year Filter"), null,
                                              Catalog.GetString("Show a list of years to filter by"), null, YearFilterVisible.Get())
                    });

                    action_service.AddActionGroup(configure_browser_actions);
                    action_service.UIManager.AddUiFromString(menu_xml);
                }

                action_service.FindAction("BrowserConfiguration.ShowArtistFilterAction").Activated += OnArtistFilterVisibilityChanged;
                action_service.FindAction("BrowserConfiguration.ShowGenreFilterAction").Activated  += OnGenreFilterChanged;;
                action_service.FindAction("BrowserConfiguration.ShowYearFilterAction").Activated   += OnYearFilterChanged;;

                var artist_filter_action      = action_service.FindAction("BrowserConfiguration.ShowTrackArtistFilterAction") as RadioAction;
                var albumartist_filter_action = action_service.FindAction("BrowserConfiguration.ShowAlbumArtistFilterAction") as RadioAction;
                artist_filter_action.Changed       += OnArtistFilterChanged;
                artist_filter_action.Sensitive      = ArtistFilterVisible.Get();
                albumartist_filter_action.Changed  += OnArtistFilterChanged;
                albumartist_filter_action.Sensitive = ArtistFilterVisible.Get();
            }
        }
Ejemplo n.º 15
0
        void IExtensionService.Initialize()
        {
            elements_service         = ServiceManager.Get <GtkElementsService> ();
            interface_action_service = ServiceManager.Get <InterfaceActionService> ();

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

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

            AddinManager.AddinLoaded += OnAddinLoaded;

            if (!ServiceStartup())
            {
                ServiceManager.ServiceStarted += OnServiceStarted;
            }
        }
Ejemplo n.º 16
0
        private void RemoveClutterFlow()
        {
            Clutter.Threads.Enter();
            music_library.Properties.Remove("Nereid.SourceContents");
            Clutter.Threads.Leave();
            clutter_flow_contents.Dispose();
            clutter_flow_contents = null;

            source_manager.ActiveSourceChanged -= HandleActiveSourceChanged;
            BrowserAction.Activated            -= OnToggleBrowser;
            BrowserAction.Active     = ClutterFlowSchemas.OldShowBrowser.Get();
            CfBrowsAction.Activated -= OnToggleClutterFlow;
            CfBrowsAction.Visible    = false;

            action_service.RemoveActionGroup("ClutterFlowView");
            action_service.UIManager.RemoveUi(ui_manager_id);
            clutterflow_actions = null;
            cfbrows_action      = null;

            preference_service = null;
            source_manager     = null;
            music_library      = null;
            action_service     = null;
            browser_action     = null;
            cfbrows_action     = null;
        }
Ejemplo n.º 17
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;
        }
Ejemplo n.º 18
0
        public FilteredListSourceContents(string name,
                                          SchemaEntry <int> pane_top_position,
                                          SchemaEntry <int> pane_left_position)
        {
            this.name = name;
            this.pane_top_position  = pane_top_position;
            this.pane_left_position = pane_left_position;

            InitializeViews();

            string position = Layout();

            if (ForcePosition != null)
            {
                return;
            }

            if (ServiceManager.Contains("InterfaceActionService"))
            {
                action_service = ServiceManager.Get <InterfaceActionService> ();

                if (action_service.FindActionGroup("BrowserView") == null)
                {
                    browser_view_actions = new ActionGroup("BrowserView");

                    browser_view_actions.Add(new RadioActionEntry [] {
                        new RadioActionEntry("BrowserLeftAction", null,
                                             Catalog.GetString("Browser on Left"), null,
                                             Catalog.GetString("Show the artist/album browser to the left of the track list"), 0),

                        new RadioActionEntry("BrowserTopAction", null,
                                             Catalog.GetString("Browser on Top"), null,
                                             Catalog.GetString("Show the artist/album browser above the track list"), 1),
                    }, position == "top" ? 1 : 0, null);

                    browser_view_actions.Add(new ToggleActionEntry [] {
                        new ToggleActionEntry("BrowserVisibleAction", null,
                                              Catalog.GetString("Show Browser"), "<control>B",
                                              Catalog.GetString("Show or hide the artist/album browser"),
                                              null, BrowserVisible.Get())
                    });

                    action_service.AddActionGroup(browser_view_actions);
                    //action_merge_id = action_service.UIManager.NewMergeId ();
                    action_service.UIManager.AddUiFromString(menu_xml);
                }

                (action_service.FindAction("BrowserView.BrowserLeftAction") as RadioAction).Changed += OnViewModeChanged;
                (action_service.FindAction("BrowserView.BrowserTopAction") as RadioAction).Changed  += OnViewModeChanged;
                action_service.FindAction("BrowserView.BrowserVisibleAction").Activated             += OnToggleBrowser;
            }

            ServiceManager.SourceManager.ActiveSourceChanged += delegate {
                ThreadAssist.ProxyToMain(delegate {
                    browser_container.Visible = ActiveSourceCanHasBrowser ? BrowserVisible.Get() : false;
                });
            };

            NoShowAll = true;
        }
Ejemplo n.º 19
0
        void IExtensionService.Initialize()
        {
            Log.Debug("Initializing Alarm Plugin");

            AlarmClockService.alarm_service = this;
            ThreadStart alarmThreadStart = new ThreadStart(AlarmClockService.DoWait);

            alarm_thread = new Thread(alarmThreadStart);
            alarm_thread.Start();

            action_service = ServiceManager.Get <InterfaceActionService> ();

            actions = new ActionGroup("AlarmClock");

            actions.Add(new ActionEntry [] {
                new ActionEntry("AlarmClockAction", null,
                                AddinManager.CurrentLocalizer.GetString("Alarm Clock"), null,
                                null, null),

                new ActionEntry("SetSleepTimerAction", null,
                                AddinManager.CurrentLocalizer.GetString("Sleep Timer..."), null,
                                AddinManager.CurrentLocalizer.GetString("Set the sleep timer value"), OnSetSleepTimer),

                new ActionEntry("SetAlarmAction", null,
                                AddinManager.CurrentLocalizer.GetString("Alarm..."), null,
                                AddinManager.CurrentLocalizer.GetString("Set the alarm time"), OnSetAlarm),

                new ActionEntry("AlarmClockConfigureAction", Stock.Properties,
                                AddinManager.CurrentLocalizer.GetString("_Configure..."), null,
                                AddinManager.CurrentLocalizer.GetString("Configure the Alarm Clock plugin"), OnConfigure)
            });

            action_service.UIManager.InsertActionGroup(actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource("AlarmMenu.xml");
        }
Ejemplo n.º 20
0
        public SearchEntry()
        {
            BuildSearchEntry();

            InterfaceActionService uia = ServiceManager.Get <InterfaceActionService> ();

            if (uia != null)
            {
                Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                if (action != null)
                {
                    MenuItem item = new SeparatorMenuItem();
                    item.Show();
                    Menu.Append(item);

                    item            = new ImageMenuItem(Stock.Help, null);
                    item.Activated += delegate { action.Activate(); };
                    item.Show();
                    Menu.Append(item);
                }
            }

            SearchSensitive = true;
            Show();
        }
Ejemplo n.º 21
0
        public VisualizationDisplayWidget()
        {
            visualizationMenu        = new Menu();
            noVisualizationsMenuItem = new MenuItem(
                AddinManager.CurrentLocalizer.GetString("No visualizations installed"));
            noVisualizationsMenuItem.Sensitive = false;
            noVisualizationsMenuItem.Show();
            visualizationMenu.Add(noVisualizationsMenuItem);

            glWidget = new GLWidget();
            glWidget.DoubleBuffered = true;
            glWidget.Render        += OnRender;
            glWidget.SizeAllocated += OnGlSizeAllocated;
            glWidget.Show();

            Add(glWidget);
            Show();

            playerData        = new BansheePlayerData(ServiceManager.PlayerEngine.ActiveEngine);
            playerData.Active = false;

            glWidget.Realized += delegate {
                if (!loopRunning)
                {
                    loopRunning  = true;
                    renderThread = new Thread(RenderLoop);
                    renderThread.Start();
                }

                ConnectVisualization();
            };

            glWidget.Unrealized += delegate {
                DisposeRenderer();
            };

            AddinManager.AddExtensionNodeHandler("/Banshee/OpenVP/Visualization", OnVisualizationChanged);

            InterfaceActionService ias = ServiceManager.Get <InterfaceActionService>();

            ias.GlobalActions.AddImportant(new ActionEntry(SELECT_VIS_ACTION,
                                                           null,
                                                           AddinManager.CurrentLocalizer.GetString("Select visualization"),
                                                           null, null,
                                                           OnSelectVisualizationClicked));

            ias.GlobalActions.AddImportant(new ToggleActionEntry(LOW_RES_ACTION,
                                                                 null,
                                                                 AddinManager.CurrentLocalizer.GetString("Low resolution"),
                                                                 null, null,
                                                                 OnHalfResolutionToggled, false));

            ias.GlobalActions.UpdateAction(SELECT_VIS_ACTION, false);
            ias.GlobalActions.UpdateAction(LOW_RES_ACTION, false);

            global_ui_id = ias.UIManager.AddUiFromResource("ActiveSourceUI.xml");
        }
Ejemplo n.º 22
0
        private void HandleFSButtonToggled(object sender, EventArgs e)
        {
            InterfaceActionService service = ServiceManager.Get <InterfaceActionService> ();

            if (service == null || service.ViewActions == null)
            {
                return;
            }
            service.ViewActions.Fullscreen(FilterView.FSButton.IsActive);
        }
Ejemplo n.º 23
0
        protected override void OnUnmapped()
        {
            base.OnUnmapped();
            playerData.Active = false;

            InterfaceActionService ias = ServiceManager.Get <InterfaceActionService>();

            ias.GlobalActions.UpdateAction(SELECT_VIS_ACTION, false);
            ias.GlobalActions.UpdateAction(LOW_RES_ACTION, false);
        }
        void IExtensionService.Initialize()
        {
            elements_service         = ServiceManager.Get <GtkElementsService> ();
            interface_action_service = ServiceManager.Get <InterfaceActionService> ();

            if (!ServiceStartup())
            {
                ServiceManager.ServiceStarted += OnServiceStarted;
            }
        }
Ejemplo n.º 25
0
        public void Dispose()
        {
            if (MoblinPanel.Instance != null)
            {
                MoblinPanel.Instance.Dispose();
            }

            interface_action_service = null;
            elements_service         = null;
        }
Ejemplo n.º 26
0
        private void DisableFullscreenAction()
        {
            InterfaceActionService service = ServiceManager.Get <InterfaceActionService> ();

            Gtk.ToggleAction action = service.ViewActions["FullScreenAction"] as Gtk.ToggleAction;
            if (action != null)
            {
                action.Active = false;
            }
        }
        private void RelinquishFullscreen()
        {
            InterfaceActionService service = ServiceManager.Get <InterfaceActionService> ();

            if (service == null || service.ViewActions == null)
            {
                return;
            }

            service.ViewActions.Fullscreen = previous_fullscreen_handler;
        }
        public void Dispose()
        {
            if (panel != null)
            {
                panel.Dispose();
                panel = null;
            }

            interface_action_service = null;
            elements_service         = null;
        }
Ejemplo n.º 29
0
        private void UpdateActions()
        {
            InterfaceActionService uia_service = ServiceManager.Get <InterfaceActionService> ();

            if (uia_service == null)
            {
                return;
            }

            uia_service.GlobalActions.UpdateAction("ClearFileSystemQueueAction", true, Count > 0);
        }
Ejemplo n.º 30
0
        private void DisposeActions()
        {
            InterfaceActionService uia_service = ServiceManager.Get <InterfaceActionService> ();

            if (uia_service == null)
            {
                return;
            }

            uia_service.GlobalActions.Remove("GoToMenuAction");
            uia_service.UIManager.RemoveUi(global_interface_id);
        }