public static IBansheeFileChooser CreateForImport(string title, bool files)
 {
     var chooser = AddinManager.GetExtensionObjects <IBansheeFileChooser> ("/Banshee/Gui/NativeFileChooserDialog").FirstOrDefault ();
     if (chooser == null) {
         var gtkchooser = new GtkFileChooserDialog ();
         return gtkchooser.CreateForImport (title, files);
     }
     return chooser.CreateForImport (title, files);
 }
        public static IBansheeFileChooser CreateForImport(string title, bool files)
        {
            var chooser = AddinManager.GetExtensionObjects <IBansheeFileChooser> ("/Banshee/Gui/NativeFileChooserDialog").FirstOrDefault();

            if (chooser == null)
            {
                var gtkchooser = new GtkFileChooserDialog();
                return(gtkchooser.CreateForImport(title, files));
            }
            return(chooser.CreateForImport(title, files));
        }
Exemple #3
0
        private void OnBrowseClicked(object o, EventArgs args)
        {
            var chooser = new GtkFileChooserDialog(
                Catalog.GetString("Open Location"),
                null,
                FileChooserAction.Open
                );

            chooser.SetCurrentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Personal));
            chooser.AddButton(Stock.Cancel, ResponseType.Cancel);
            chooser.AddButton(Stock.Open, ResponseType.Ok);
            chooser.DefaultResponse = ResponseType.Ok;
            chooser.LocalOnly       = false;

            if (chooser.Run() == (int)ResponseType.Ok)
            {
                address_entry.Entry.Text = chooser.Uri;
            }

            chooser.Destroy();
        }
        private void OnBrowseClicked(object o, EventArgs args)
        {
            var chooser = new GtkFileChooserDialog(
                Catalog.GetString("Open Location"),
                null,
                FileChooserAction.Open
            );

            chooser.SetCurrentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Personal));
            chooser.AddButton(Stock.Cancel, ResponseType.Cancel);
            chooser.AddButton(Stock.Open, ResponseType.Ok);
            chooser.DefaultResponse = ResponseType.Ok;
            chooser.LocalOnly = false;

            if(chooser.Run() == (int)ResponseType.Ok) {
                address_entry.Entry.Text = chooser.Uri;
            }

            chooser.Destroy();
        }