mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
enhance: select any terminal when none is set
This commit is contained in:
parent
736ad02991
commit
54ab625931
1 changed files with 21 additions and 0 deletions
|
@ -41,6 +41,22 @@ namespace SourceGit.ViewModels
|
||||||
if (!_instance.IsGitConfigured())
|
if (!_instance.IsGitConfigured())
|
||||||
_instance.GitInstallPath = Native.OS.FindGitExecutable();
|
_instance.GitInstallPath = Native.OS.FindGitExecutable();
|
||||||
|
|
||||||
|
if (!_instance.IsTerminalConfigured())
|
||||||
|
{
|
||||||
|
for (var i = 0; i < Models.ShellOrTerminal.Supported.Count; i++)
|
||||||
|
{
|
||||||
|
_instance.ShellOrTerminal = i;
|
||||||
|
if (string.IsNullOrEmpty(_instance.ShellOrTerminalPath))
|
||||||
|
{
|
||||||
|
_instance.ShellOrTerminal = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (_instance.Workspaces.Count == 0)
|
if (_instance.Workspaces.Count == 0)
|
||||||
_instance.Workspaces.Add(new Workspace() { Name = "Default", Color = 4278221015 });
|
_instance.Workspaces.Add(new Workspace() { Name = "Default", Color = 4278221015 });
|
||||||
|
|
||||||
|
@ -380,6 +396,11 @@ namespace SourceGit.ViewModels
|
||||||
return !string.IsNullOrEmpty(path) && File.Exists(path);
|
return !string.IsNullOrEmpty(path) && File.Exists(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsTerminalConfigured()
|
||||||
|
{
|
||||||
|
return ShellOrTerminal != -1;
|
||||||
|
}
|
||||||
|
|
||||||
public bool ShouldCheck4UpdateOnStartup()
|
public bool ShouldCheck4UpdateOnStartup()
|
||||||
{
|
{
|
||||||
if (!_check4UpdatesOnStartup)
|
if (!_check4UpdatesOnStartup)
|
||||||
|
|
Loading…
Reference in a new issue