private void DiffToolCmdSuggest_Click(object sender, EventArgs e)
        {
            if (!EnvUtils.RunningOnWindows())
            {
                return;
            }

            var diffToolPath = DifftoolPath.Text.Trim().Trim('"', '\'');

            CurrentSettings.SetPathValue(string.Format("difftool.{0}.path", _NO_TRANSLATE_GlobalDiffTool.Text.Trim()), diffToolPath ?? "");
            string exeName;
            string exeFile;

            if (!string.IsNullOrEmpty(diffToolPath))
            {
                exeFile = diffToolPath;
                exeName = Path.GetFileName(exeFile);
            }
            else
            {
                exeFile = MergeToolsHelper.FindDiffToolFullPath(ConfigFileSettingsSet, _NO_TRANSLATE_GlobalDiffTool.Text, out exeName);
            }

            if (string.IsNullOrEmpty(exeFile))
            {
                DifftoolPath.SelectAll();
                DifftoolPath.SelectedText = "";
                DifftoolCmd.SelectAll();
                DifftoolCmd.SelectedText = "";
                if (sender != null)
                {
                    MessageBox.Show(this, string.Format(_toolSuggestPathText.Text, exeName),
                                    _diffToolSuggestCaption.Text);
                }

                return;
            }

            DifftoolPath.SelectAll(); // allow Undo action
            DifftoolPath.SelectedText = exeFile;
            DifftoolCmd.SelectAll();
            DifftoolCmd.SelectedText = MergeToolsHelper.DiffToolCmdSuggest(_NO_TRANSLATE_GlobalDiffTool.Text, exeFile);
        }
Пример #2
0
        private void DiffToolCmdSuggest_Click(object sender, EventArgs e)
        {
            if (!EnvUtils.RunningOnWindows())
            {
                return;
            }

            CurrentSettings.SetPathValue(string.Format("difftool.{0}.path", GlobalMergeTool.Text.Trim()), MergetoolPath.Text.Trim());
            string exeName;
            string exeFile;

            if (!String.IsNullOrEmpty(DifftoolPath.Text))
            {
                exeFile = DifftoolPath.Text;
                exeName = Path.GetFileName(exeFile);
            }
            else
            {
                exeFile = MergeToolsHelper.FindDiffToolFullPath(ConfigFileSettingsSet, GlobalDiffTool.Text, out exeName);
            }
            if (String.IsNullOrEmpty(exeFile))
            {
                DifftoolPath.SelectAll();
                DifftoolPath.SelectedText = "";
                DifftoolCmd.SelectAll();
                DifftoolCmd.SelectedText = "";
                if (sender != null)
                {
                    MessageBox.Show(this, String.Format(CheckSettingsLogic.ToolSuggestPathText.Text, exeName),
                                    __diffToolSuggestCaption.Text);
                }
                return;
            }
            DifftoolPath.SelectAll(); // allow Undo action
            DifftoolPath.SelectedText = exeFile;
            DifftoolCmd.SelectAll();
            DifftoolCmd.SelectedText = MergeToolsHelper.DiffToolCmdSuggest(GlobalDiffTool.Text, exeFile);
        }