mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
feature<Preference>: try finding git.exe
automatically
This commit is contained in:
parent
5e706588a0
commit
adce866716
1 changed files with 12 additions and 6 deletions
|
@ -49,12 +49,18 @@ namespace SourceGit.Views {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SelectGitPath(object sender, RoutedEventArgs e) {
|
private void SelectGitPath(object sender, RoutedEventArgs e) {
|
||||||
var dialog = new OpenFileDialog();
|
var sb = new StringBuilder("git.exe");
|
||||||
dialog.Filter = "Git Executable|git.exe";
|
string dir = PathFindOnPath(sb, null)
|
||||||
dialog.FileName = "git.exe";
|
? sb.ToString()
|
||||||
dialog.Title = App.Text("Preference.Dialog.GitExe");
|
: Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
|
||||||
dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
|
|
||||||
dialog.CheckFileExists = true;
|
var dialog = new OpenFileDialog {
|
||||||
|
Filter = "Git Executable|git.exe",
|
||||||
|
FileName = "git.exe",
|
||||||
|
Title = App.Text("Preference.Dialog.GitExe"),
|
||||||
|
InitialDirectory = dir,
|
||||||
|
CheckFileExists = true,
|
||||||
|
};
|
||||||
|
|
||||||
if (dialog.ShowDialog() == true) {
|
if (dialog.ShowDialog() == true) {
|
||||||
Models.Preference.Instance.Git.Path = dialog.FileName;
|
Models.Preference.Instance.Git.Path = dialog.FileName;
|
||||||
|
|
Loading…
Reference in a new issue