mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[MWB][Enterprise] Add new policies and improve settings UI for the Transfer File setting (#33571)
## Summary of the Pull Request ### Improve settings page for TransferFile setting The TransferFile setting depends on ShareClipboard setting. This is now visually shown. **Before the change:**  **After the change**  ### New policies are added for MWB Name | Supported states | Id | Behavior ------------ | ------------- | ------------ | ------------- Clipboard sharing enabled | disabled | MwbClipboardSharingEnabled | Disables the feature if set to disabled. File transfer enabled | disabled | MwbFileTransferEnabled | Disables the feature if set to disabled. Original user interface enabled | disabled | MwbUseOriginalUserInterface | Disables the feature if set to disabled. | Disallow blocking screensaver on other machines | enabled | MwbDisallowBlockingScreensaver | Disables the feature if set to enabled. | Connect only in same subnet | enabled & disabled | MwbSameSubnetOnly | Enables the feature if set to enabled.<br />Disables the feature if set to disabled. | Validate remote machine IP Address | enabled & disabled | MwbValidateRemoteIp | Enables the feature if set to enabled.<br />Disables the feature if set to disabled. Disable user defined IP Address mapping rules | enabled | MwbDisableUserDefinedIpMappingRules | If enabled the user can't define IP Address mapping rules. Predefined IP Address mappings | enabled with multi-line text value | MwbPolicyDefinedIpMappingRules | Allows admins to force define IP Address mapping rules. #### User Interface screenshots   
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using Windows.UI.Notifications;
|
||||
|
||||
namespace MouseWithoutBorders
|
||||
{
|
||||
@@ -88,6 +89,8 @@ namespace MouseWithoutBorders
|
||||
this.linkLabelReConfigure = new System.Windows.Forms.LinkLabel();
|
||||
this.tabControlSetting = new System.Windows.Forms.TabControl();
|
||||
this.tabPageAdvancedSettings = new System.Windows.Forms.TabPage();
|
||||
this.groupBoxName2IPPolicyList = new System.Windows.Forms.GroupBox();
|
||||
this.textBoxMachineName2IPPolicyList = new System.Windows.Forms.TextBox();
|
||||
this.pictureBoxMouseWithoutBorders = new System.Windows.Forms.PictureBox();
|
||||
this.groupBoxDNS = new System.Windows.Forms.GroupBox();
|
||||
this.textBoxMachineName2IP = new System.Windows.Forms.TextBox();
|
||||
@@ -103,6 +106,7 @@ namespace MouseWithoutBorders
|
||||
this.groupBoxMachineMatrix.SuspendLayout();
|
||||
this.tabControlSetting.SuspendLayout();
|
||||
this.tabPageAdvancedSettings.SuspendLayout();
|
||||
this.groupBoxName2IPPolicyList.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMouseWithoutBorders)).BeginInit();
|
||||
this.groupBoxDNS.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -977,6 +981,7 @@ namespace MouseWithoutBorders
|
||||
// tabPageAdvancedSettings
|
||||
//
|
||||
this.tabPageAdvancedSettings.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(245)))), ((int)(((byte)(242)))));
|
||||
this.tabPageAdvancedSettings.Controls.Add(this.groupBoxName2IPPolicyList);
|
||||
this.tabPageAdvancedSettings.Controls.Add(this.pictureBoxMouseWithoutBorders);
|
||||
this.tabPageAdvancedSettings.Controls.Add(this.groupBoxDNS);
|
||||
this.tabPageAdvancedSettings.Controls.Add(this.textBoxDNS);
|
||||
@@ -986,6 +991,33 @@ namespace MouseWithoutBorders
|
||||
this.tabPageAdvancedSettings.Size = new System.Drawing.Size(563, 362);
|
||||
this.tabPageAdvancedSettings.TabIndex = 2;
|
||||
this.tabPageAdvancedSettings.Text = "IP Mappings";
|
||||
//
|
||||
// groupBoxName2IPPolicyList
|
||||
//
|
||||
this.groupBoxName2IPPolicyList.Controls.Add(this.textBoxMachineName2IPPolicyList);
|
||||
this.groupBoxName2IPPolicyList.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.groupBoxName2IPPolicyList.Location = new System.Drawing.Point(3, 241);
|
||||
this.groupBoxName2IPPolicyList.Name = "groupBoxName2IPPolicyList";
|
||||
this.groupBoxName2IPPolicyList.Size = new System.Drawing.Size(357, 150);
|
||||
this.groupBoxName2IPPolicyList.TabIndex = 1;
|
||||
this.groupBoxName2IPPolicyList.TabStop = false;
|
||||
this.groupBoxName2IPPolicyList.Text = " Policy defined machine name to IP address mappings [Managed]";
|
||||
this.groupBoxName2IPPolicyList.ForeColor = Color.DimGray;
|
||||
this.groupBoxName2IPPolicyList.Visible = false;
|
||||
//
|
||||
// textBoxMachineName2IPPolicyList
|
||||
//
|
||||
this.textBoxMachineName2IPPolicyList.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.textBoxMachineName2IPPolicyList.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBoxMachineName2IPPolicyList.Location = new System.Drawing.Point(3, 172); // 3,172
|
||||
this.textBoxMachineName2IPPolicyList.MaxLength = 1024;
|
||||
this.textBoxMachineName2IPPolicyList.Multiline = true;
|
||||
this.textBoxMachineName2IPPolicyList.Name = "textBoxMachineName2IPPolicyList";
|
||||
this.textBoxMachineName2IPPolicyList.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.textBoxMachineName2IPPolicyList.Size = new System.Drawing.Size(351, 131);
|
||||
this.textBoxMachineName2IPPolicyList.TabIndex = 1;
|
||||
this.textBoxMachineName2IPPolicyList.ReadOnly = true;
|
||||
this.textBoxMachineName2IPPolicyList.Visible = false;
|
||||
//
|
||||
// pictureBoxMouseWithoutBorders
|
||||
//
|
||||
@@ -1098,12 +1130,13 @@ namespace MouseWithoutBorders
|
||||
this.tabControlSetting.ResumeLayout(false);
|
||||
this.tabPageAdvancedSettings.ResumeLayout(false);
|
||||
this.tabPageAdvancedSettings.PerformLayout();
|
||||
this.groupBoxName2IPPolicyList.ResumeLayout(false);
|
||||
this.groupBoxName2IPPolicyList.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMouseWithoutBorders)).EndInit();
|
||||
this.groupBoxDNS.ResumeLayout(false);
|
||||
this.groupBoxDNS.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1140,6 +1173,8 @@ namespace MouseWithoutBorders
|
||||
private GroupBox groupBoxDNS;
|
||||
private TextBox textBoxDNS;
|
||||
private TextBox textBoxMachineName2IP;
|
||||
private GroupBox groupBoxName2IPPolicyList;
|
||||
private TextBox textBoxMachineName2IPPolicyList;
|
||||
private PictureBox pictureBoxMouseWithoutBorders;
|
||||
private GroupBox groupBoxOtherOptions;
|
||||
private CheckBox checkBoxDrawMouse;
|
||||
|
||||
@@ -853,6 +853,56 @@ namespace MouseWithoutBorders
|
||||
|
||||
comboBoxEasyMouse.Text = Setting.Values.HotKeyToggleEasyMouse == 0 ? "Disable" : new string(new char[] { (char)Setting.Values.HotKeyToggleEasyMouse });
|
||||
#endif
|
||||
|
||||
// Apply policy configuration on UI elements
|
||||
// Has to be the last action
|
||||
if (Setting.Values.ShareClipboardIsGpoConfigured)
|
||||
{
|
||||
checkBoxShareClipboard.Enabled = false;
|
||||
checkBoxShareClipboard.Text += " [Managed]";
|
||||
|
||||
// transfer file setting depends on clipboard sharing
|
||||
checkBoxTransferFile.Enabled = false;
|
||||
}
|
||||
|
||||
if (Setting.Values.TransferFileIsGpoConfigured)
|
||||
{
|
||||
checkBoxTransferFile.Enabled = false;
|
||||
checkBoxTransferFile.Text += " [Managed]";
|
||||
}
|
||||
|
||||
if (Setting.Values.BlockScreenSaverIsGpoConfigured)
|
||||
{
|
||||
checkBoxBlockScreenSaver.Enabled = false;
|
||||
checkBoxBlockScreenSaver.Text += " [Managed]";
|
||||
}
|
||||
|
||||
if (Setting.Values.SameSubNetOnlyIsGpoConfigured)
|
||||
{
|
||||
checkBoxSameSubNet.Enabled = false;
|
||||
checkBoxSameSubNet.Text += " [Managed]";
|
||||
}
|
||||
|
||||
if (Setting.Values.ReverseLookupIsGpoConfigured)
|
||||
{
|
||||
checkBoxReverseLookup.Enabled = false;
|
||||
checkBoxReverseLookup.Text += " [Managed]";
|
||||
}
|
||||
|
||||
if (Setting.Values.Name2IpIsGpoConfigured)
|
||||
{
|
||||
textBoxMachineName2IP.Enabled = false;
|
||||
groupBoxDNS.ForeColor = Color.DimGray;
|
||||
groupBoxDNS.Text += " [Managed]";
|
||||
}
|
||||
|
||||
if (Setting.Values.Name2IpPolicyListIsGpoConfigured)
|
||||
{
|
||||
pictureBoxMouseWithoutBorders.Visible = false;
|
||||
groupBoxName2IPPolicyList.Visible = true;
|
||||
textBoxMachineName2IPPolicyList.Visible = true;
|
||||
textBoxMachineName2IPPolicyList.Text = Setting.Values.Name2IpPolicyList;
|
||||
}
|
||||
}
|
||||
|
||||
private void RadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user