protected override void SettingsToPage() { CommonLogic.EncodingToCombo(CurrentSettings.FilesEncoding, Global_FilesEncoding); GlobalUserName.Text = CurrentSettings.GetValue(SettingKeyString.UserName); GlobalUserEmail.Text = CurrentSettings.GetValue(SettingKeyString.UserEmail); GlobalEditor.Text = CurrentSettings.GetValue("core.editor"); _NO_TRANSLATE_GlobalMergeTool.Text = CurrentSettings.GetValue("merge.tool"); CommitTemplatePath.Text = CurrentSettings.GetValue("commit.template"); MergetoolPath.Text = CurrentSettings.GetValue(string.Format("mergetool.{0}.path", _NO_TRANSLATE_GlobalMergeTool.Text)); MergeToolCmd.Text = CurrentSettings.GetValue(string.Format("mergetool.{0}.cmd", _NO_TRANSLATE_GlobalMergeTool.Text)); _NO_TRANSLATE_GlobalDiffTool.Text = CheckSettingsLogic.GetDiffToolFromConfig(CurrentSettings); DifftoolPath.Text = CurrentSettings.GetValue(string.Format("difftool.{0}.path", _NO_TRANSLATE_GlobalDiffTool.Text)); DifftoolCmd.Text = CurrentSettings.GetValue(string.Format("difftool.{0}.cmd", _NO_TRANSLATE_GlobalDiffTool.Text)); GlobalKeepMergeBackup.SetNullableChecked(CurrentSettings.mergetool.keepBackup.Value); globalAutoCrlfFalse.Checked = CurrentSettings.core.autocrlf.Value == AutoCRLFType.@false; globalAutoCrlfInput.Checked = CurrentSettings.core.autocrlf.Value == AutoCRLFType.input; globalAutoCrlfTrue.Checked = CurrentSettings.core.autocrlf.Value == AutoCRLFType.@true; globalAutoCrlfNotSet.Checked = !CurrentSettings.core.autocrlf.Value.HasValue; }
/// <summary> /// silently does not save some settings if Git is not configured correctly /// (user notification is done elsewhere) /// </summary> protected override void PageToSettings() { CurrentSettings.FilesEncoding = CommonLogic.ComboToEncoding(Global_FilesEncoding); if (!CheckSettingsLogic.CanFindGitCmd()) { return; } CurrentSettings.SetValue(SettingKeyString.UserName, GlobalUserName.Text); CurrentSettings.SetValue(SettingKeyString.UserEmail, GlobalUserEmail.Text); CurrentSettings.SetValue("commit.template", CommitTemplatePath.Text); CurrentSettings.SetPathValue("core.editor", GlobalEditor.Text); var diffTool = _NO_TRANSLATE_GlobalDiffTool.Text; CheckSettingsLogic.SetDiffToolToConfig(CurrentSettings, diffTool); CurrentSettings.SetPathValue($"difftool.{diffTool}.path", DifftoolPath.Text); CurrentSettings.SetPathValue($"difftool.{diffTool}.cmd", DifftoolCmd.Text); var mergeTool = _NO_TRANSLATE_GlobalMergeTool.Text; CurrentSettings.SetValue("merge.tool", mergeTool); CurrentSettings.SetPathValue($"mergetool.{mergeTool}.path", MergetoolPath.Text); CurrentSettings.SetPathValue($"mergetool.{mergeTool}.cmd", MergeToolCmd.Text); CurrentSettings.mergetool.keepBackup.Value = GlobalKeepMergeBackup.GetNullableChecked(); if (globalAutoCrlfFalse.Checked) { CurrentSettings.core.autocrlf.Value = AutoCRLFType.@false; } if (globalAutoCrlfInput.Checked) { CurrentSettings.core.autocrlf.Value = AutoCRLFType.input; } if (globalAutoCrlfTrue.Checked) { CurrentSettings.core.autocrlf.Value = AutoCRLFType.@true; } if (globalAutoCrlfNotSet.Checked) { CurrentSettings.core.autocrlf.Value = null; } }
/// <summary> /// silently does not save some settings if Git is not configured correctly /// (user notification is done elsewhere) /// </summary> protected override void PageToSettings() { CurrentSettings.FilesEncoding = CommonLogic.ComboToEncoding(Global_FilesEncoding); if (CheckSettingsLogic.CanFindGitCmd()) { CurrentSettings.SetValue("user.name", GlobalUserName.Text); CurrentSettings.SetValue("user.email", GlobalUserEmail.Text); CurrentSettings.SetValue("commit.template", CommitTemplatePath.Text); CurrentSettings.SetPathValue("core.editor", GlobalEditor.Text); CheckSettingsLogic.SetDiffToolToConfig(CurrentSettings, GlobalDiffTool.Text); CurrentSettings.SetPathValue(string.Format("difftool.{0}.path", GlobalDiffTool.Text), DifftoolPath.Text); CurrentSettings.SetPathValue(string.Format("difftool.{0}.cmd", GlobalDiffTool.Text), DifftoolCmd.Text); CurrentSettings.SetValue("merge.tool", GlobalMergeTool.Text); CurrentSettings.SetPathValue(string.Format("mergetool.{0}.path", GlobalMergeTool.Text), MergetoolPath.Text); CurrentSettings.SetPathValue(string.Format("mergetool.{0}.cmd", GlobalMergeTool.Text), MergeToolCmd.Text); CurrentSettings.mergetool.keepBackup.Value = GlobalKeepMergeBackup.GetNullableChecked(); if (globalAutoCrlfFalse.Checked) { CurrentSettings.core.autocrlf.Value = AutoCRLFType.False; } if (globalAutoCrlfInput.Checked) { CurrentSettings.core.autocrlf.Value = AutoCRLFType.Input; } if (globalAutoCrlfTrue.Checked) { CurrentSettings.core.autocrlf.Value = AutoCRLFType.True; } if (globalAutoCrlfNotSet.Checked) { CurrentSettings.core.autocrlf.Value = null; } } }