mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-19 15:03:36 +08:00
[MWB] add Name2IP field to Settings (#26290)
* [MWB] add Name2IP field to Settings * f: add explanation * f: spelling * f: comment
This commit is contained in:
parent
0bf4cfd8b5
commit
dbc11b8920
@ -370,6 +370,16 @@
|
||||
<data name="MouseWithoutBorders_SameSubnetOnly.Description" xml:space="preserve">
|
||||
<value>Only connect to machines in the same intranet NNN.NNN.*.* (only works when both machines have IPv4 enabled)</value>
|
||||
</data>
|
||||
<data name="MouseWithoutBorders_IPAddressMapping_TextBoxControl.PlaceholderText" xml:space="preserve">
|
||||
<value>Example: MyLaptop 192.168.0.24</value>
|
||||
<comment>Don't translate MyLaptop</comment>
|
||||
</data>
|
||||
<data name="MouseWithoutBorders_IPAddressMapping.Header" xml:space="preserve">
|
||||
<value>IP address mapping</value>
|
||||
</data>
|
||||
<data name="MouseWithoutBorders_IPAddressMapping.Description" xml:space="preserve">
|
||||
<value>Resolve machine's IP address using manually entered mappings below.</value>
|
||||
</data>
|
||||
<data name="MouseWithoutBorders_BlockScreenSaverOnOtherMachines.Description" xml:space="preserve">
|
||||
<value>Prevent screen saver from starting on other machines when user is actively working on this machine.</value>
|
||||
</data>
|
||||
@ -386,6 +396,9 @@
|
||||
<value>Keyboard shortcuts</value>
|
||||
<comment>keyboard is the hardware peripheral</comment>
|
||||
</data>
|
||||
<data name="MouseWithoutBorders_AdvancedSettings_Group.Header" xml:space="preserve">
|
||||
<value>Advanced Settings</value>
|
||||
</data>
|
||||
<data name="MouseWithoutBorders_EasyMouseOption.Header" xml:space="preserve">
|
||||
<value>Easy Mouse: move between machines by moving the mouse pointer to the screen edges.</value>
|
||||
</data>
|
||||
|
@ -736,6 +736,28 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public string Name2IP
|
||||
{
|
||||
// Due to https://github.com/microsoft/microsoft-ui-xaml/issues/1826, we must
|
||||
// add back \n chars on set and remove them on get for the widget
|
||||
// to make its behavior consistent with the old UI and MWB internal code.
|
||||
get
|
||||
{
|
||||
return Settings.Properties.Name2IP.Value.Replace("\r\n", "\r");
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
var newValue = value.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n");
|
||||
|
||||
if (Settings.Properties.Name2IP.Value != newValue)
|
||||
{
|
||||
Settings.Properties.Name2IP.Value = newValue;
|
||||
NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool SameSubnetOnly
|
||||
{
|
||||
get
|
||||
|
@ -386,6 +386,28 @@
|
||||
</ComboBox>
|
||||
</labs:SettingsCard>
|
||||
</controls:SettingsGroup>
|
||||
<controls:SettingsGroup
|
||||
x:Uid="MouseWithoutBorders_AdvancedSettings_Group"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
|
||||
<labs:SettingsExpander
|
||||
x:Uid="MouseWithoutBorders_IPAddressMapping"
|
||||
IsExpanded="True">
|
||||
<labs:SettingsExpander.Items>
|
||||
<labs:SettingsCard ContentAlignment="Vertical"
|
||||
HorizontalContentAlignment="Stretch">
|
||||
<TextBox
|
||||
x:Uid="MouseWithoutBorders_IPAddressMapping_TextBoxControl"
|
||||
MinWidth="240" MinHeight="160"
|
||||
AcceptsReturn="True"
|
||||
ScrollViewer.IsVerticalRailEnabled="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||
ScrollViewer.VerticalScrollMode="Enabled"
|
||||
Text="{x:Bind Mode=TwoWay, Path=ViewModel.Name2IP, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" />
|
||||
</labs:SettingsCard>
|
||||
</labs:SettingsExpander.Items>
|
||||
</labs:SettingsExpander>
|
||||
</controls:SettingsGroup>
|
||||
<controls:SettingsGroup x:Uid="MouseWithoutBorders_TroubleShooting" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
|
||||
<labs:SettingsCard
|
||||
x:Uid="MouseWithoutBorders_AddFirewallRuleButtonControl"
|
||||
|
Loading…
Reference in New Issue
Block a user