private bool CheckDiffToolConfiguration()
{
DiffTool2.Visible = true;
GitCommands.GitCommands gitCommands = new GitCommands.GitCommands();
if (string.IsNullOrEmpty(FormSettings.GetGlobalDiffToolFromConfig()))
{
DiffTool2.BackColor = Color.LightSalmon;
DiffTool2.Text = "You should configure a diff tool to show file diff in external program (kdiff3 for example).";
return false;
}
if (Settings.RunningOnWindows())
{
if (FormSettings.GetGlobalDiffToolFromConfig().Equals("kdiff3", StringComparison.CurrentCultureIgnoreCase))
{
string p = gitCommands.GetGlobalSetting("difftool.kdiff3.path");
if (string.IsNullOrEmpty(p) || !File.Exists(p))
{
DiffTool2.BackColor = Color.LightSalmon;
DiffTool2.Text = "KDiff3 is configured as difftool, but the path to kdiff.exe is not configured.";
return false;
}
DiffTool2.BackColor = Color.LightGreen;
DiffTool2.Text = "KDiff3 is configured as difftool.";
return true;
}
}
string difftool = FormSettings.GetGlobalDiffToolFromConfig();
DiffTool2.BackColor = Color.LightGreen;
DiffTool2.Text = "There is a difftool configured: " + difftool;
return true;
}