예제 #1
0
        public NowPlayingSource() : base("now-playing", Catalog.GetString("Now Playing"), 10, "now-playing")
        {
            Properties.SetString("Icon.Name", "applications-multimedia");
            Properties.Set <bool> ("Nereid.SourceContents.HeaderVisible", false);
            Properties.SetString("ActiveSourceUIResource", "ActiveSourceUI.xml");

            var simplified_conf = CreateSchema <bool> ("simplified_mode");

            var actions = new BansheeActionGroup("NowPlaying");

            actions.AddImportant(new ToggleActionEntry("SimplifyNowPlaying", null, Catalog.GetString("Simplify"),
                                                       "F9", Catalog.GetString("Hide/Show the source list, menu, toolbar, and status bar"),
                                                       delegate {
                bool simple = !Properties.Get <bool> ("Nereid.SimpleUI");
                Properties.Set <bool> ("Nereid.SimpleUI", simple);
                (actions["SimplifyNowPlaying"] as ToggleAction).Active = simple;
                simplified_conf.Set(simple);
            }, simplified_conf.Get())
                                 );
            Properties.Set <bool> ("Nereid.SimpleUI", simplified_conf.Get());
            Properties.Set <BansheeActionGroup> ("ActiveSourceActions", actions);

            ServiceManager.SourceManager.AddSource(this);

            ServiceManager.PlaybackController.Transition   += OnPlaybackControllerTransition;
            ServiceManager.PlaybackController.TrackStarted += OnPlaybackControllerTrackStarted;
            ServiceManager.PlayerEngine.ConnectEvent(OnTrackInfoUpdated, PlayerEvent.TrackInfoUpdated);
            ServiceManager.PlayerEngine.ConnectEvent(OnCreateVideoWindow, PlayerEvent.PrepareVideoWindow);
        }
        public FixSource() : base(Catalog.GetString("Metadata Fixer"), Catalog.GetString("Metadata Fixer"), -1)
        {
            TypeUniqueId = "fixes";

            var header_widget = new HBox()
            {
                Spacing = 6
            };

            header_widget.PackStart(new Label(Catalog.GetString("Problem Type:")), false, false, 0);

            var combo = new Banshee.Widgets.DictionaryComboBox <Solver> ();

            foreach (var solver in problem_model.Solvers)
            {
                combo.Add(solver.Name, solver);
            }
            combo.Changed += (o, a) => {
                problem_model.Solver = combo.ActiveValue;
                SetStatus(problem_model.Solver.Description, false, false, "gtk-info");
            };
            combo.Active = 0;

            var apply_button = new Hyena.Widgets.ImageButton(Catalog.GetString("Apply Selected Fixes"), "gtk-apply");

            apply_button.Clicked   += (o, a) => problem_model.Fix();
            problem_model.Reloaded += (o, a) => apply_button.Sensitive = problem_model.SelectedCount > 0;

            header_widget.PackStart(combo, false, false, 0);
            header_widget.PackStart(apply_button, false, false, 0);
            header_widget.ShowAll();

            Properties.SetStringList("Icon.Name", "search", "gtk-search");
            Properties.SetString("ActiveSourceUIResource", "ActiveUI.xml");
            Properties.SetString("GtkActionPath", "/FixSourcePopup");
            Properties.Set <Gtk.Widget> ("Nereid.SourceContents.HeaderWidget", header_widget);
            Properties.Set <Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new View(problem_model));
            Properties.SetString("UnmapSourceActionLabel", Catalog.GetString("Close"));
            Properties.SetString("UnmapSourceActionIconName", "gtk-close");

            var actions = new BansheeActionGroup("fix-source");

            actions.AddImportant(
                new ActionEntry("RefreshProblems", Stock.Refresh, Catalog.GetString("Refresh"), null, null, (o, a) => {
                problem_model.Refresh();
            })
                );
            actions.Register();

            problem_model.Reload();
        }
        public DuplicateSongDetectorSource() : base(AddinManager.CurrentLocalizer.GetString("Duplicate Song Detector"), AddinManager.CurrentLocalizer.GetString("Duplicate Song Detector"), sort_order, "extension-unique-id")
        {
            Properties.SetStringList("Icon.Name", "search", "gtk-search");
            Properties.Set <Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new SongDuplicateView());
            Properties.SetString("ActiveSourceUIResource", "ActiveUI.xml");
            Properties.SetString("UnmapSourceActionLabel", AddinManager.CurrentLocalizer.GetString("Close"));
            Properties.SetString("UnmapSourceActionIconName", "gtk-close");

            var actions = new BansheeActionGroup("duplicate-source");

            actions.AddImportant(
                new Gtk.ActionEntry("onStartDetecting", Gtk.Stock.Refresh, AddinManager.CurrentLocalizer.GetString("Refresh"), null, null, (o, a) => {
                SongDuplicateView.ReloadWindow();
            })
                );
            actions.Register();
        }
예제 #4
0
        public FolderSyncSource() : base(AddinManager.CurrentLocalizer.GetString("FolderSync"),
                                         "FolderSync",
                                         sort_order, "extension-unique-id")
        {
            Properties.SetStringList("Icon.Name", "refresh", "gtk-refresh");
            Properties.Set <ISourceContents> ("Nereid.SourceContents", Controller);
            Properties.SetString("ActiveSourceUIResource", "ActiveUI.xml");
            Properties.SetString("UnmapSourceActionLabel", AddinManager.CurrentLocalizer.GetString("Close"));
            Properties.SetString("UnmapSourceActionIconName", "gtk-close");
            var actions = new BansheeActionGroup("directory-sync");

            actions.AddImportant(
                new Gtk.ActionEntry("StopSyncing", Gtk.Stock.Stop, AddinManager.CurrentLocalizer.GetString("Stop"), null, null,
                                    (o, a) => {
                if (Controller != null)
                {
                    Controller.StopSync();
                }
            })
                );
            actions.Register();
        }