feature<FolderDialog>: remove View.FolderBrowser and use windows shell32 API to select folders

This commit is contained in:
leo 2021-05-26 11:08:31 +08:00
parent 0419cf96fc
commit 6061f5a074
8 changed files with 169 additions and 213 deletions

View file

@ -342,9 +342,10 @@ namespace SourceGit.Views.Widgets {
var saveToPatch = new MenuItem();
saveToPatch.Header = App.Text("CommitCM.SaveAsPatch");
saveToPatch.Click += (o, e) => {
FolderBrowser.Open(null, "Save patch to ...", saveTo => {
new Commands.FormatPatch(repo.Path, commit.SHA, saveTo).Exec();
});
var dialog = new Controls.FolderDialog("SaveFileTo");
if (dialog.ShowDialog() == true) {
new Commands.FormatPatch(repo.Path, commit.SHA, dialog.SelectedPath).Exec();
}
};
menu.Items.Add(saveToPatch);
menu.Items.Add(new Separator());