예제 #1
0
        private void OnBrowseClicked(object o, EventArgs args)
        {
            FileChooserDialog chooser = new FileChooserDialog(
                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();
        }
예제 #2
0
 public void OpenDialog(bool multipleFiles, params FileTypes[] fileTypes)
 {
     fcd = new FileChooserDialog("Choose Files", null, FileChooserAction.Open, ButtonsType.Ok);
     fcd.AddButton("Open", ResponseType.Ok);
     fcd.AddFilter(Utils.FileTypesToGtkFilter(fileTypes));
     fcd.SelectMultiple = true;
     fcd.Run();
 }
예제 #3
0
 public void OpenDialog(params FileTypes[] fileTypes)
 {
     fcd = new FileChooserDialog("Choose Path", null, FileChooserAction.Save, ButtonsType.Ok);
     fcd.AddButton("Save", ResponseType.Ok);
     FileFilter filter = new FileFilter();
     fcd.AddFilter(Utils.FileTypesToGtkFilter(fileTypes));
     fcd.Run();
 }