public FormSettings(GitUICommands aCommands, SettingsPageReference initalPage = null) : base(aCommands) { InitializeComponent(); Translate(); settingsTreeView.SuspendLayout(); //if form is created for translation purpose if (aCommands == null) { return; } settingsTreeView.AddSettingsPage(new GitExtensionsSettingsGroup(), null); SettingsPageReference gitExtPageRef = GitExtensionsSettingsGroup.GetPageReference(); _commonLogic = new CommonLogic(Module); _checkSettingsLogic = new CheckSettingsLogic(_commonLogic, Module); var checklistSettingsPage = new ChecklistSettingsPage(_commonLogic, _checkSettingsLogic, Module, this); settingsTreeView.AddSettingsPage(checklistSettingsPage, gitExtPageRef, true); // as root settingsTreeView.AddSettingsPage(new GitSettingsPage(_checkSettingsLogic, this), gitExtPageRef); settingsTreeView.AddSettingsPage(new GitExtensionsSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new AppearanceSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new ColorsSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new StartPageSettingsPage(), gitExtPageRef); var globalSettingsSettingsPage = new GlobalSettingsSettingsPage(_commonLogic, _checkSettingsLogic, Module); settingsTreeView.AddSettingsPage(globalSettingsSettingsPage, gitExtPageRef); var localSettingsSettingsPage = new LocalSettingsSettingsPage(_commonLogic, _checkSettingsLogic, Module); settingsTreeView.AddSettingsPage(localSettingsSettingsPage, gitExtPageRef); var _sshSettingsPage = new SshSettingsPage(_commonLogic); settingsTreeView.AddSettingsPage(_sshSettingsPage, gitExtPageRef); checklistSettingsPage.SshSettingsPage = _sshSettingsPage; settingsTreeView.AddSettingsPage(new ScriptsSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new HotkeysSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new ShellExtensionSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new AdvancedSettingsPage(), gitExtPageRef); SettingsPageReference advancedPageRef = AdvancedSettingsPage.GetPageReference(); settingsTreeView.AddSettingsPage(new ConfirmationsSettingsPage(), advancedPageRef); settingsTreeView.AddSettingsPage(new PluginsSettingsGroup(), null); SettingsPageReference pluginsPageRef = PluginsSettingsGroup.GetPageReference(); settingsTreeView.AddSettingsPage(new PluginRootIntroductionPage(), pluginsPageRef, true); // as root foreach (var gitPlugin in LoadedPlugins.Plugins) { var settingsPage = PluginSettingsPage.CreateSettingsPageFromPlugin(gitPlugin); settingsTreeView.AddSettingsPage(settingsPage, pluginsPageRef); } settingsTreeView.GotoPage(initalPage); settingsTreeView.ResumeLayout(); }
public FormSettings(GitUICommands aCommands, SettingsPageReference initalPage = null) : base(aCommands) { InitializeComponent(); Translate(); _translatedTitle = this.Text; settingsTreeView.SuspendLayout(); //if form is created for translation purpose if (aCommands == null) { return; } #if DEBUG buttonDiscard.Visible = true; #endif settingsTreeView.AddSettingsPage(new GitExtensionsSettingsGroup(), null); SettingsPageReference gitExtPageRef = GitExtensionsSettingsGroup.GetPageReference(); _commonLogic = new CommonLogic(Module); _checkSettingsLogic = new CheckSettingsLogic(_commonLogic); var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(this); settingsTreeView.AddSettingsPage(checklistSettingsPage, gitExtPageRef, true); // as root settingsTreeView.AddSettingsPage(SettingsPageBase.Create <GitSettingsPage>(this), gitExtPageRef); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <GitExtensionsSettingsPage>(this), gitExtPageRef); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <CommitDialogSettingsPage>(this), gitExtPageRef); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <AppearanceSettingsPage>(this), gitExtPageRef); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <RevisionLinksSettingsPage>(this), gitExtPageRef); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ColorsSettingsPage>(this), gitExtPageRef); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <StartPageSettingsPage>(this), gitExtPageRef); var globalSettingsSettingsPage = SettingsPageBase.Create <GitConfigSettingsPage>(this); settingsTreeView.AddSettingsPage(globalSettingsSettingsPage, gitExtPageRef); var buildServerIntegrationSettingsPage = SettingsPageBase.Create <BuildServerIntegrationSettingsPage>(this); settingsTreeView.AddSettingsPage(buildServerIntegrationSettingsPage, gitExtPageRef); var _sshSettingsPage = SettingsPageBase.Create <SshSettingsPage>(this); settingsTreeView.AddSettingsPage(_sshSettingsPage, gitExtPageRef); checklistSettingsPage.SshSettingsPage = _sshSettingsPage; settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ScriptsSettingsPage>(this), gitExtPageRef); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <HotkeysSettingsPage>(this), gitExtPageRef); if (EnvUtils.RunningOnWindows()) { settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ShellExtensionSettingsPage>(this), gitExtPageRef); } settingsTreeView.AddSettingsPage(SettingsPageBase.Create <AdvancedSettingsPage>(this), gitExtPageRef); SettingsPageReference advancedPageRef = AdvancedSettingsPage.GetPageReference(); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <DetailedSettingsPage>(this), gitExtPageRef); var detailedSettingsPage = DetailedSettingsPage.GetPageReference(); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ConfirmationsSettingsPage>(this), advancedPageRef); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <DiffViewerSettingsPage>(this), detailedSettingsPage); settingsTreeView.AddSettingsPage(new PluginsSettingsGroup(), null); SettingsPageReference pluginsPageRef = PluginsSettingsGroup.GetPageReference(); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <PluginRootIntroductionPage>(this), pluginsPageRef, true); // as root foreach (var gitPlugin in LoadedPlugins.Plugins) { var settingsPage = PluginSettingsPage.CreateSettingsPageFromPlugin(this, gitPlugin); settingsTreeView.AddSettingsPage(settingsPage, pluginsPageRef); } settingsTreeView.GotoPage(initalPage); settingsTreeView.ResumeLayout(); }
protected override void OnRuntimeLoad(EventArgs e) { base.OnRuntimeLoad(e); settingsTreeView.SuspendLayout(); ChecklistSettingsPage checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(this); // Git Extensions settings settingsTreeView.AddSettingsPage(new GitExtensionsSettingsGroup(), null, Images.GitExtensionsLogo16); var gitExtPageRef = GitExtensionsSettingsGroup.GetPageReference(); settingsTreeView.AddSettingsPage(checklistSettingsPage, gitExtPageRef, icon: null, asRoot: true); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <GeneralSettingsPage>(this), gitExtPageRef, Images.GeneralSettings); // >> Appearance settingsTreeView.AddSettingsPage(SettingsPageBase.Create <AppearanceSettingsPage>(this), gitExtPageRef, Images.Appearance); var appearanceSettingsPage = AppearanceSettingsPage.GetPageReference(); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ColorsSettingsPage>(this), appearanceSettingsPage, Images.Colors); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <AppearanceFontsSettingsPage>(this), appearanceSettingsPage, Images.Font.AdaptLightness()); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ConsoleStyleSettingsPage>(this), appearanceSettingsPage, Images.Console); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <RevisionLinksSettingsPage>(this), gitExtPageRef, Images.Link.AdaptLightness()); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <BuildServerIntegrationSettingsPage>(this), gitExtPageRef, Images.Integration); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ScriptsSettingsPage>(this), gitExtPageRef, Images.Console); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <HotkeysSettingsPage>(this), gitExtPageRef, Images.Hotkey); if (EnvUtils.RunningOnWindows()) { settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ShellExtensionSettingsPage>(this), gitExtPageRef, Images.ShellExtensions); } // >> Advanced settingsTreeView.AddSettingsPage(SettingsPageBase.Create <AdvancedSettingsPage>(this), gitExtPageRef, Images.AdvancedSettings); SettingsPageReference advancedPageRef = AdvancedSettingsPage.GetPageReference(); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <ConfirmationsSettingsPage>(this), advancedPageRef, Images.BisectGood); // >> Detailed settingsTreeView.AddSettingsPage(SettingsPageBase.Create <DetailedSettingsPage>(this), gitExtPageRef, Images.Settings); var detailedSettingsPage = DetailedSettingsPage.GetPageReference(); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <FormBrowseRepoSettingsPage>(this), detailedSettingsPage, Images.BranchFolder); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <CommitDialogSettingsPage>(this), detailedSettingsPage, Images.CommitSummary); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <DiffViewerSettingsPage>(this), detailedSettingsPage, Images.Diff); var sshSettingsPage = SettingsPageBase.Create <SshSettingsPage>(this); settingsTreeView.AddSettingsPage(sshSettingsPage, gitExtPageRef, Images.Key); checklistSettingsPage.SshSettingsPage = sshSettingsPage; // Git settings settingsTreeView.AddSettingsPage(new GitSettingsGroup(), null, Images.GitLogo16); var gitPageRef = GitSettingsGroup.GetPageReference(); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <GitSettingsPage>(this), gitPageRef, Images.FolderOpen); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <GitConfigSettingsPage>(this), gitPageRef, Images.GeneralSettings); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <GitConfigAdvancedSettingsPage>(this), gitPageRef, Images.AdvancedSettings); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <GitRootIntroductionPage>(this), gitPageRef, icon: null, asRoot: true); // Plugins settings settingsTreeView.AddSettingsPage(new PluginsSettingsGroup(), null, Images.Plugin); SettingsPageReference pluginsPageRef = PluginsSettingsGroup.GetPageReference(); settingsTreeView.AddSettingsPage(SettingsPageBase.Create <PluginRootIntroductionPage>(this), pluginsPageRef, icon: null, asRoot: true); lock (PluginRegistry.Plugins) { var pluginEntries = PluginRegistry.Plugins .Where(p => p.HasSettings) .Select(plugin => (Plugin: plugin, Page: PluginSettingsPage.CreateSettingsPageFromPlugin(this, plugin))) .OrderBy(entry => entry.Page.GetTitle(), StringComparer.CurrentCultureIgnoreCase); foreach (var entry in pluginEntries) { settingsTreeView.AddSettingsPage(entry.Page, pluginsPageRef, entry.Plugin.Icon as Bitmap); } } settingsTreeView.ResumeLayout(); }