diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 2bdbe749..e284970c 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,15 @@ +1.76.0 Alpha 2 (201x-xx-xx): + +Features/Enhancements: +---------------------- +#838: Added an option to lock toolbars +#829: Add option that fixes connecting to Azure instances with LoadBalanceInfo + +Fixes: +------ + + + 1.76.0 Alpha 1 (2017-12-08): Features/Enhancements: diff --git a/CREDITS.TXT b/CREDITS.TXT index 2a2d68dd..234c5db1 100644 --- a/CREDITS.TXT +++ b/CREDITS.TXT @@ -21,6 +21,7 @@ Bruce (github.com/brucetp) Camilo Alvarez (github.com/jotatsu) github.com/DamianBis github.com/pfjason +github.com/sirLoaf Past Contributors diff --git a/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs b/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs index 9ac22791..93a5868b 100644 --- a/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs +++ b/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs @@ -33,6 +33,13 @@ namespace mRemoteNG.Config.Connections public void Save(ConnectionTreeModel connectionTreeModel) { + if (SqlUserIsReadOnly()) + { + Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Trying to save connection tree but the SQL read only checkbox is checked, aborting!"); + return; + } + + using (var sqlConnector = DatabaseConnectorFactory.SqlDatabaseConnectorFromSettings()) { sqlConnector.Connect(); @@ -109,5 +116,11 @@ namespace mRemoteNG.Config.Connections sqlQuery = new SqlCommand("INSERT INTO tblUpdate (LastUpdate) VALUES(\'" + MiscTools.DBDate(DateTime.Now) + "\')", sqlDatabaseConnector.SqlConnection); sqlQuery.ExecuteNonQuery(); } + + private bool SqlUserIsReadOnly() + { + return mRemoteNG.Settings.Default.SQLReadOnly; + + } } } diff --git a/mRemoteV1/Config/DataProviders/SqlDataProvider.cs b/mRemoteV1/Config/DataProviders/SqlDataProvider.cs index 5f6096e2..cb70977c 100644 --- a/mRemoteV1/Config/DataProviders/SqlDataProvider.cs +++ b/mRemoteV1/Config/DataProviders/SqlDataProvider.cs @@ -1,7 +1,8 @@ using System.Data; using System.Data.SqlClient; using mRemoteNG.Config.DatabaseConnectors; - +using mRemoteNG.Messages; +using mRemoteNG.App; namespace mRemoteNG.Config.DataProviders { @@ -31,6 +32,12 @@ namespace mRemoteNG.Config.DataProviders public void Save(DataTable dataTable) { + if (SqlUserIsReadOnly()) + { + Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Trying to save connections but the SQL read only checkbox is checked, aborting!"); + return; + } + if (!SqlDatabaseConnector.IsConnected) OpenConnection(); using (var sqlBulkCopy = new SqlBulkCopy(SqlDatabaseConnector.SqlConnection)) @@ -51,5 +58,11 @@ namespace mRemoteNG.Config.DataProviders { SqlDatabaseConnector.Disconnect(); } + + private bool SqlUserIsReadOnly() + { + return mRemoteNG.Settings.Default.SQLReadOnly; + + } } } \ No newline at end of file diff --git a/mRemoteV1/Connection/Protocol/ProtocolFactory.cs b/mRemoteV1/Connection/Protocol/ProtocolFactory.cs index 070fa50d..c4f6ca99 100644 --- a/mRemoteV1/Connection/Protocol/ProtocolFactory.cs +++ b/mRemoteV1/Connection/Protocol/ProtocolFactory.cs @@ -19,7 +19,10 @@ namespace mRemoteNG.Connection.Protocol switch (connectionInfo.Protocol) { case ProtocolType.RDP: - newProtocol = new RdpProtocol(); + newProtocol = new RdpProtocol + { + LoadBalanceInfoUseUtf8 = Settings.Default.RdpLoadBalanceInfoUseUtf8 + }; ((RdpProtocol) newProtocol).tmrReconnect.Elapsed += ((RdpProtocol) newProtocol).tmrReconnect_Elapsed; break; case ProtocolType.VNC: diff --git a/mRemoteV1/Connection/Protocol/RDP/AzureLoadBalanceInfoEncoder.cs b/mRemoteV1/Connection/Protocol/RDP/AzureLoadBalanceInfoEncoder.cs new file mode 100644 index 00000000..e0836053 --- /dev/null +++ b/mRemoteV1/Connection/Protocol/RDP/AzureLoadBalanceInfoEncoder.cs @@ -0,0 +1,40 @@ +using System.Text; + +namespace mRemoteNG.Connection.Protocol.RDP +{ + public class AzureLoadBalanceInfoEncoder + { + public string Encode(string loadBalanceInfo) + { + // The ActiveX component requires a UTF-8 encoded string, but .NET uses + // UTF-16 encoded strings by default. The following code converts + // the UTF-16 encoded string so that the byte-representation of the + // LoadBalanceInfo string object will "appear" as UTF-8 to the Active component. + // Furthermore, since the final string still has to be shoehorned into + // a UTF-16 encoded string, I pad an extra space in case the number of + // bytes would be odd, in order to prevent the byte conversion from + // mangling the string at the end. The space is ignored by the RDP + // protocol as long as it is inserted at the end. + // Finally, it is required that the LoadBalanceInfo setting is postfixed + // with \r\n in order to work properly. Note also that \r\n MUST be + // the last two characters, so the space padding has to be inserted first. + // The following code has been tested with Windows Azure connections + // only - I am aware there are other types of RDP connections that + // require the LoadBalanceInfo parameter which I have not tested + // (e.g., Multi-Server Terminal Services Gateway), that may or may not + // work properly. + // + // Sources: + // 1. http://stackoverflow.com/questions/13536267/how-to-connect-to-azure-vm-with-remote-desktop-activex + // 2. http://social.technet.microsoft.com/Forums/windowsserver/en-US/e68d4e9a-1c8a-4e55-83b3-e3b726ff5346/issue-with-using-advancedsettings2loadbalanceinfo + // 3. Manual comparison of raw packets between Windows RDP client and Terminals using WireShark. + // Copied from https://github.com/OliverKohlDSc/Terminals/blob/master/Terminals/Connections/RDPConnection.cs + if (loadBalanceInfo.Length % 2 == 1) + loadBalanceInfo += " "; + + loadBalanceInfo += "\r\n"; + var bytes = Encoding.UTF8.GetBytes(loadBalanceInfo); + return Encoding.Unicode.GetString(bytes); + } + } +} diff --git a/mRemoteV1/Connection/Protocol/RDP/RdpProtocol.cs b/mRemoteV1/Connection/Protocol/RDP/RdpProtocol.cs index e1b7f17d..198aabdb 100644 --- a/mRemoteV1/Connection/Protocol/RDP/RdpProtocol.cs +++ b/mRemoteV1/Connection/Protocol/RDP/RdpProtocol.cs @@ -87,6 +87,8 @@ namespace mRemoteNG.Connection.Protocol.RDP } } } + + public bool LoadBalanceInfoUseUtf8 { get; set; } #endregion #region Constructors @@ -601,7 +603,9 @@ namespace mRemoteNG.Connection.Protocol.RDP } try { - _rdpClient.AdvancedSettings2.LoadBalanceInfo = _connectionInfo.LoadBalanceInfo; + _rdpClient.AdvancedSettings2.LoadBalanceInfo = LoadBalanceInfoUseUtf8 + ? new AzureLoadBalanceInfoEncoder().Encode(_connectionInfo.LoadBalanceInfo) + : _connectionInfo.LoadBalanceInfo; } catch (Exception ex) { diff --git a/mRemoteV1/Properties/Settings.Designer.cs b/mRemoteV1/Properties/Settings.Designer.cs index 3a643d33..df4e9452 100644 --- a/mRemoteV1/Properties/Settings.Designer.cs +++ b/mRemoteV1/Properties/Settings.Designer.cs @@ -2626,5 +2626,41 @@ namespace mRemoteNG { this["UseFilterSearch"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SQLReadOnly { + get { + return ((bool)(this["SQLReadOnly"])); + } + set { + this["SQLReadOnly"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool LockToolbars { + get { + return ((bool)(this["LockToolbars"])); + } + set { + this["LockToolbars"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool RdpLoadBalanceInfoUseUtf8 { + get { + return ((bool)(this["RdpLoadBalanceInfoUseUtf8"])); + } + set { + this["RdpLoadBalanceInfoUseUtf8"] = value; + } + } } } diff --git a/mRemoteV1/Properties/Settings.settings b/mRemoteV1/Properties/Settings.settings index 89793ea1..be2beae4 100644 --- a/mRemoteV1/Properties/Settings.settings +++ b/mRemoteV1/Properties/Settings.settings @@ -653,5 +653,14 @@ False + + False + + + False + + + False + \ No newline at end of file diff --git a/mRemoteV1/Resources/Language/Language.Designer.cs b/mRemoteV1/Resources/Language/Language.Designer.cs index 932dd31b..466e4c6d 100644 --- a/mRemoteV1/Resources/Language/Language.Designer.cs +++ b/mRemoteV1/Resources/Language/Language.Designer.cs @@ -159,6 +159,15 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized string similar to Use UTF8 encoding for RDP "Load Balance Info" property. + /// + internal static string LoadBalanceInfoUseUtf8 { + get { + return ResourceManager.GetString("LoadBalanceInfoUseUtf8", resourceCulture); + } + } + /// /// Looks up a localized string similar to Login failed for user '{0}'.. /// @@ -2894,6 +2903,15 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized string similar to Read Only:. + /// + internal static string strLabelReadOnly { + get { + return ResourceManager.GetString("strLabelReadOnly", resourceCulture); + } + } + /// /// Looks up a localized string similar to Released under the GNU General Public License (GPL). /// diff --git a/mRemoteV1/Resources/Language/Language.resx b/mRemoteV1/Resources/Language/Language.resx index 234c2605..2073b5ed 100644 --- a/mRemoteV1/Resources/Language/Language.resx +++ b/mRemoteV1/Resources/Language/Language.resx @@ -2625,4 +2625,10 @@ This page will walk you through the process of upgrading your connections file o Test Connection + + Read Only: + + + Use UTF8 encoding for RDP "Load Balance Info" property + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs index 4bdb552c..6696dcc2 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs @@ -43,6 +43,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.lblUVNCSCPort = new mRemoteNG.UI.Controls.Base.NGLabel(); this.lblSeconds = new mRemoteNG.UI.Controls.Base.NGLabel(); this.btnBrowseCustomPuttyPath = new mRemoteNG.UI.Controls.Base.NGButton(); + this.chkLoadBalanceInfoUseUtf8 = new mRemoteNG.UI.Controls.Base.NGCheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numPuttyWaitTime)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numUVNCSCPort)).BeginInit(); this.SuspendLayout(); @@ -60,7 +61,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages // // lblMaximumPuttyWaitTime // - this.lblMaximumPuttyWaitTime.Location = new System.Drawing.Point(3, 152); + this.lblMaximumPuttyWaitTime.Location = new System.Drawing.Point(3, 175); this.lblMaximumPuttyWaitTime.Name = "lblMaximumPuttyWaitTime"; this.lblMaximumPuttyWaitTime.Size = new System.Drawing.Size(364, 13); this.lblMaximumPuttyWaitTime.TabIndex = 7; @@ -81,7 +82,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages // numPuttyWaitTime // this.numPuttyWaitTime.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.numPuttyWaitTime.Location = new System.Drawing.Point(373, 150); + this.numPuttyWaitTime.Location = new System.Drawing.Point(373, 173); this.numPuttyWaitTime.Maximum = new decimal(new int[] { 999, 0, @@ -89,7 +90,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages 0}); this.numPuttyWaitTime.Name = "numPuttyWaitTime"; this.numPuttyWaitTime.Size = new System.Drawing.Size(49, 20); - this.numPuttyWaitTime.TabIndex = 8; + this.numPuttyWaitTime.TabIndex = 7; this.numPuttyWaitTime.Value = new decimal(new int[] { 5, 0, @@ -100,17 +101,17 @@ namespace mRemoteNG.UI.Forms.OptionsPages // this.chkUseCustomPuttyPath._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER; this.chkUseCustomPuttyPath.AutoSize = true; - this.chkUseCustomPuttyPath.Location = new System.Drawing.Point(3, 49); + this.chkUseCustomPuttyPath.Location = new System.Drawing.Point(3, 72); this.chkUseCustomPuttyPath.Name = "chkUseCustomPuttyPath"; this.chkUseCustomPuttyPath.Size = new System.Drawing.Size(146, 17); - this.chkUseCustomPuttyPath.TabIndex = 2; + this.chkUseCustomPuttyPath.TabIndex = 3; this.chkUseCustomPuttyPath.Text = "Use custom PuTTY path:"; this.chkUseCustomPuttyPath.UseVisualStyleBackColor = true; this.chkUseCustomPuttyPath.CheckedChanged += new System.EventHandler(this.chkUseCustomPuttyPath_CheckedChanged); // // lblConfigurePuttySessions // - this.lblConfigurePuttySessions.Location = new System.Drawing.Point(3, 121); + this.lblConfigurePuttySessions.Location = new System.Drawing.Point(3, 144); this.lblConfigurePuttySessions.Name = "lblConfigurePuttySessions"; this.lblConfigurePuttySessions.Size = new System.Drawing.Size(364, 13); this.lblConfigurePuttySessions.TabIndex = 5; @@ -120,7 +121,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages // numUVNCSCPort // this.numUVNCSCPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.numUVNCSCPort.Location = new System.Drawing.Point(373, 193); + this.numUVNCSCPort.Location = new System.Drawing.Point(373, 218); this.numUVNCSCPort.Maximum = new decimal(new int[] { 65535, 0, @@ -128,7 +129,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages 0}); this.numUVNCSCPort.Name = "numUVNCSCPort"; this.numUVNCSCPort.Size = new System.Drawing.Size(72, 20); - this.numUVNCSCPort.TabIndex = 11; + this.numUVNCSCPort.TabIndex = 8; this.numUVNCSCPort.Value = new decimal(new int[] { 5500, 0, @@ -140,10 +141,10 @@ namespace mRemoteNG.UI.Forms.OptionsPages // this.txtCustomPuttyPath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtCustomPuttyPath.Enabled = false; - this.txtCustomPuttyPath.Location = new System.Drawing.Point(21, 72); + this.txtCustomPuttyPath.Location = new System.Drawing.Point(21, 95); this.txtCustomPuttyPath.Name = "txtCustomPuttyPath"; this.txtCustomPuttyPath.Size = new System.Drawing.Size(346, 20); - this.txtCustomPuttyPath.TabIndex = 3; + this.txtCustomPuttyPath.TabIndex = 4; this.txtCustomPuttyPath.TextChanged += new System.EventHandler(this.txtCustomPuttyPath_TextChanged); // // btnLaunchPutty @@ -151,7 +152,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.btnLaunchPutty._mice = mRemoteNG.UI.Controls.Base.NGButton.MouseState.HOVER; this.btnLaunchPutty.Image = global::mRemoteNG.Resources.PuttyConfig; this.btnLaunchPutty.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnLaunchPutty.Location = new System.Drawing.Point(373, 115); + this.btnLaunchPutty.Location = new System.Drawing.Point(373, 138); this.btnLaunchPutty.Name = "btnLaunchPutty"; this.btnLaunchPutty.Size = new System.Drawing.Size(110, 25); this.btnLaunchPutty.TabIndex = 6; @@ -162,7 +163,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages // // lblUVNCSCPort // - this.lblUVNCSCPort.Location = new System.Drawing.Point(3, 195); + this.lblUVNCSCPort.Location = new System.Drawing.Point(3, 220); this.lblUVNCSCPort.Name = "lblUVNCSCPort"; this.lblUVNCSCPort.Size = new System.Drawing.Size(364, 13); this.lblUVNCSCPort.TabIndex = 10; @@ -173,7 +174,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages // lblSeconds // this.lblSeconds.AutoSize = true; - this.lblSeconds.Location = new System.Drawing.Point(428, 152); + this.lblSeconds.Location = new System.Drawing.Point(428, 175); this.lblSeconds.Name = "lblSeconds"; this.lblSeconds.Size = new System.Drawing.Size(47, 13); this.lblSeconds.TabIndex = 9; @@ -183,18 +184,30 @@ namespace mRemoteNG.UI.Forms.OptionsPages // this.btnBrowseCustomPuttyPath._mice = mRemoteNG.UI.Controls.Base.NGButton.MouseState.HOVER; this.btnBrowseCustomPuttyPath.Enabled = false; - this.btnBrowseCustomPuttyPath.Location = new System.Drawing.Point(373, 70); + this.btnBrowseCustomPuttyPath.Location = new System.Drawing.Point(373, 93); this.btnBrowseCustomPuttyPath.Name = "btnBrowseCustomPuttyPath"; this.btnBrowseCustomPuttyPath.Size = new System.Drawing.Size(75, 23); - this.btnBrowseCustomPuttyPath.TabIndex = 4; + this.btnBrowseCustomPuttyPath.TabIndex = 5; this.btnBrowseCustomPuttyPath.Text = "Browse..."; this.btnBrowseCustomPuttyPath.UseVisualStyleBackColor = true; this.btnBrowseCustomPuttyPath.Click += new System.EventHandler(this.btnBrowseCustomPuttyPath_Click); // + // chkLoadBalanceInfoUseUtf8 + // + this.chkLoadBalanceInfoUseUtf8._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER; + this.chkLoadBalanceInfoUseUtf8.AutoSize = true; + this.chkLoadBalanceInfoUseUtf8.Location = new System.Drawing.Point(3, 49); + this.chkLoadBalanceInfoUseUtf8.Name = "chkLoadBalanceInfoUseUtf8"; + this.chkLoadBalanceInfoUseUtf8.Size = new System.Drawing.Size(304, 17); + this.chkLoadBalanceInfoUseUtf8.TabIndex = 2; + this.chkLoadBalanceInfoUseUtf8.Text = "Use UTF8 encoding for RDP \"Load Balance Info\" property"; + this.chkLoadBalanceInfoUseUtf8.UseVisualStyleBackColor = true; + // // AdvancedPage // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.chkLoadBalanceInfoUseUtf8); this.Controls.Add(this.chkAutomaticallyGetSessionInfo); this.Controls.Add(this.lblMaximumPuttyWaitTime); this.Controls.Add(this.chkAutomaticReconnect); @@ -228,6 +241,6 @@ namespace mRemoteNG.UI.Forms.OptionsPages internal Controls.Base.NGLabel lblUVNCSCPort; internal Controls.Base.NGLabel lblSeconds; internal Controls.Base.NGButton btnBrowseCustomPuttyPath; - - } + private Controls.Base.NGCheckBox chkLoadBalanceInfoUseUtf8; + } } diff --git a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.cs b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.cs index c01934a9..9dfc5d1a 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.cs @@ -32,6 +32,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages lblSeconds.Text = Language.strLabelSeconds; lblMaximumPuttyWaitTime.Text = Language.strLabelPuttyTimeout; chkAutomaticReconnect.Text = Language.strCheckboxAutomaticReconnect; + chkLoadBalanceInfoUseUtf8.Text = Language.LoadBalanceInfoUseUtf8; lblConfigurePuttySessions.Text = Language.strLabelPuttySessionsConfig; btnLaunchPutty.Text = Language.strButtonLaunchPutty; btnBrowseCustomPuttyPath.Text = Language.strButtonBrowse; @@ -46,6 +47,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages chkAutomaticallyGetSessionInfo.Checked = Settings.Default.AutomaticallyGetSessionInfo; chkAutomaticReconnect.Checked = Settings.Default.ReconnectOnDisconnect; + chkLoadBalanceInfoUseUtf8.Checked = Settings.Default.RdpLoadBalanceInfoUseUtf8; numPuttyWaitTime.Value = Settings.Default.MaxPuttyWaitTime; chkUseCustomPuttyPath.Checked = Settings.Default.UseCustomPuttyPath; @@ -59,6 +61,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages { Settings.Default.AutomaticallyGetSessionInfo = chkAutomaticallyGetSessionInfo.Checked; Settings.Default.ReconnectOnDisconnect = chkAutomaticReconnect.Checked; + Settings.Default.RdpLoadBalanceInfoUseUtf8 = chkLoadBalanceInfoUseUtf8.Checked; var puttyPathChanged = false; if (Settings.Default.CustomPuttyPath != txtCustomPuttyPath.Text) diff --git a/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.Designer.cs index 8eae85b8..f1a1654f 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.Designer.cs @@ -27,195 +27,220 @@ namespace mRemoteNG.UI.Forms.OptionsPages //Do not modify it using the code editor. [System.Diagnostics.DebuggerStepThrough()]private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SqlServerPage)); - this.lblSQLDatabaseName = new mRemoteNG.UI.Controls.Base.NGLabel(); - this.txtSQLDatabaseName = new mRemoteNG.UI.Controls.Base.NGTextBox(); - this.lblExperimental = new mRemoteNG.UI.Controls.Base.NGLabel(); - this.chkUseSQLServer = new mRemoteNG.UI.Controls.Base.NGCheckBox(); - this.lblSQLUsername = new mRemoteNG.UI.Controls.Base.NGLabel(); - this.txtSQLPassword = new mRemoteNG.UI.Controls.Base.NGTextBox(); - this.lblSQLInfo = new mRemoteNG.UI.Controls.Base.NGLabel(); - this.lblSQLServer = new mRemoteNG.UI.Controls.Base.NGLabel(); - this.txtSQLUsername = new mRemoteNG.UI.Controls.Base.NGTextBox(); - this.txtSQLServer = new mRemoteNG.UI.Controls.Base.NGTextBox(); - this.lblSQLPassword = new mRemoteNG.UI.Controls.Base.NGLabel(); - this.btnTestConnection = new mRemoteNG.UI.Controls.Base.NGButton(); - this.imgConnectionStatus = new System.Windows.Forms.PictureBox(); - this.lblTestConnectionResults = new mRemoteNG.UI.Controls.Base.NGLabel(); - ((System.ComponentModel.ISupportInitialize)(this.imgConnectionStatus)).BeginInit(); - this.SuspendLayout(); - // - // lblSQLDatabaseName - // - this.lblSQLDatabaseName.Enabled = false; - this.lblSQLDatabaseName.Location = new System.Drawing.Point(23, 132); - this.lblSQLDatabaseName.Name = "lblSQLDatabaseName"; - this.lblSQLDatabaseName.Size = new System.Drawing.Size(111, 13); - this.lblSQLDatabaseName.TabIndex = 5; - this.lblSQLDatabaseName.Text = "Database:"; - this.lblSQLDatabaseName.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // txtSQLDatabaseName - // - this.txtSQLDatabaseName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtSQLDatabaseName.Enabled = false; - this.txtSQLDatabaseName.Location = new System.Drawing.Point(140, 130); - this.txtSQLDatabaseName.Name = "txtSQLDatabaseName"; - this.txtSQLDatabaseName.Size = new System.Drawing.Size(153, 20); - this.txtSQLDatabaseName.TabIndex = 6; - // - // lblExperimental - // - this.lblExperimental.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SqlServerPage)); + this.lblSQLDatabaseName = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.txtSQLDatabaseName = new mRemoteNG.UI.Controls.Base.NGTextBox(); + this.lblExperimental = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.chkUseSQLServer = new mRemoteNG.UI.Controls.Base.NGCheckBox(); + this.lblSQLUsername = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.txtSQLPassword = new mRemoteNG.UI.Controls.Base.NGTextBox(); + this.lblSQLInfo = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.lblSQLServer = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.txtSQLUsername = new mRemoteNG.UI.Controls.Base.NGTextBox(); + this.txtSQLServer = new mRemoteNG.UI.Controls.Base.NGTextBox(); + this.lblSQLPassword = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.btnTestConnection = new mRemoteNG.UI.Controls.Base.NGButton(); + this.imgConnectionStatus = new System.Windows.Forms.PictureBox(); + this.lblTestConnectionResults = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.chkSQLReadOnly = new mRemoteNG.UI.Controls.Base.NGCheckBox(); + this.lblSQLReadOnly = new mRemoteNG.UI.Controls.Base.NGLabel(); + ((System.ComponentModel.ISupportInitialize)(this.imgConnectionStatus)).BeginInit(); + this.SuspendLayout(); + // + // lblSQLDatabaseName + // + this.lblSQLDatabaseName.Enabled = false; + this.lblSQLDatabaseName.Location = new System.Drawing.Point(23, 132); + this.lblSQLDatabaseName.Name = "lblSQLDatabaseName"; + this.lblSQLDatabaseName.Size = new System.Drawing.Size(111, 13); + this.lblSQLDatabaseName.TabIndex = 5; + this.lblSQLDatabaseName.Text = "Database:"; + this.lblSQLDatabaseName.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtSQLDatabaseName + // + this.txtSQLDatabaseName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtSQLDatabaseName.Enabled = false; + this.txtSQLDatabaseName.Location = new System.Drawing.Point(140, 130); + this.txtSQLDatabaseName.Name = "txtSQLDatabaseName"; + this.txtSQLDatabaseName.Size = new System.Drawing.Size(153, 20); + this.txtSQLDatabaseName.TabIndex = 6; + // + // lblExperimental + // + this.lblExperimental.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblExperimental.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.World); - this.lblExperimental.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.lblExperimental.Location = new System.Drawing.Point(3, 0); - this.lblExperimental.Name = "lblExperimental"; - this.lblExperimental.Size = new System.Drawing.Size(596, 25); - this.lblExperimental.TabIndex = 0; - this.lblExperimental.Text = "EXPERIMENTAL"; - this.lblExperimental.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // chkUseSQLServer - // - this.chkUseSQLServer._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER; - this.chkUseSQLServer.AutoSize = true; - this.chkUseSQLServer.Location = new System.Drawing.Point(3, 76); - this.chkUseSQLServer.Name = "chkUseSQLServer"; - this.chkUseSQLServer.Size = new System.Drawing.Size(234, 17); - this.chkUseSQLServer.TabIndex = 2; - this.chkUseSQLServer.Text = "Use SQL Server to load && save connections"; - this.chkUseSQLServer.UseVisualStyleBackColor = true; - this.chkUseSQLServer.CheckedChanged += new System.EventHandler(this.chkUseSQLServer_CheckedChanged); - // - // lblSQLUsername - // - this.lblSQLUsername.Enabled = false; - this.lblSQLUsername.Location = new System.Drawing.Point(23, 158); - this.lblSQLUsername.Name = "lblSQLUsername"; - this.lblSQLUsername.Size = new System.Drawing.Size(111, 13); - this.lblSQLUsername.TabIndex = 7; - this.lblSQLUsername.Text = "Username:"; - this.lblSQLUsername.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // txtSQLPassword - // - this.txtSQLPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtSQLPassword.Enabled = false; - this.txtSQLPassword.Location = new System.Drawing.Point(140, 182); - this.txtSQLPassword.Name = "txtSQLPassword"; - this.txtSQLPassword.Size = new System.Drawing.Size(153, 20); - this.txtSQLPassword.TabIndex = 10; - this.txtSQLPassword.UseSystemPasswordChar = true; - // - // lblSQLInfo - // - this.lblSQLInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.lblExperimental.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.World); + this.lblExperimental.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.lblExperimental.Location = new System.Drawing.Point(3, 0); + this.lblExperimental.Name = "lblExperimental"; + this.lblExperimental.Size = new System.Drawing.Size(596, 25); + this.lblExperimental.TabIndex = 0; + this.lblExperimental.Text = "EXPERIMENTAL"; + this.lblExperimental.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // chkUseSQLServer + // + this.chkUseSQLServer._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER; + this.chkUseSQLServer.AutoSize = true; + this.chkUseSQLServer.Location = new System.Drawing.Point(3, 76); + this.chkUseSQLServer.Name = "chkUseSQLServer"; + this.chkUseSQLServer.Size = new System.Drawing.Size(234, 17); + this.chkUseSQLServer.TabIndex = 2; + this.chkUseSQLServer.Text = "Use SQL Server to load && save connections"; + this.chkUseSQLServer.UseVisualStyleBackColor = true; + this.chkUseSQLServer.CheckedChanged += new System.EventHandler(this.chkUseSQLServer_CheckedChanged); + // + // lblSQLUsername + // + this.lblSQLUsername.Enabled = false; + this.lblSQLUsername.Location = new System.Drawing.Point(23, 158); + this.lblSQLUsername.Name = "lblSQLUsername"; + this.lblSQLUsername.Size = new System.Drawing.Size(111, 13); + this.lblSQLUsername.TabIndex = 7; + this.lblSQLUsername.Text = "Username:"; + this.lblSQLUsername.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtSQLPassword + // + this.txtSQLPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtSQLPassword.Enabled = false; + this.txtSQLPassword.Location = new System.Drawing.Point(140, 182); + this.txtSQLPassword.Name = "txtSQLPassword"; + this.txtSQLPassword.Size = new System.Drawing.Size(153, 20); + this.txtSQLPassword.TabIndex = 10; + this.txtSQLPassword.UseSystemPasswordChar = true; + // + // lblSQLInfo + // + this.lblSQLInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblSQLInfo.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.World); - this.lblSQLInfo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.lblSQLInfo.Location = new System.Drawing.Point(3, 25); - this.lblSQLInfo.Name = "lblSQLInfo"; - this.lblSQLInfo.Size = new System.Drawing.Size(596, 25); - this.lblSQLInfo.TabIndex = 1; - this.lblSQLInfo.Text = "Please see Help - Getting started - SQL Configuration for more Info!"; - this.lblSQLInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblSQLServer - // - this.lblSQLServer.Enabled = false; - this.lblSQLServer.Location = new System.Drawing.Point(23, 106); - this.lblSQLServer.Name = "lblSQLServer"; - this.lblSQLServer.Size = new System.Drawing.Size(111, 13); - this.lblSQLServer.TabIndex = 3; - this.lblSQLServer.Text = "SQL Server:"; - this.lblSQLServer.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // txtSQLUsername - // - this.txtSQLUsername.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtSQLUsername.Enabled = false; - this.txtSQLUsername.Location = new System.Drawing.Point(140, 156); - this.txtSQLUsername.Name = "txtSQLUsername"; - this.txtSQLUsername.Size = new System.Drawing.Size(153, 20); - this.txtSQLUsername.TabIndex = 8; - // - // txtSQLServer - // - this.txtSQLServer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtSQLServer.Enabled = false; - this.txtSQLServer.Location = new System.Drawing.Point(140, 103); - this.txtSQLServer.Name = "txtSQLServer"; - this.txtSQLServer.Size = new System.Drawing.Size(153, 20); - this.txtSQLServer.TabIndex = 4; - // - // lblSQLPassword - // - this.lblSQLPassword.Enabled = false; - this.lblSQLPassword.Location = new System.Drawing.Point(23, 184); - this.lblSQLPassword.Name = "lblSQLPassword"; - this.lblSQLPassword.Size = new System.Drawing.Size(111, 13); - this.lblSQLPassword.TabIndex = 9; - this.lblSQLPassword.Text = "Password:"; - this.lblSQLPassword.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // btnTestConnection - // - this.btnTestConnection._mice = mRemoteNG.UI.Controls.Base.NGButton.MouseState.HOVER; - this.btnTestConnection.Enabled = false; - this.btnTestConnection.Location = new System.Drawing.Point(140, 208); - this.btnTestConnection.Name = "btnTestConnection"; - this.btnTestConnection.Size = new System.Drawing.Size(153, 23); - this.btnTestConnection.TabIndex = 11; - this.btnTestConnection.Text = "Test Connection"; - this.btnTestConnection.UseVisualStyleBackColor = true; - this.btnTestConnection.Click += new System.EventHandler(this.btnTestConnection_Click); - // - // imgConnectionStatus - // - this.imgConnectionStatus.Image = global::mRemoteNG.Resources.Help; - this.imgConnectionStatus.Location = new System.Drawing.Point(299, 212); - this.imgConnectionStatus.Name = "imgConnectionStatus"; - this.imgConnectionStatus.Size = new System.Drawing.Size(16, 16); - this.imgConnectionStatus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.imgConnectionStatus.TabIndex = 12; - this.imgConnectionStatus.TabStop = false; - // - // lblTestConnectionResults - // - this.lblTestConnectionResults.AutoSize = true; - this.lblTestConnectionResults.Location = new System.Drawing.Point(140, 238); - this.lblTestConnectionResults.Name = "lblTestConnectionResults"; - this.lblTestConnectionResults.Size = new System.Drawing.Size(0, 13); - this.lblTestConnectionResults.TabIndex = 13; - // - // SqlServerPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.lblTestConnectionResults); - this.Controls.Add(this.imgConnectionStatus); - this.Controls.Add(this.btnTestConnection); - this.Controls.Add(this.lblSQLDatabaseName); - this.Controls.Add(this.txtSQLDatabaseName); - this.Controls.Add(this.lblExperimental); - this.Controls.Add(this.chkUseSQLServer); - this.Controls.Add(this.lblSQLUsername); - this.Controls.Add(this.txtSQLPassword); - this.Controls.Add(this.lblSQLInfo); - this.Controls.Add(this.lblSQLServer); - this.Controls.Add(this.txtSQLUsername); - this.Controls.Add(this.txtSQLServer); - this.Controls.Add(this.lblSQLPassword); - this.Name = "SqlServerPage"; - this.PageIcon = ((System.Drawing.Icon)(resources.GetObject("$this.PageIcon"))); - this.Size = new System.Drawing.Size(610, 489); - ((System.ComponentModel.ISupportInitialize)(this.imgConnectionStatus)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.lblSQLInfo.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.World); + this.lblSQLInfo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.lblSQLInfo.Location = new System.Drawing.Point(3, 25); + this.lblSQLInfo.Name = "lblSQLInfo"; + this.lblSQLInfo.Size = new System.Drawing.Size(596, 25); + this.lblSQLInfo.TabIndex = 1; + this.lblSQLInfo.Text = "Please see Help - Getting started - SQL Configuration for more Info!"; + this.lblSQLInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblSQLServer + // + this.lblSQLServer.Enabled = false; + this.lblSQLServer.Location = new System.Drawing.Point(23, 106); + this.lblSQLServer.Name = "lblSQLServer"; + this.lblSQLServer.Size = new System.Drawing.Size(111, 13); + this.lblSQLServer.TabIndex = 3; + this.lblSQLServer.Text = "SQL Server:"; + this.lblSQLServer.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtSQLUsername + // + this.txtSQLUsername.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtSQLUsername.Enabled = false; + this.txtSQLUsername.Location = new System.Drawing.Point(140, 156); + this.txtSQLUsername.Name = "txtSQLUsername"; + this.txtSQLUsername.Size = new System.Drawing.Size(153, 20); + this.txtSQLUsername.TabIndex = 8; + // + // txtSQLServer + // + this.txtSQLServer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtSQLServer.Enabled = false; + this.txtSQLServer.Location = new System.Drawing.Point(140, 103); + this.txtSQLServer.Name = "txtSQLServer"; + this.txtSQLServer.Size = new System.Drawing.Size(153, 20); + this.txtSQLServer.TabIndex = 4; + // + // lblSQLPassword + // + this.lblSQLPassword.Enabled = false; + this.lblSQLPassword.Location = new System.Drawing.Point(23, 184); + this.lblSQLPassword.Name = "lblSQLPassword"; + this.lblSQLPassword.Size = new System.Drawing.Size(111, 13); + this.lblSQLPassword.TabIndex = 9; + this.lblSQLPassword.Text = "Password:"; + this.lblSQLPassword.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // btnTestConnection + // + this.btnTestConnection._mice = mRemoteNG.UI.Controls.Base.NGButton.MouseState.HOVER; + this.btnTestConnection.Enabled = false; + this.btnTestConnection.Location = new System.Drawing.Point(140, 228); + this.btnTestConnection.Name = "btnTestConnection"; + this.btnTestConnection.Size = new System.Drawing.Size(153, 23); + this.btnTestConnection.TabIndex = 11; + this.btnTestConnection.Text = "Test Connection"; + this.btnTestConnection.UseVisualStyleBackColor = true; + this.btnTestConnection.Click += new System.EventHandler(this.btnTestConnection_Click); + // + // imgConnectionStatus + // + this.imgConnectionStatus.Image = global::mRemoteNG.Resources.Help; + this.imgConnectionStatus.Location = new System.Drawing.Point(297, 231); + this.imgConnectionStatus.Name = "imgConnectionStatus"; + this.imgConnectionStatus.Size = new System.Drawing.Size(16, 16); + this.imgConnectionStatus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.imgConnectionStatus.TabIndex = 12; + this.imgConnectionStatus.TabStop = false; + // + // lblTestConnectionResults + // + this.lblTestConnectionResults.AutoSize = true; + this.lblTestConnectionResults.Location = new System.Drawing.Point(137, 254); + this.lblTestConnectionResults.Name = "lblTestConnectionResults"; + this.lblTestConnectionResults.Size = new System.Drawing.Size(117, 13); + this.lblTestConnectionResults.TabIndex = 13; + this.lblTestConnectionResults.Text = "Test connection details"; + // + // chkSQLReadOnly + // + this.chkSQLReadOnly._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER; + this.chkSQLReadOnly.AutoSize = true; + this.chkSQLReadOnly.Location = new System.Drawing.Point(140, 208); + this.chkSQLReadOnly.Name = "chkSQLReadOnly"; + this.chkSQLReadOnly.Size = new System.Drawing.Size(15, 14); + this.chkSQLReadOnly.TabIndex = 14; + this.chkSQLReadOnly.UseVisualStyleBackColor = true; + // + // lblSQLReadOnly + // + this.lblSQLReadOnly.Enabled = false; + this.lblSQLReadOnly.Location = new System.Drawing.Point(23, 208); + this.lblSQLReadOnly.Name = "lblSQLReadOnly"; + this.lblSQLReadOnly.Size = new System.Drawing.Size(111, 13); + this.lblSQLReadOnly.TabIndex = 15; + this.lblSQLReadOnly.Text = "Read Only:"; + this.lblSQLReadOnly.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // SqlServerPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lblSQLReadOnly); + this.Controls.Add(this.chkSQLReadOnly); + this.Controls.Add(this.lblTestConnectionResults); + this.Controls.Add(this.imgConnectionStatus); + this.Controls.Add(this.btnTestConnection); + this.Controls.Add(this.lblSQLDatabaseName); + this.Controls.Add(this.txtSQLDatabaseName); + this.Controls.Add(this.lblExperimental); + this.Controls.Add(this.chkUseSQLServer); + this.Controls.Add(this.lblSQLUsername); + this.Controls.Add(this.txtSQLPassword); + this.Controls.Add(this.lblSQLInfo); + this.Controls.Add(this.lblSQLServer); + this.Controls.Add(this.txtSQLUsername); + this.Controls.Add(this.txtSQLServer); + this.Controls.Add(this.lblSQLPassword); + this.Name = "SqlServerPage"; + this.PageIcon = ((System.Drawing.Icon)(resources.GetObject("$this.PageIcon"))); + this.Size = new System.Drawing.Size(610, 489); + ((System.ComponentModel.ISupportInitialize)(this.imgConnectionStatus)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } internal Controls.Base.NGLabel lblSQLDatabaseName; @@ -233,5 +258,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages private System.Windows.Forms.PictureBox imgConnectionStatus; private System.ComponentModel.IContainer components; private Controls.Base.NGLabel lblTestConnectionResults; + private Controls.Base.NGCheckBox chkSQLReadOnly; + internal Controls.Base.NGLabel lblSQLReadOnly; } } diff --git a/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.cs b/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.cs index 80cd6700..4be316f2 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.cs @@ -7,9 +7,9 @@ using mRemoteNG.Security.SymmetricEncryption; namespace mRemoteNG.UI.Forms.OptionsPages { - public partial class SqlServerPage + public partial class SqlServerPage { - private SqlDatabaseConnectionTester _databaseConnectionTester; + private readonly SqlDatabaseConnectionTester _databaseConnectionTester; public SqlServerPage() { @@ -36,6 +36,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages lblSQLDatabaseName.Text = Language.strLabelSQLServerDatabaseName; lblSQLUsername.Text = Language.strLabelUsername; lblSQLPassword.Text = Language.strLabelPassword; + lblSQLReadOnly.Text = Language.strLabelReadOnly; btnTestConnection.Text = Language.TestConnection; } @@ -49,6 +50,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages txtSQLUsername.Text = Settings.Default.SQLUser; var cryptographyProvider = new LegacyRijndaelCryptographyProvider(); txtSQLPassword.Text = cryptographyProvider.Decrypt(Settings.Default.SQLPass, Runtime.EncryptionKey); + chkSQLReadOnly.Checked = Settings.Default.SQLReadOnly; + lblTestConnectionResults.Text = ""; } public override void SaveSettings() @@ -62,6 +65,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages Settings.Default.SQLUser = txtSQLUsername.Text; var cryptographyProvider = new LegacyRijndaelCryptographyProvider(); Settings.Default.SQLPass = cryptographyProvider.Encrypt(txtSQLPassword.Text, Runtime.EncryptionKey); + Settings.Default.SQLReadOnly = chkSQLReadOnly.Checked; if (Settings.Default.UseSQLServer) ReinitializeSqlUpdater(); @@ -87,15 +91,22 @@ namespace mRemoteNG.UI.Forms.OptionsPages private void chkUseSQLServer_CheckedChanged(object sender, EventArgs e) { - lblSQLServer.Enabled = chkUseSQLServer.Checked; - lblSQLDatabaseName.Enabled = chkUseSQLServer.Checked; - lblSQLUsername.Enabled = chkUseSQLServer.Checked; - lblSQLPassword.Enabled = chkUseSQLServer.Checked; - txtSQLServer.Enabled = chkUseSQLServer.Checked; - txtSQLDatabaseName.Enabled = chkUseSQLServer.Checked; - txtSQLUsername.Enabled = chkUseSQLServer.Checked; - txtSQLPassword.Enabled = chkUseSQLServer.Checked; - btnTestConnection.Enabled = chkUseSQLServer.Checked; + toggleSQLPageControls(chkUseSQLServer.Checked); + } + + private void toggleSQLPageControls(bool useSQLServer) + { + lblSQLServer.Enabled = useSQLServer; + lblSQLDatabaseName.Enabled = useSQLServer; + lblSQLUsername.Enabled = useSQLServer; + lblSQLPassword.Enabled = useSQLServer; + lblSQLReadOnly.Enabled = useSQLServer; + txtSQLServer.Enabled = useSQLServer; + txtSQLDatabaseName.Enabled = useSQLServer; + txtSQLUsername.Enabled = useSQLServer; + txtSQLPassword.Enabled = useSQLServer; + chkSQLReadOnly.Enabled = useSQLServer; + btnTestConnection.Enabled = useSQLServer; } private async void btnTestConnection_Click(object sender, EventArgs e) diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 64532b5f..22197ec8 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -151,6 +151,7 @@ namespace mRemoteNG.UI.Forms LockToolbarPositions(Settings.Default.LockToolbars); Settings.Default.PropertyChanged += OnApplicationSettingChanged; + _themeManager.ThemeChanged += ApplyTheme; _fpChainedWindowHandle = NativeMethods.SetClipboardViewer(Handle); diff --git a/mRemoteV1/UI/Menu/ViewMenu.cs b/mRemoteV1/UI/Menu/ViewMenu.cs index c40c5ffb..26325f05 100644 --- a/mRemoteV1/UI/Menu/ViewMenu.cs +++ b/mRemoteV1/UI/Menu/ViewMenu.cs @@ -26,6 +26,7 @@ namespace mRemoteNG.UI.Menu private ToolStripMenuItem _mMenViewJumpToConnectionsConfig; private ToolStripMenuItem _mMenViewJumpToErrorsInfos; private ToolStripMenuItem _mMenViewResetLayout; + private ToolStripMenuItem _mMenViewLockToolbars; private ToolStripSeparator _toolStripSeparator1; private readonly PanelAdder _panelAdder; @@ -57,6 +58,7 @@ namespace mRemoteNG.UI.Menu _mMenViewJumpToConnectionsConfig = new ToolStripMenuItem(); _mMenViewJumpToErrorsInfos = new ToolStripMenuItem(); _mMenViewResetLayout = new ToolStripMenuItem(); + _mMenViewLockToolbars = new ToolStripMenuItem(); _mMenViewSep2 = new ToolStripSeparator(); _mMenViewQuickConnectToolbar = new ToolStripMenuItem(); _mMenViewExtAppsToolbar = new ToolStripMenuItem(); @@ -79,6 +81,7 @@ namespace mRemoteNG.UI.Menu _toolStripSeparator1, _mMenViewJumpTo, _mMenViewResetLayout, + _mMenViewLockToolbars, _mMenViewSep2, _mMenViewQuickConnectToolbar, _mMenViewExtAppsToolbar, @@ -190,10 +193,18 @@ namespace mRemoteNG.UI.Menu _mMenViewResetLayout.Size = new System.Drawing.Size(228, 22); _mMenViewResetLayout.Text = "Reset Layout"; _mMenViewResetLayout.Click += mMenViewResetLayout_Click; - // - // mMenViewSep2 - // - _mMenViewSep2.Name = "mMenViewSep2"; + // + // mMenViewLockToolbars + // + _mMenViewLockToolbars.Image = Resources.application_side_tree; + _mMenViewLockToolbars.Name = "mMenViewLockToolbars"; + _mMenViewLockToolbars.Size = new System.Drawing.Size(228, 22); + _mMenViewLockToolbars.Text = "Lock Toolbar Positions"; + _mMenViewLockToolbars.Click += mMenViewLockToolbars_Click; + // + // mMenViewSep2 + // + _mMenViewSep2.Name = "mMenViewSep2"; _mMenViewSep2.Size = new System.Drawing.Size(225, 6); // // mMenViewQuickConnectToolbar @@ -236,7 +247,9 @@ namespace mRemoteNG.UI.Menu _mMenViewFullscreen.Click += mMenViewFullscreen_Click; } - private void ApplyLanguage() + + + private void ApplyLanguage() { _mMenViewAddConnectionPanel.Text = Language.strMenuAddConnectionPanel; _mMenViewConnectionPanels.Text = Language.strMenuConnectionPanels; @@ -260,6 +273,7 @@ namespace mRemoteNG.UI.Menu _mMenViewConfig.Checked = !Windows.ConfigForm.IsHidden; _mMenViewErrorsAndInfos.Checked = !Windows.ErrorsForm.IsHidden; _mMenViewScreenshotManager.Checked = !Windows.ScreenshotForm.IsHidden; + _mMenViewLockToolbars.Checked = Settings.Default.LockToolbars; _mMenViewExtAppsToolbar.Checked = TsExternalTools.Visible; _mMenViewQuickConnectToolbar.Checked = TsQuickConnect.Visible; @@ -367,7 +381,21 @@ namespace mRemoteNG.UI.Menu } } - private void mMenViewAddConnectionPanel_Click(object sender, EventArgs e) + private void mMenViewLockToolbars_Click(object sender, EventArgs eventArgs) + { + if (Settings.Default.LockToolbars) + { + Settings.Default.LockToolbars = false; + _mMenViewLockToolbars.Checked = false; + } + else + { + Settings.Default.LockToolbars = true; + _mMenViewLockToolbars.Checked = true; + } + } + + private void mMenViewAddConnectionPanel_Click(object sender, EventArgs e) { _panelAdder.AddPanel(); } diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index d0a24838..302e1567 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -234,6 +234,7 @@ +