// private PreferenceBase logout_pref;
        public StoreSourcePreferences(StoreSource source)
        {
            var service = ServiceManager.Get<PreferenceService> ();
            if (service == null) {
                return;
            }

            this.source = source;

            service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters;

            source_page = new SourcePage (source);

            var country_section = source_page.Add (new Section ("country", Catalog.GetString ("Country"), 20));
            country_section.Add (country_pref = new SchemaPreference<string> (StoreCountry,
                null,
                Catalog.GetString ("Which Amazon MP3 storefront to use by default.")));

            /*var session_section = source_page.Add (new Section ("session", Catalog.GetString ("Session"), 30));
            session_section.Add (new SchemaPreference<bool> (PersistLogin,
                Catalog.GetString ("_Keep me logged in"),
                Catalog.GetString ("Keep any session cookies that Amazon MP3 may set across instances.")));
            session_section.Add (logout_pref = new VoidPreference ("log-out-button"));*/

            Hyena.Log.InformationFormat ("AmazonMP3 store redirect URL: {0}", RedirectUrl.Get ());
        }
        public LastfmPreferences (LastfmSource source)
        {
            var service = ServiceManager.Get<PreferenceService> ();
            if (service == null) {
                return;
            }

            this.source = source;

            service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters;
            source_page = new Banshee.Preferences.SourcePage (source) {
                (account_section = new Section ("lastfm-account", Catalog.GetString ("Account"), 20) {
                    (username_preference = new SchemaPreference<string> (LastfmSource.LastUserSchema,
                        Catalog.GetString ("_Username")) {
                        ShowLabel = false
                    }),
                    new VoidPreference ("lastfm-signup")
                }),
                (prefs_section = new Section ("lastfm-settings", Catalog.GetString ("Preferences"), 30))
            };

            scrobbler = ServiceManager.Get<Banshee.Lastfm.Audioscrobbler.AudioscrobblerService> ();
            if (scrobbler != null) {
                reporting_preference = new Preference<bool> ("enable-song-reporting",
                    Catalog.GetString ("_Enable Song Reporting"), null, scrobbler.Enabled);
                reporting_preference.ValueChanged += root => scrobbler.Enabled = reporting_preference.Value;
                prefs_section.Add (reporting_preference);
            }
        }
Exemple #3
0
        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) {
                if (solver.PreferencesSection != null) {
                    sections.Add (solver.PreferencesSection);
                }
                combo.Add (solver.Name, solver);
            }

            if (sections.Count > 0) {
                page = new SourcePage (this);
                foreach (var section in sections) {
                    page.Add (section);
                }
            }

            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 CueSheetsPrefs(CueSheetsSource source)
        {
            var service = ServiceManager.Get<PreferenceService>();

            if (service==null) {
                return;
            }

            _source=source;
            source_page = new SourcePage(source);
        }
        public void Dispose ()
        {
            var service = ServiceManager.Get<PreferenceService> ();
            if (service == null || source_page == null) {
                return;
            }

            service.InstallWidgetAdapters -= OnPreferencesServiceInstallWidgetAdapters;
            source_page.Dispose ();
            source_page = null;
        }
 public AmpachePreferences(AmpacheSource source)
 {
     var service = ServiceManager.Get<PreferenceService> ();
     if (service == null) {
         return;
     }
     source_page = new SourcePage(source);
     account_section = new Section("ampache-account", "Account", 20);
     //account_section.Add(AmpacheSource.AmpacheRootAddress);
     //account_section.Add(AmpacheSource.UserName);
     //account_section.Add(AmpacheSource.UserPassword);
     source_page.Add(account_section);
     //account_section["ampache-account"].DisplayWidget = new PreferenceView();
     var view = new PreferenceView();
     source_page.DisplayWidget = view;// = new PreferenceView();
 }
 private void UninstallPreferences ()
 {
     pref_page.Dispose ();
     pref_page = null;
     pref_section = null;
 }
        private void InstallPreferences ()
        {
            pref_page = new Banshee.Preferences.SourcePage (PreferencesPageId, Name, "source-playlist", 500);

            pref_section = pref_page.Add (new Section ());
            pref_section.ShowLabel = false;
            pref_section.Add (new SchemaPreference<int> (PlayedSongsNumberSchema,
                Catalog.GetString ("Number of _played songs to show"), null, delegate {
                    played_songs_number = PlayedSongsNumberSchema.Get ();
                    UpdatePlayQueue ();
                }
            ));
            pref_section.Add (new SchemaPreference<int> (UpcomingSongsNumberSchema,
                Catalog.GetString ("Number of _upcoming songs to show"), null, delegate {
                    upcoming_songs_number = UpcomingSongsNumberSchema.Get ();
                    UpdatePlayQueue ();
                }
            ));
        }
Exemple #9
0
        private void UninstallPreferences()
        {
            PreferenceService service = ServiceManager.Get<PreferenceService> ();
            if (service == null || pref_page == null) {
                return;
            }

            pref_page.Dispose ();
            pref_page = null;
            pref_section = null;
        }
Exemple #10
0
        private void InstallPreferences()
        {
            PreferenceService service = ServiceManager.Get<PreferenceService> ();
            if (service == null) {
                return;
            }

            pref_page = new Banshee.Preferences.SourcePage (this);

            pref_section = pref_page.Add (new Section ("mediatypes", Catalog.GetString ("Preferred Media Types"), 20));

            pref_section.Add (new SchemaPreference<string> (AudioTypes,
                Catalog.GetString ("_Audio"), ""));

            pref_section.Add (new SchemaPreference<string> (VideoTypes,
                Catalog.GetString ("_Video"), ""));

            pref_section.Add (new SchemaPreference<string> (TextTypes,
                Catalog.GetString ("_Text"), ""));
        }
        private void UninstallPreferences ()
        {
            PreferenceService service = ServiceManager.Get<PreferenceService> ();
            if (service == null || pref_page == null) {
                return;
            }

            service.InstallWidgetAdapters -= OnPreferencesServiceInstallWidgetAdapters;

            pref_page.Dispose ();
            pref_page = null;
            pref_section = null;
        }
        private void InstallPreferences ()
        {
            PreferenceService service = ServiceManager.Get<PreferenceService> ();
            if (service == null) {
                return;
            }

            service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters;

            pref_page = new Banshee.Preferences.SourcePage ("audio-cd", Catalog.GetString ("Audio CDs"), "media-cdrom", 400);

            pref_section = pref_page.Add (new Section ("audio-cd", Catalog.GetString ("Audio CD Importing"), 20));
            pref_section.ShowLabel = false;

            pref_section.Add (new VoidPreference ("import-profile",  Catalog.GetString ("_Import format")));
            pref_section.Add (new VoidPreference ("import-profile-desc"));

            pref_section.Add (new SchemaPreference<bool> (AutoRip,
                Catalog.GetString ("_Automatically import audio CDs when inserted"),
                Catalog.GetString ("When an audio CD is inserted, automatically begin importing it " +
                    "if metadata can be found and it is not already in the library.")));

            pref_section.Add (new SchemaPreference<bool> (EjectAfterRipped,
                Catalog.GetString ("_Eject when done importing"),
                Catalog.GetString ("When an audio CD has been imported, automatically eject it.")));

            pref_section.Add (new SchemaPreference<bool> (ErrorCorrection,
                Catalog.GetString ("Use error correction when importing"),
                Catalog.GetString ("Error correction tries to work around problem areas on a disc, such " +
                    "as surface scratches, but will slow down importing substantially.")));
        }