Banshee.Gui.Dialogs.FileChooserDialog.CreateForImport C# (CSharp) Method

CreateForImport() public static method

public static CreateForImport ( string title, bool files ) : FileChooserDialog
title string
files bool
return FileChooserDialog
        public static FileChooserDialog CreateForImport (string title, bool files)
        {
            var chooser = new Banshee.Gui.Dialogs.FileChooserDialog (
                title,
                ServiceManager.Get<Banshee.Gui.GtkElementsService> ().PrimaryWindow,
                files ? FileChooserAction.Open : FileChooserAction.SelectFolder
            );

            chooser.DefaultResponse = ResponseType.Ok;
            chooser.SelectMultiple = true;

            chooser.AddButton (Stock.Cancel, ResponseType.Cancel);
            // Translators: verb
            chooser.AddButton (Mono.Unix.Catalog.GetString("I_mport"), ResponseType.Ok);

            // FIXME: this dialog should be library-specific, and so these shortcuts should be
            // library-specific too
            Hyena.Gui.GtkUtilities.SetChooserShortcuts (chooser,
                ServiceManager.SourceManager.MusicLibrary.BaseDirectory,
                ServiceManager.SourceManager.VideoLibrary.BaseDirectory,
                GetPhotosFolder ()
            );

            return chooser;
        }