Exemple #1
0
        // 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());
        }
Exemple #2
0
        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.")));
        }
Exemple #3
0
        public void createGui()
        {
            basedir_section = new Section("cuesheets-basedir", "CueSheet Music Directory:", 20);
            source_page.Add(basedir_section);

            string dir = _source.getCueSheetDir();

            Gtk.Label             lbl = new Gtk.Label("CueSheet Music Directory:");
            Gtk.FileChooserButton btn = new Gtk.FileChooserButton("CueSheet Music Directory:", Gtk.FileChooserAction.SelectFolder);
            if (dir != null)
            {
                btn.SelectFilename(dir);
            }
            Gtk.HBox box = new Gtk.HBox();
            box.Add(lbl);
            box.Add(btn);
            box.ShowAll();
            btn.CurrentFolderChanged += delegate(object sender, EventArgs args) {
                string dir1 = btn.Filename;
                Hyena.Log.Information("Folder changed to = " + dir1);
            };
            btn.FileSet += delegate(object sender, EventArgs args) {
                string dir1 = btn.Filename;
                Hyena.Log.Information("Base directory changed to = " + dir1);
                _source.setCueSheetDir(dir1);
            };

            Console.WriteLine(_source);

            Gtk.VBox vb = new Gtk.VBox();
            vb.PackStart(box, false, false, 0);

            Gtk.Image  icn_about = new Gtk.Image(Gtk.Stock.About, Gtk.IconSize.Button);
            Gtk.Button about     = new Gtk.Button(icn_about);
            about.Clicked += new EventHandler(handleAbout);
            Gtk.HBox  hb     = new Gtk.HBox();
            Gtk.Label _about = new Gtk.Label("About the CueSheet extension");
            hb.PackEnd(about, false, false, 0);
            hb.PackEnd(_about, false, false, 5);
            vb.PackStart(hb, false, false, 0);
            Gtk.HBox   hb1      = new Gtk.HBox();
            Gtk.Label  _info    = new Gtk.Label("How to use the Cuesheet extension (opens browser)");
            Gtk.Image  icn_info = new Gtk.Image(Gtk.Stock.Info, Gtk.IconSize.Button);
            Gtk.Button btn_info = new Gtk.Button(icn_info);
            btn_info.Clicked += new EventHandler(handleInfo);
            hb1.PackEnd(btn_info, false, false, 0);
            hb1.PackEnd(_info, false, false, 5);
            vb.PackStart(hb1, false, false, 0);

            Gtk.HBox hbX = new Gtk.HBox();
            vb.PackEnd(hbX, true, true, 0);

            vb.ShowAll();

            source_page.DisplayWidget = vb;
        }
        private void InstallPreferences()
        {
            PreferenceService service = ServiceManager.Get <PreferenceService> ();

            if (service == null)
            {
                return;
            }

            service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters;
            pref_page              = new Banshee.Preferences.SourcePage(this);
            pref_section           = pref_page.Add(new Section("lastfm-account", Catalog.GetString("Account"), 20));
            pref_section.ShowLabel = false;

            user_pref = new SchemaPreference <string> (LastUserSchema, Catalog.GetString("_Username"));
            pref_section.Add(user_pref);
            pref_section.Add(new VoidPreference("lastfm-signup"));
        }
        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 #6
0
        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();
        }
Exemple #7
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"), Catalog.GetString("")));

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

            pref_section.Add(new SchemaPreference <string> (TextTypes,
                                                            Catalog.GetString("_Text"), Catalog.GetString("")));
        }
Exemple #8
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();
        }