From 489602ffb37cb0ed4efdfa949a582d92d7743f19 Mon Sep 17 00:00:00 2001 From: xRushG <145561288+xRushG@users.noreply.github.com> Date: Tue, 1 Oct 2024 12:32:16 +0200 Subject: [PATCH] feat: Add registry settings forTabs and Panel settings - Added registry settings for the Tabs and Panel Page. - All settings implemented with async registry logic - Comment unused settings - Update documents --- .../Registry/OptRegistryTabsPanelsPage.cs | 140 +++++++ .../OptionsPages/TabsPanelsPage.Designer.cs | 75 ++-- .../UI/Forms/OptionsPages/TabsPanelsPage.cs | 106 +++++- .../UI/Forms/OptionsPages/TabsPanelsPage.resx | 62 +++- .../registry/appearance_settings.rst | 95 +++++ .../registry/notification_settings.rst | 345 ++++++++++++++++++ .../registry/startupExit_settings.rst | 76 ++++ .../registry/tabsPanels_settings.rst | 136 +++++++ .../registry_settings_guide.rst | 5 +- 9 files changed, 1008 insertions(+), 32 deletions(-) create mode 100644 mRemoteNG/Config/Settings/Registry/OptRegistryTabsPanelsPage.cs create mode 100644 mRemoteNGDocumentation/registry/appearance_settings.rst create mode 100644 mRemoteNGDocumentation/registry/notification_settings.rst create mode 100644 mRemoteNGDocumentation/registry/startupExit_settings.rst create mode 100644 mRemoteNGDocumentation/registry/tabsPanels_settings.rst diff --git a/mRemoteNG/Config/Settings/Registry/OptRegistryTabsPanelsPage.cs b/mRemoteNG/Config/Settings/Registry/OptRegistryTabsPanelsPage.cs new file mode 100644 index 00000000..d42f4a5e --- /dev/null +++ b/mRemoteNG/Config/Settings/Registry/OptRegistryTabsPanelsPage.cs @@ -0,0 +1,140 @@ +using System.Runtime.Versioning; +using Microsoft.Win32; +using mRemoteNG.App.Info; +using mRemoteNG.Tools.WindowsRegistry; + +namespace mRemoteNG.Config.Settings.Registry +{ + [SupportedOSPlatform("windows")] + public sealed partial class OptRegistryTabsPanelsPage + { + /// + /// Specifies whether panel tabs are always shown. + /// + public WinRegistryEntry AlwaysShowPanelTabs { get; private set; } + + /// + /// Specifies whether logon information is shown on tabs. + /// + public WinRegistryEntry ShowLogonInfoOnTabs { get; private set; } + + /// + /// Specifies whether protocol information is shown on tabs. + /// + public WinRegistryEntry ShowProtocolOnTabs { get; private set; } + + /// + /// Specifies whether quick connect tabs are identified by the prefix "Quick:". + /// + public WinRegistryEntry IdentifyQuickConnectTabs { get; private set; } + + /// + /// Specifies whether double-clicking on a tab closes it. + /// + public WinRegistryEntry DoubleClickOnTabClosesIt { get; private set; } + + /// + /// Specifies whether the panel selection dialog is always shown. + /// + public WinRegistryEntry AlwaysShowPanelSelectionDlg { get; private set; } + + /// + /// Specifies whether an empty panel is created on startup. + /// + public WinRegistryEntry CreateEmptyPanelOnStartUp { get; private set; } + + /// + /// Specifies the name of the startup panel. + /// + public WinRegistryEntry StartUpPanelName { get; private set; } + + public OptRegistryTabsPanelsPage() + { + RegistryHive hive = WindowsRegistryInfo.Hive; + string subKey = WindowsRegistryInfo.TabsAndPanelsOptions; + + AlwaysShowPanelTabs = new WinRegistryEntry(hive, subKey, nameof(AlwaysShowPanelTabs)).Read(); + ShowLogonInfoOnTabs = new WinRegistryEntry(hive, subKey, nameof(ShowLogonInfoOnTabs)).Read(); + ShowProtocolOnTabs = new WinRegistryEntry(hive, subKey, nameof(ShowProtocolOnTabs)).Read(); + IdentifyQuickConnectTabs = new WinRegistryEntry(hive, subKey, nameof(IdentifyQuickConnectTabs)).Read(); + DoubleClickOnTabClosesIt = new WinRegistryEntry(hive, subKey, nameof(DoubleClickOnTabClosesIt)).Read(); + AlwaysShowPanelSelectionDlg = new WinRegistryEntry(hive, subKey, nameof(AlwaysShowPanelSelectionDlg)).Read(); + CreateEmptyPanelOnStartUp = new WinRegistryEntry(hive, subKey, nameof(CreateEmptyPanelOnStartUp)).Read(); + StartUpPanelName = new WinRegistryEntry(hive, subKey, nameof(StartUpPanelName)).Read(); + + SetupValidation(); + Apply(); + } + + /// + /// Configures validation settings for various parameters + /// + private void SetupValidation() + { + + } + + /// + /// Applies registry settings and overrides various properties. + /// + private void Apply() + { + ApplyAlwaysShowPanelTabs(); + ApplyShowLogonInfoOnTabs(); + ApplyShowProtocolOnTabs(); + ApplyIdentifyQuickConnectTabs(); + ApplyDoubleClickOnTabClosesIt(); + ApplyAlwaysShowPanelSelectionDlg(); + ApplyCreateEmptyPanelOnStartUp(); + ApplyStartUpPanelName(); + } + + private void ApplyAlwaysShowPanelTabs() + { + if (AlwaysShowPanelTabs.IsSet) + Properties.OptionsTabsPanelsPage.Default.AlwaysShowPanelTabs = AlwaysShowPanelTabs.Value; + } + + private void ApplyShowLogonInfoOnTabs() + { + if (ShowLogonInfoOnTabs.IsSet) + Properties.OptionsTabsPanelsPage.Default.ShowLogonInfoOnTabs = ShowLogonInfoOnTabs.Value; + } + + private void ApplyShowProtocolOnTabs() + { + if (ShowProtocolOnTabs.IsSet) + Properties.OptionsTabsPanelsPage.Default.ShowProtocolOnTabs = ShowProtocolOnTabs.Value; + } + + private void ApplyIdentifyQuickConnectTabs() + { + if (IdentifyQuickConnectTabs.IsSet) + Properties.OptionsTabsPanelsPage.Default.IdentifyQuickConnectTabs = IdentifyQuickConnectTabs.Value; + } + + private void ApplyDoubleClickOnTabClosesIt() + { + if (DoubleClickOnTabClosesIt.IsSet) + Properties.OptionsTabsPanelsPage.Default.DoubleClickOnTabClosesIt = DoubleClickOnTabClosesIt.Value; + } + + private void ApplyAlwaysShowPanelSelectionDlg() + { + if (AlwaysShowPanelSelectionDlg.IsSet) + Properties.OptionsTabsPanelsPage.Default.AlwaysShowPanelSelectionDlg = AlwaysShowPanelSelectionDlg.Value; + } + + private void ApplyCreateEmptyPanelOnStartUp() + { + if (CreateEmptyPanelOnStartUp.IsSet) + Properties.OptionsTabsPanelsPage.Default.CreateEmptyPanelOnStartUp = CreateEmptyPanelOnStartUp.Value; + } + + private void ApplyStartUpPanelName() + { + if (StartUpPanelName.IsSet) + Properties.OptionsTabsPanelsPage.Default.StartUpPanelName = StartUpPanelName.Value; + } + } +} \ No newline at end of file diff --git a/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs b/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs index 774d17ae..47d06cd0 100644 --- a/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs +++ b/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs @@ -44,6 +44,9 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkCreateEmptyPanelOnStart = new MrngCheckBox(); txtBoxPanelName = new MrngTextBox(); lblPanelName = new MrngLabel(); + pnlOptions = new System.Windows.Forms.Panel(); + lblRegistrySettingsUsedInfo = new System.Windows.Forms.Label(); + pnlOptions.SuspendLayout(); SuspendLayout(); // // chkAlwaysShowPanelTabs @@ -51,7 +54,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkAlwaysShowPanelTabs._mice = MrngCheckBox.MouseState.OUT; chkAlwaysShowPanelTabs.AutoSize = true; chkAlwaysShowPanelTabs.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkAlwaysShowPanelTabs.Location = new System.Drawing.Point(9, 8); + chkAlwaysShowPanelTabs.Location = new System.Drawing.Point(3, 3); chkAlwaysShowPanelTabs.Name = "chkAlwaysShowPanelTabs"; chkAlwaysShowPanelTabs.Size = new System.Drawing.Size(149, 17); chkAlwaysShowPanelTabs.TabIndex = 0; @@ -63,7 +66,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkAlwaysShowConnectionTabs._mice = MrngCheckBox.MouseState.OUT; chkAlwaysShowConnectionTabs.AutoSize = true; chkAlwaysShowConnectionTabs.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkAlwaysShowConnectionTabs.Location = new System.Drawing.Point(9, 31); + chkAlwaysShowConnectionTabs.Location = new System.Drawing.Point(3, 26); chkAlwaysShowConnectionTabs.Name = "chkAlwaysShowConnectionTabs"; chkAlwaysShowConnectionTabs.Size = new System.Drawing.Size(178, 17); chkAlwaysShowConnectionTabs.TabIndex = 0; @@ -76,7 +79,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkIdentifyQuickConnectTabs._mice = MrngCheckBox.MouseState.OUT; chkIdentifyQuickConnectTabs.AutoSize = true; chkIdentifyQuickConnectTabs.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkIdentifyQuickConnectTabs.Location = new System.Drawing.Point(9, 123); + chkIdentifyQuickConnectTabs.Location = new System.Drawing.Point(3, 118); chkIdentifyQuickConnectTabs.Name = "chkIdentifyQuickConnectTabs"; chkIdentifyQuickConnectTabs.Size = new System.Drawing.Size(315, 17); chkIdentifyQuickConnectTabs.TabIndex = 4; @@ -88,7 +91,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkOpenNewTabRightOfSelected._mice = MrngCheckBox.MouseState.OUT; chkOpenNewTabRightOfSelected.AutoSize = true; chkOpenNewTabRightOfSelected.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkOpenNewTabRightOfSelected.Location = new System.Drawing.Point(9, 54); + chkOpenNewTabRightOfSelected.Location = new System.Drawing.Point(3, 49); chkOpenNewTabRightOfSelected.Name = "chkOpenNewTabRightOfSelected"; chkOpenNewTabRightOfSelected.Size = new System.Drawing.Size(309, 17); chkOpenNewTabRightOfSelected.TabIndex = 1; @@ -100,7 +103,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkAlwaysShowPanelSelectionDlg._mice = MrngCheckBox.MouseState.OUT; chkAlwaysShowPanelSelectionDlg.AutoSize = true; chkAlwaysShowPanelSelectionDlg.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkAlwaysShowPanelSelectionDlg.Location = new System.Drawing.Point(9, 169); + chkAlwaysShowPanelSelectionDlg.Location = new System.Drawing.Point(3, 164); chkAlwaysShowPanelSelectionDlg.Name = "chkAlwaysShowPanelSelectionDlg"; chkAlwaysShowPanelSelectionDlg.Size = new System.Drawing.Size(347, 17); chkAlwaysShowPanelSelectionDlg.TabIndex = 6; @@ -112,7 +115,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkShowLogonInfoOnTabs._mice = MrngCheckBox.MouseState.OUT; chkShowLogonInfoOnTabs.AutoSize = true; chkShowLogonInfoOnTabs.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkShowLogonInfoOnTabs.Location = new System.Drawing.Point(9, 77); + chkShowLogonInfoOnTabs.Location = new System.Drawing.Point(3, 72); chkShowLogonInfoOnTabs.Name = "chkShowLogonInfoOnTabs"; chkShowLogonInfoOnTabs.Size = new System.Drawing.Size(226, 17); chkShowLogonInfoOnTabs.TabIndex = 2; @@ -124,7 +127,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkDoubleClickClosesTab._mice = MrngCheckBox.MouseState.OUT; chkDoubleClickClosesTab.AutoSize = true; chkDoubleClickClosesTab.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkDoubleClickClosesTab.Location = new System.Drawing.Point(9, 146); + chkDoubleClickClosesTab.Location = new System.Drawing.Point(3, 141); chkDoubleClickClosesTab.Name = "chkDoubleClickClosesTab"; chkDoubleClickClosesTab.Size = new System.Drawing.Size(170, 17); chkDoubleClickClosesTab.TabIndex = 5; @@ -136,7 +139,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkShowProtocolOnTabs._mice = MrngCheckBox.MouseState.OUT; chkShowProtocolOnTabs.AutoSize = true; chkShowProtocolOnTabs.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkShowProtocolOnTabs.Location = new System.Drawing.Point(9, 100); + chkShowProtocolOnTabs.Location = new System.Drawing.Point(3, 95); chkShowProtocolOnTabs.Name = "chkShowProtocolOnTabs"; chkShowProtocolOnTabs.Size = new System.Drawing.Size(180, 17); chkShowProtocolOnTabs.TabIndex = 3; @@ -148,7 +151,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkCreateEmptyPanelOnStart._mice = MrngCheckBox.MouseState.OUT; chkCreateEmptyPanelOnStart.AutoSize = true; chkCreateEmptyPanelOnStart.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkCreateEmptyPanelOnStart.Location = new System.Drawing.Point(9, 192); + chkCreateEmptyPanelOnStart.Location = new System.Drawing.Point(3, 187); chkCreateEmptyPanelOnStart.Name = "chkCreateEmptyPanelOnStart"; chkCreateEmptyPanelOnStart.Size = new System.Drawing.Size(271, 17); chkCreateEmptyPanelOnStart.TabIndex = 7; @@ -159,7 +162,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages // txtBoxPanelName // txtBoxPanelName.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - txtBoxPanelName.Location = new System.Drawing.Point(41, 228); + txtBoxPanelName.Location = new System.Drawing.Point(35, 223); txtBoxPanelName.Name = "txtBoxPanelName"; txtBoxPanelName.Size = new System.Drawing.Size(213, 22); txtBoxPanelName.TabIndex = 8; @@ -167,31 +170,55 @@ namespace mRemoteNG.UI.Forms.OptionsPages // lblPanelName // lblPanelName.AutoSize = true; - lblPanelName.Location = new System.Drawing.Point(38, 212); + lblPanelName.Location = new System.Drawing.Point(32, 207); lblPanelName.Name = "lblPanelName"; lblPanelName.Size = new System.Drawing.Size(69, 13); lblPanelName.TabIndex = 9; lblPanelName.Text = "Panel name:"; // + // pnlOptions + // + pnlOptions.Controls.Add(chkAlwaysShowPanelTabs); + pnlOptions.Controls.Add(lblPanelName); + pnlOptions.Controls.Add(chkShowProtocolOnTabs); + pnlOptions.Controls.Add(txtBoxPanelName); + pnlOptions.Controls.Add(chkDoubleClickClosesTab); + pnlOptions.Controls.Add(chkCreateEmptyPanelOnStart); + pnlOptions.Controls.Add(chkShowLogonInfoOnTabs); + pnlOptions.Controls.Add(chkAlwaysShowPanelSelectionDlg); + pnlOptions.Controls.Add(chkAlwaysShowConnectionTabs); + pnlOptions.Controls.Add(chkOpenNewTabRightOfSelected); + pnlOptions.Controls.Add(chkIdentifyQuickConnectTabs); + pnlOptions.Dock = System.Windows.Forms.DockStyle.Top; + pnlOptions.Location = new System.Drawing.Point(0, 30); + pnlOptions.Name = "pnlOptions"; + pnlOptions.Size = new System.Drawing.Size(610, 262); + pnlOptions.TabIndex = 10; + // + // lblRegistrySettingsUsedInfo + // + lblRegistrySettingsUsedInfo.BackColor = System.Drawing.SystemColors.ControlLight; + lblRegistrySettingsUsedInfo.Dock = System.Windows.Forms.DockStyle.Top; + lblRegistrySettingsUsedInfo.ForeColor = System.Drawing.SystemColors.ControlText; + lblRegistrySettingsUsedInfo.Location = new System.Drawing.Point(0, 0); + lblRegistrySettingsUsedInfo.Name = "lblRegistrySettingsUsedInfo"; + lblRegistrySettingsUsedInfo.Padding = new System.Windows.Forms.Padding(0, 2, 0, 0); + lblRegistrySettingsUsedInfo.Size = new System.Drawing.Size(610, 30); + lblRegistrySettingsUsedInfo.TabIndex = 11; + lblRegistrySettingsUsedInfo.Text = "Some settings are configured by your Administrator. Please contact your administrator for more information."; + lblRegistrySettingsUsedInfo.Visible = false; + // // TabsPanelsPage // AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - Controls.Add(lblPanelName); - Controls.Add(txtBoxPanelName); - Controls.Add(chkCreateEmptyPanelOnStart); - Controls.Add(chkAlwaysShowPanelTabs); - Controls.Add(chkAlwaysShowConnectionTabs); - Controls.Add(chkIdentifyQuickConnectTabs); - Controls.Add(chkOpenNewTabRightOfSelected); - Controls.Add(chkAlwaysShowPanelSelectionDlg); - Controls.Add(chkShowLogonInfoOnTabs); - Controls.Add(chkDoubleClickClosesTab); - Controls.Add(chkShowProtocolOnTabs); + Controls.Add(pnlOptions); + Controls.Add(lblRegistrySettingsUsedInfo); Name = "TabsPanelsPage"; Size = new System.Drawing.Size(610, 490); + pnlOptions.ResumeLayout(false); + pnlOptions.PerformLayout(); ResumeLayout(false); - PerformLayout(); } internal MrngCheckBox chkAlwaysShowPanelTabs; @@ -205,5 +232,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages private MrngCheckBox chkCreateEmptyPanelOnStart; private Controls.MrngTextBox txtBoxPanelName; private Controls.MrngLabel lblPanelName; + private System.Windows.Forms.Panel pnlOptions; + internal System.Windows.Forms.Label lblRegistrySettingsUsedInfo; } } diff --git a/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.cs b/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.cs index 0c508992..19b25794 100644 --- a/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.cs +++ b/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.cs @@ -1,5 +1,7 @@ -using mRemoteNG.Properties; +using mRemoteNG.Config.Settings.Registry; +using mRemoteNG.Properties; using mRemoteNG.Resources.Language; +using System; using System.Runtime.Versioning; namespace mRemoteNG.UI.Forms.OptionsPages @@ -7,6 +9,12 @@ namespace mRemoteNG.UI.Forms.OptionsPages [SupportedOSPlatform("windows")] public sealed partial class TabsPanelsPage { + #region Private Fields + + private OptRegistryTabsPanelsPage pageRegSettingsInstance; + + #endregion + public TabsPanelsPage() { InitializeComponent(); @@ -25,7 +33,11 @@ namespace mRemoteNG.UI.Forms.OptionsPages base.ApplyLanguage(); chkAlwaysShowPanelTabs.Text = Language.AlwaysShowPanelTabs; - chkAlwaysShowConnectionTabs.Text = Language.AlwaysShowConnectionTabs; + /* + * Comments added: June 16, 2024 + * UI control (chkAlwaysShowConnectionTabs) is not visible and poperty never used + */ + //chkAlwaysShowConnectionTabs.Text = Language.AlwaysShowConnectionTabs; chkOpenNewTabRightOfSelected.Text = Language.OpenNewTabRight; chkShowLogonInfoOnTabs.Text = Language.ShowLogonInfoOnTabs; chkShowProtocolOnTabs.Text = Language.ShowProtocolOnTabs; @@ -34,13 +46,29 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkAlwaysShowPanelSelectionDlg.Text = Language.AlwaysShowPanelSelection; chkCreateEmptyPanelOnStart.Text = Language.CreateEmptyPanelOnStartUp; lblPanelName.Text = $@"{Language.PanelName}:"; + + lblRegistrySettingsUsedInfo.Text = Language.OptionsCompanyPolicyMessage; } public override void LoadSettings() { chkAlwaysShowPanelTabs.Checked = Properties.OptionsTabsPanelsPage.Default.AlwaysShowPanelTabs; - chkAlwaysShowConnectionTabs.Checked = Properties.OptionsTabsPanelsPage.Default.AlwaysShowConnectionTabs; - chkOpenNewTabRightOfSelected.Checked = Properties.OptionsTabsPanelsPage.Default.OpenTabsRightOfSelected; + + /* + * Comment added: June 16, 2024 + * Properties.OptionsTabsPanelsPage.Default.AlwaysShowConnectionTabs nerver used + * UI control (chkAlwaysShowConnectionTabs) is not visible + */ + //chkAlwaysShowConnectionTabs.Checked = Properties.OptionsTabsPanelsPage.Default.AlwaysShowConnectionTabs; + + /* + * Comment added: June 16, 2024 + * Properties.OptionsTabsPanelsPage.Default.OpenTabsRightOfSelected nerver used + * Set Visible = false + */ + //chkOpenNewTabRightOfSelected.Checked = Properties.OptionsTabsPanelsPage.Default.OpenTabsRightOfSelected; + chkOpenNewTabRightOfSelected.Visible = false; + chkShowLogonInfoOnTabs.Checked = Properties.OptionsTabsPanelsPage.Default.ShowLogonInfoOnTabs; chkShowProtocolOnTabs.Checked = Properties.OptionsTabsPanelsPage.Default.ShowProtocolOnTabs; chkIdentifyQuickConnectTabs.Checked = Properties.OptionsTabsPanelsPage.Default.IdentifyQuickConnectTabs; @@ -56,10 +84,19 @@ namespace mRemoteNG.UI.Forms.OptionsPages base.SaveSettings(); Properties.OptionsTabsPanelsPage.Default.AlwaysShowPanelTabs = chkAlwaysShowPanelTabs.Checked; - Properties.OptionsTabsPanelsPage.Default.AlwaysShowConnectionTabs = chkAlwaysShowConnectionTabs.Checked; + /* + * Comment added: June 16, 2024 + * Properties.OptionsTabsPanelsPage.Default.AlwaysShowConnectionTabs nerver used + */ + //Properties.OptionsTabsPanelsPage.Default.AlwaysShowConnectionTabs = chkAlwaysShowConnectionTabs.Checked; FrmMain.Default.ShowHidePanelTabs(); - Properties.OptionsTabsPanelsPage.Default.OpenTabsRightOfSelected = chkOpenNewTabRightOfSelected.Checked; + /* + * Comment added: June 16, 2024 + * Properties.OptionsTabsPanelsPage.Default.OpenTabsRightOfSelected nerver used + */ + //Properties.OptionsTabsPanelsPage.Default.OpenTabsRightOfSelected = chkOpenNewTabRightOfSelected.Checked; + Properties.OptionsTabsPanelsPage.Default.ShowLogonInfoOnTabs = chkShowLogonInfoOnTabs.Checked; Properties.OptionsTabsPanelsPage.Default.ShowProtocolOnTabs = chkShowProtocolOnTabs.Checked; Properties.OptionsTabsPanelsPage.Default.IdentifyQuickConnectTabs = chkIdentifyQuickConnectTabs.Checked; @@ -69,9 +106,64 @@ namespace mRemoteNG.UI.Forms.OptionsPages Properties.OptionsTabsPanelsPage.Default.StartUpPanelName = txtBoxPanelName.Text; } + public override void LoadRegistrySettings() + { + Type settingsType = typeof(OptRegistryTabsPanelsPage); + RegistryLoader.RegistrySettings.TryGetValue(settingsType, out var settings); + pageRegSettingsInstance = settings as OptRegistryTabsPanelsPage; + + RegistryLoader.Cleanup(settingsType); + + // *** + // Disable controls based on the registry settings. + // + if (pageRegSettingsInstance.AlwaysShowPanelTabs.IsSet) + DisableControl(chkAlwaysShowPanelTabs); + + if (pageRegSettingsInstance.ShowLogonInfoOnTabs.IsSet) + DisableControl(chkShowLogonInfoOnTabs); + + if (pageRegSettingsInstance.ShowProtocolOnTabs.IsSet) + DisableControl(chkShowProtocolOnTabs); + + if (pageRegSettingsInstance.IdentifyQuickConnectTabs.IsSet) + DisableControl(chkIdentifyQuickConnectTabs); + + if (pageRegSettingsInstance.DoubleClickOnTabClosesIt.IsSet) + DisableControl(chkDoubleClickClosesTab); + + if (pageRegSettingsInstance.AlwaysShowPanelSelectionDlg.IsSet) + DisableControl(chkAlwaysShowPanelSelectionDlg); + + if (pageRegSettingsInstance.CreateEmptyPanelOnStartUp.IsSet) + DisableControl(chkCreateEmptyPanelOnStart); + + if (pageRegSettingsInstance.StartUpPanelName.IsSet) + DisableControl(txtBoxPanelName); + + // Updates the visibility of the information label indicating whether registry settings are used. + lblRegistrySettingsUsedInfo.Visible = ShowRegistrySettingsUsedInfo(); + } + + /// + /// Checks if specific registry settings related to appearence page are used. + /// + private bool ShowRegistrySettingsUsedInfo() + { + return pageRegSettingsInstance.AlwaysShowPanelTabs.IsSet + || pageRegSettingsInstance.ShowLogonInfoOnTabs.IsSet + || pageRegSettingsInstance.ShowProtocolOnTabs.IsSet + || pageRegSettingsInstance.IdentifyQuickConnectTabs.IsSet + || pageRegSettingsInstance.DoubleClickOnTabClosesIt.IsSet + || pageRegSettingsInstance.AlwaysShowPanelSelectionDlg.IsSet + || pageRegSettingsInstance.CreateEmptyPanelOnStartUp.IsSet + || pageRegSettingsInstance.StartUpPanelName.IsSet; + } + private void UpdatePanelNameTextBox() { - txtBoxPanelName.Enabled = chkCreateEmptyPanelOnStart.Checked; + if (! pageRegSettingsInstance.StartUpPanelName.IsSet) + txtBoxPanelName.Enabled = chkCreateEmptyPanelOnStart.Checked; } private void chkCreateEmptyPanelOnStart_CheckedChanged(object sender, System.EventArgs e) diff --git a/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.resx b/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.resx index f298a7be..af32865e 100644 --- a/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.resx +++ b/mRemoteNG/UI/Forms/OptionsPages/TabsPanelsPage.resx @@ -1,4 +1,64 @@ - + + + diff --git a/mRemoteNGDocumentation/registry/appearance_settings.rst b/mRemoteNGDocumentation/registry/appearance_settings.rst new file mode 100644 index 00000000..a279bd08 --- /dev/null +++ b/mRemoteNGDocumentation/registry/appearance_settings.rst @@ -0,0 +1,95 @@ +******************* +Appearance Settings +******************* +.. versionadded:: v1.77.3 + +.. warning:: + Before proceeding with any changes to the Windows Registry, it is imperative that you carefully read and comprehend the + **Modifying the Registry**, **Restricted Registry Settings** and **Disclaimer** + on :doc:`Registry Settings Infromation `. + + +Options +======= +Configure the options page to modify functionalities as described. + +- **Registry Hive:** ``HKEY_LOCAL_MACHINE`` +- **Registry Path:** ``SOFTWARE\mRemoteNG\Appearance\Options`` + + +Show Description Tooltips In Connection Tree +-------------------------------------------- +Specifies whether to show tooltips with descriptions in the connection tree view. + +- **Value Name:** ``ShowDescriptionTooltipsInConTree`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Show: ``true`` + - Hide: ``false`` + + +Show Complete Connection File Path In Title +------------------------------------------- +Specifies whether to show complete connection path in the window title. + +- **Value Name:** ``ShowCompleteConFilePathInTitle`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Show: ``true`` + - Hide: ``false`` + + +Always Show System Tray Icon +---------------------------- +Specifies whether to always show the system tray icon. + + +- **Value Name:** ``AlwaysShowSystemTrayIcon`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Show: ``true`` + - Hide: ``false`` + + +Minimize To Tray +---------------- +Specifies whether the application should minimize to the system tray. + +- **Value Name:** ``MinimizeToTray`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Close To Tray +------------- +Specifies whether the application should close to the system tray. + +- **Value Name:** ``CloseToTray`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Registry Template +================= + +.. code:: + + Windows Registry Editor Version 5.00 + + [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\Appearance] + + [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\Appearance\Options] + "AlwaysShowSystemTrayIcon"="false" + "CloseToTray"="false" + "MinimizeToTray"="true" + "ShowCompleteConFilePathInTitle"="true" + "ShowDescriptionTooltipsInConTree"="true" \ No newline at end of file diff --git a/mRemoteNGDocumentation/registry/notification_settings.rst b/mRemoteNGDocumentation/registry/notification_settings.rst new file mode 100644 index 00000000..558f8a9e --- /dev/null +++ b/mRemoteNGDocumentation/registry/notification_settings.rst @@ -0,0 +1,345 @@ +********************* +Notification Settings +********************* +.. versionadded:: v1.77.3 + +.. warning:: + Before proceeding with any changes to the Windows Registry, it is imperative that you carefully read and comprehend the + **Modifying the Registry**, **Restricted Registry Settings** and **Disclaimer** + on :doc:`Registry Settings Infromation `. + + +Common +====== + +- **Registry Hive:** ``HKEY_LOCAL_MACHINE`` +- **Registry Path:** ``SOFTWARE\mRemoteNG\Notifications`` + +Allow Logging +------------- +Specifies whether logging to a file is allowed or not. + +- **Value Name:** ``AllowLogging`` +- **Value Type:** ``REG_SZ`` +- **Default value:** ``true`` +- **Values:** + + - Disallow: ``false`` + + +Allow Notifications +------------------- +Specifies whether notifications are allowed or not. + +- **Value Name:** ``AllowNotifications`` +- **Value Type:** ``REG_SZ`` +- **Default value:** ``true`` +- **Values:** + + - Disallow: ``false`` + + +Allow Popups +------------ +Specifies whether pop-up notifications are allowed or not. + +- **Value Name:** ``AllowPopups`` +- **Value Type:** ``REG_SZ`` +- **Default value:** ``true`` +- **Values:** + + - Disallow: ``false`` + + +Options: Notification Panel +=========================== +Configure the options page to modify functionalities as described. These settings are scoped under the "Notification Panel". + +- **Registry Hive:** ``HKEY_LOCAL_MACHINE`` +- **Registry Path:** ``SOFTWARE\mRemoteNG\Notifications\Options`` + +.. note:: + In some configurations, an initial application restart may be required after the initial launch. + + +Write Debug Messages +-------------------- +Specifies whether debug messages are written to the notification panel. +Show this message types checkbox: Debug + +- **Value Name:** ``NfpWriteDebugMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Write Info Messages +------------------- +Specifies whether information messages are written to the notification panel. +Show this message types checkbox: Information + +- **Value Name:** ``NfpWriteInfoMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Write Warning Messages +---------------------- +Specifies whether warning messages are written to the notification panel. +Show this message types checkbox: Warning + +- **Value Name:** ``NfpWriteWarningMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Write Error Messages +-------------------- +Specifies whether error messages are written to the notification panel. +Show this message types checkbox: Error + +- **Value Name:** ``NfpWriteErrorMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Switch To Notification Panel On Information +------------------------------------------- +Specifies whether to switch to notification panel when information messages are received. +Switch to notifications panel checkbox: Information + +- **Value Name:** ``SwitchToMCOnInformation`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Switch To Notification Panel On Warning +--------------------------------------- +Specifies whether to switch to notification panel when warning messages are received. +Switch to notifications panel checkbox: Warning + +- **Value Name:** ``SwitchToMCOnWarning`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Switch To Notification Panel On Error +------------------------------------- +Specifies whether to switch to notification panel when error messages are received. +Switch to notifications panel checkbox: Error + +- **Value Name:** ``SwitchToMCOnError`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Options: Logging Panel +====================== +Configure the options page to modify functionalities as described. These settings are scoped under the "Logging Panel". + +- **Registry Hive:** ``HKEY_LOCAL_MACHINE`` +- **Registry Path:** ``SOFTWARE\mRemoteNG\Notifications\Options`` + +.. note:: + In some configurations, an initial application restart may be required after the initial launch. + + +Log To Application Directory +---------------------------- +Specifies whether logs should be written to the application directory. + +- **Value Name:** ``LogToApplicationDirectory`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + +.. warning:: + Users must have permissions to the application dir! + +.. note:: + If set to true, LogFilePath cannot be configured. + + +Log File Path +------------- +Specifies the file path for logging. + +- **Value Name:** ``LogFilePath`` +- **Value Type:** ``REG_SZ`` + +.. warning:: + Users must have permissions to write to the file! + +.. note:: + If LogToApplicationDirectory is set to true, this setting has no effect; LogToApplicationDirectory must be set to false. If only LogFilePath is present, LogToApplicationDirectory will be automatically set to false. + + +Write Debug Messages +-------------------- +Specifies whether debug messages should be written to the text log. + +- **Value Name:** ``LfWriteDebugMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Write Info Messages +------------------- +Specifies whether information messages should be written to the text log. + +- **Value Name:** ``LfWriteInfoMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Write Warning Messages +---------------------- +Specifies whether warning messages should be written to the text log. + +- **Value Name:** ``LfWriteWarningMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Write Error Messages +-------------------- +Specifies whether error messages should be written to the text log. + +- **Value Name:** ``LfWriteErrorMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Options: Popup Panel +==================== +Configure the options page to modify functionalities as described. These settings are scoped under the "Popup Panel". + +- **Registry Hive:** ``HKEY_LOCAL_MACHINE`` +- **Registry Path:** ``SOFTWARE\mRemoteNG\Notifications\Options`` + +.. warning:: + Settings could affect the user experience. + +.. note:: + In some configurations, an initial application restart may be required after the initial launch. + + +Write Debug Messages +-------------------- +Specifies whether debug messages should be displayed as popups. + +- **Value Name:** ``PuWriteDebugMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + +.. warning:: + Activating could lead to the program becoming unusable. Suitable only for debugging purposes. + + +Write Info Messages +------------------- +Specifies whether information messages should be displayed as popups. + +- **Value Name:** ``PuWriteInfoMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Write Warning Messages +---------------------- +Specifies whether warning messages should be displayed as popups. + +- **Value Name:** ``PuWriteWarningMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Write Error Messages +-------------------- +Specifies whether error messages should be displayed as popups. + +- **Value Name:** ``PuWriteErrorMsgs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Registry Template +================= + +.. code:: + + Windows Registry Editor Version 5.00 + + [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\Notifications] + "AllowLogging"="false" + "AllowNotifications"="false" + "AllowPopups"="false" + + [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\Notifications\Options] + "NfpWriteDebugMsgs"="true" + "NfpWriteInfoMsgs"="true" + "NfpWriteWarningMsgs"="true" + "NfpWriteErrorMsgs"="true" + "SwitchToMCOnInformation"="false" + "SwitchToMCOnWarning"="false" + "SwitchToMCOnError"="false" + "LfWriteDebugMsgs"="true" + "LfWriteErrorMsgs"="true" + "LfWriteInfoMsgs"="true" + "LfWriteWarningMsgs"="true" + "LogFilePath"="c:\...." + "LogToApplicationDirectory"="false" + "PuWriteDebugMsgs"="false" + "PuWriteErrorMsgs"="false" + "PuWriteInfoMsgs"="false" + "PuWriteWarningMsgs"="false" + + + + diff --git a/mRemoteNGDocumentation/registry/startupExit_settings.rst b/mRemoteNGDocumentation/registry/startupExit_settings.rst new file mode 100644 index 00000000..b8029667 --- /dev/null +++ b/mRemoteNGDocumentation/registry/startupExit_settings.rst @@ -0,0 +1,76 @@ +************************* +Startup and Exit Settings +************************* +.. versionadded:: v1.77.3 + +.. warning:: + Before proceeding with any changes to the Windows Registry, it is imperative that you carefully read and comprehend the + **Modifying the Registry**, **Restricted Registry Settings** and **Disclaimer** + on :doc:`Registry Settings Infromation `. + + +Options +======= +Configure the options page to modify functionalities as described. + +- **Registry Hive:** ``HKEY_LOCAL_MACHINE`` +- **Registry Path:** ``SOFTWARE\mRemoteNG\StartupExit\Options`` + + +Startup Behavior +---------------- +Specifies the startup behavior of the application: + +- None: The application starts without any specific behavior, using the last closed resolution or position. +- Minimized: The application starts minimized. +- FullScreen: The application starts in fullscreen mode. + +- **Value Name:** ``StartupBehavior`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - ``None`` + - ``Minimized`` + - ``FullScreen`` + + +Open Connections From Last Session +---------------------------------- +Specifies whether sessions should be automatically reconnected on application startup. + +- **Value Name:** ``OpenConnectionsFromLastSession`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Enforce Single Application Instance +----------------------------------- +Ensures that only a single instance of the application is allowed to run. + +- **Value Name:** ``EnforceSingleApplicationInstance`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + + +Registry Template +================= + +.. code:: + + Windows Registry Editor Version 5.00 + + [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\StartupExit] + + [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\StartupExit\Options] + "EnforceSingleApplicationInstance"="true" + "OpenConnectionsFromLastSession"="true" + "StartupBehavior"="FullScreen" + + diff --git a/mRemoteNGDocumentation/registry/tabsPanels_settings.rst b/mRemoteNGDocumentation/registry/tabsPanels_settings.rst new file mode 100644 index 00000000..e8532343 --- /dev/null +++ b/mRemoteNGDocumentation/registry/tabsPanels_settings.rst @@ -0,0 +1,136 @@ +*********************** +Tabs and Panel Settings +*********************** +.. versionadded:: v1.77.3 + +.. warning:: + Before proceeding with any changes to the Windows Registry, it is imperative that you carefully read and comprehend the + **Modifying the Registry**, **Restricted Registry Settings** and **Disclaimer** + on :doc:`Registry Settings Infromation `. + + +Options +======= +Configure the options page to modify functionalities as described. + +- **Registry Hive:** ``HKEY_LOCAL_MACHINE`` +- **Registry Path:** ``SOFTWARE\mRemoteNG\TabsAndPanels\Options`` + +Always Show Panel Tabs +---------------------- +Specifies whether panel tabs are always shown or not. This is useful when the panel attribute in a connection is set to group open connections. + +- **Value Name:** ``AlwaysShowPanelTabs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Show Logon Info On Tabs +----------------------- +Specifies whether logon information (username) is shown on tabs. + +- **Value Name:** ``ShowLogonInfoOnTabs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Show Protocol On Tabs +--------------------- +Specifies whether protocol information is displayed on tabs (e.g., RDP:). + +- **Value Name:** ``ShowProtocolOnTabs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Marking Quick Connect Tabs +-------------------------- +Specifies whether quick connect tabs are marked by the prefix "Quick:". + +- **Value Name:** ``IdentifyQuickConnectTabs`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Double Click To Close Tab +------------------------- +Specifies whether double-clicking on a tab closes it. + +- **Value Name:** ``DoubleClickOnTabClosesIt`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Always Show Panel Selection Dialog +---------------------------------- +Specifies whether the panel selection dialog is always shown. +When set to true, initiating a connection will prompt a dialog to appear, allowing the user to choose the panel to which the connection will be added or create a new one. + + +- **Value Name:** ``AlwaysShowPanelSelectionDlg`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Create Empty Panel On Start Up +------------------------------ +Specifies whether an empty panel is created on startup. + +- **Value Name:** ``CreateEmptyPanelOnStartUp`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + - Enable: ``true`` + - Disable: ``false`` + + +Start Up Panel Name +------------------- +Specifies the name of the startup panel. + +- **Value Name:** ``StartUpPanelName`` +- **Value Type:** ``REG_SZ`` +- **Values:** + + +.. note:: + It doesn't take effect if 'CreateEmptyPanelOnStartUp' is unchecked. + + +Registry Template +================= + +.. code:: + + Windows Registry Editor Version 5.00 + + [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\TabsAndPanels] + + [HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\TabsAndPanels\Options] + "AlwaysShowPanelTabs"="true" + "ShowLogonInfoOnTabs"="true" + "ShowProtocolOnTabs"="true" + "IdentifyQuickConnectTabs"="true" + "DoubleClickOnTabClosesIt"="true" + "AlwaysShowPanelSelectionDlg"="true" + "CreateEmptyPanelOnStartUp"="true" + "StartUpPanelName"="" + diff --git a/mRemoteNGDocumentation/registry_settings_guide.rst b/mRemoteNGDocumentation/registry_settings_guide.rst index 797d5925..ee23585d 100644 --- a/mRemoteNGDocumentation/registry_settings_guide.rst +++ b/mRemoteNGDocumentation/registry_settings_guide.rst @@ -22,6 +22,9 @@ Make changes with caution and ensure that you have backups before making any adj .. toctree:: :maxdepth: 4 - registry/credential_settings + registry/startupExit_settings.rst + registry/appearance_settings.rst + registry/tabsPanels_settings.rst + registry/notification_settings.rst registry/credential_settings.rst registry/updates_settings.rst \ No newline at end of file