public static bool ShowSettingsDialog() { using SettingsForm f = new SettingsForm { KeyboardShortcuts = Settings.Default.KeyboardShortcuts, StartupRepos = Settings.Default.StartupRepos.ToArray(), OpenStartupReposOnReOpen = Settings.Default.OpenStartupReposOnReOpen, TabContextMenuGitActions = Settings.Default.TabContextMenuGitActions, ConfirmFasterFetch = Settings.Default.ConfirmFasterFetch, CustomActions = Settings.Default.CustomActions, NormalTabFont = Settings.Default.NormalTabFont, NormalTabFontColor = Settings.Default.NormalTabFontColor, IndicateModifiedTabs = Settings.Default.IndicateModifiedTabs, CheckForModifiedTabsInterval = Settings.Default.CheckForModifiedTabsInterval, ModifiedTabFont = Settings.Default.ModifiedTabFont, ModifiedTabFontColor = Settings.Default.ModifiedTabFontColor, HideReferencesDisplay = Settings.Default.HideReferencesDisplay, TortoiseGitProcExeLocation = Settings.Default.TortoiseGitProcExeLocation, MaxRecentRepos = Settings.Default.MaxRecentRepos, ConfirmOnClose = Settings.Default.ConfirmOnClose, CloseWindowOnLastTabClosed = Settings.Default.CloseWindowOnLastTabClosed, CloseToSystemTray = Settings.Default.CloseToSystemTray, RunOnStartup = TTG.RunOnStartup, CheckTortoiseGitOnPath = Settings.Default.CheckTortoiseGitOnPath, ShowChangelogOnUpdate = Settings.Default.ShowChangelogOnUpdate, DeveloperSettingsEnabled = Settings.Default.DeveloperSettingsEnabled, ShowHitTest = Settings.Default.ShowHitTest }; if (f.ShowDialog() == DialogResult.OK) { Settings.Default.KeyboardShortcuts = f.KeyboardShortcuts; Settings.Default.StartupRepos = f.StartupRepos.ToList(); Settings.Default.OpenStartupReposOnReOpen = f.OpenStartupReposOnReOpen; Settings.Default.TabContextMenuGitActions = f.TabContextMenuGitActions; Settings.Default.ConfirmFasterFetch = f.ConfirmFasterFetch; Settings.Default.CustomActions = f.CustomActions; Settings.Default.NormalTabFont = f.NormalTabFont; Settings.Default.NormalTabFontColor = f.NormalTabFontColor; Settings.Default.CheckForModifiedTabsInterval = f.CheckForModifiedTabsInterval; Settings.Default.IndicateModifiedTabs = f.IndicateModifiedTabs; Settings.Default.ModifiedTabFont = f.ModifiedTabFont; Settings.Default.ModifiedTabFontColor = f.ModifiedTabFontColor; Settings.Default.HideReferencesDisplay = f.HideReferencesDisplay; Settings.Default.TortoiseGitProcExeLocation = f.TortoiseGitProcExeLocation; Settings.Default.MaxRecentRepos = f.MaxRecentRepos; Settings.Default.RecentRepos = Settings.Default.RecentRepos.Take(Settings.Default.MaxRecentRepos).ToList(); Settings.Default.ConfirmOnClose = f.ConfirmOnClose; Settings.Default.CloseWindowOnLastTabClosed = f.CloseWindowOnLastTabClosed; Settings.Default.CloseToSystemTray = f.CloseToSystemTray; TTG.RunOnStartup = f.RunOnStartup; Settings.Default.CheckTortoiseGitOnPath = f.CheckTortoiseGitOnPath; Settings.Default.ShowChangelogOnUpdate = f.ShowChangelogOnUpdate; Settings.Default.DeveloperSettingsEnabled = f.DeveloperSettingsEnabled; Settings.Default.ShowHitTest = f.ShowHitTest; Settings.Default.Save(); return(true); } else { return(false); } }
private void SettingsMenuItem_Click(object?sender, EventArgs e) { SettingsForm.ShowSettingsDialog(); }