public FormSettings(GitUICommands aCommands, SettingsPageReference initalPage = null) : base(aCommands) { InitializeComponent(); Translate(); _initalPage = initalPage; //if form is created for translation purpose if (aCommands == null) return; // NEW: _commonLogic = new CommonLogic(Module); _checkSettingsLogic = new CheckSettingsLogic(_commonLogic, Module); _checklistSettingsPage = new ChecklistSettingsPage(_commonLogic, _checkSettingsLogic, Module, this); _checkSettingsLogic.ChecklistSettingsPage = _checklistSettingsPage; // TODO _settingsPageRegistry.RegisterSettingsPage(_checklistSettingsPage); _gitSettingsPage = new GitSettingsPage(_checkSettingsLogic, this); _settingsPageRegistry.RegisterSettingsPage(_gitSettingsPage); _gitExtensionsSettingsPage = new GitExtensionsSettingsPage(); _settingsPageRegistry.RegisterSettingsPage(_gitExtensionsSettingsPage); _appearanceSettingsPage = new AppearanceSettingsPage(); _settingsPageRegistry.RegisterSettingsPage(_appearanceSettingsPage); _colorsSettingsPage = new ColorsSettingsPage(); _settingsPageRegistry.RegisterSettingsPage(_colorsSettingsPage); _startPageSettingsPage = new StartPageSettingsPage(); _settingsPageRegistry.RegisterSettingsPage(_startPageSettingsPage); _globalSettingsSettingsPage = new GlobalSettingsSettingsPage(_commonLogic, _checkSettingsLogic, Module); _settingsPageRegistry.RegisterSettingsPage(_globalSettingsSettingsPage); _localSettingsSettingsPage = new LocalSettingsSettingsPage(_commonLogic, _checkSettingsLogic, Module); _settingsPageRegistry.RegisterSettingsPage(_localSettingsSettingsPage); _sshSettingsPage = new SshSettingsPage(); _settingsPageRegistry.RegisterSettingsPage(_sshSettingsPage); _checklistSettingsPage.SshSettingsPage = _sshSettingsPage; _scriptsSettingsPage = new ScriptsSettingsPage(); _settingsPageRegistry.RegisterSettingsPage(_scriptsSettingsPage); _hotkeysSettingsPage = new HotkeysSettingsPage(); _settingsPageRegistry.RegisterSettingsPage(_hotkeysSettingsPage); _shellExtensionSettingsPage = new ShellExtensionSettingsPage(); _settingsPageRegistry.RegisterSettingsPage(_shellExtensionSettingsPage); // register all plugin pages _settingsPageRegistry.RegisterPluginSettingsPages(); settingsTreeViewUserControl1.SetSettingsPages(_settingsPageRegistry, _initalPage); }
private void GitBinFound_Click(object sender, EventArgs e) { if (!_checkSettingsLogic.SolveLinuxToolsDir()) { MessageBox.Show(this, _linuxToolsShNotFound.Text, _linuxToolsShNotFoundCaption.Text); _settingsPageHost.GotoPage(GitSettingsPage.GetPageReference()); return; } MessageBox.Show(this, String.Format(_shCanBeRun.Text, Settings.GitBinDir), _shCanBeRunCaption.Text); ////GitBinPath.Text = Settings.GitBinDir; _settingsPageHost.LoadAll(); // apply settings to dialog controls (otherwise the later called SaveAndRescan_Click would overwrite settings again) SaveAndRescan_Click(null, null); }
private void GitFound_Click(object sender, EventArgs e) { if (!_checkSettingsLogic.SolveGitCommand()) { MessageBox.Show(this, _solveGitCommandFailed.Text, _solveGitCommandFailedCaption.Text); _settingsPageHost.GotoPage(GitSettingsPage.GetPageReference()); return; } MessageBox.Show(this, String.Format(_gitCanBeRun.Text, Settings.GitCommand), _gitCanBeRunCaption.Text); _settingsPageHost.GotoPage(GitSettingsPage.GetPageReference()); SaveAndRescan_Click(null, null); }