mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
add warning (#25098)
This commit is contained in:
@@ -3116,4 +3116,7 @@ Activate by holding the key for the character you want to add an accent to, then
|
|||||||
<data name="RegistryPreview_LaunchButtonControl.Header" xml:space="preserve">
|
<data name="RegistryPreview_LaunchButtonControl.Header" xml:space="preserve">
|
||||||
<value>Launch Registry Preview</value>
|
<value>Launch Registry Preview</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="PastePlain_ShortcutWarning.Title" xml:space="preserve">
|
||||||
|
<value>Using this shortcut may prevent non-text paste actions (e.g. images, files) or built-in paste plain text actions in other applications from functioning.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -128,6 +128,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
{
|
{
|
||||||
_pastePlainSettings.Properties.ActivationShortcut = value;
|
_pastePlainSettings.Properties.ActivationShortcut = value;
|
||||||
OnPropertyChanged(nameof(ActivationShortcut));
|
OnPropertyChanged(nameof(ActivationShortcut));
|
||||||
|
OnPropertyChanged(nameof(IsConflictingCopyShortcut));
|
||||||
|
|
||||||
_settingsUtils.SaveSettings(_pastePlainSettings.ToJsonString(), PastePlainSettings.ModuleName);
|
_settingsUtils.SaveSettings(_pastePlainSettings.ToJsonString(), PastePlainSettings.ModuleName);
|
||||||
NotifySettingsChanged();
|
NotifySettingsChanged();
|
||||||
@@ -135,6 +136,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsConflictingCopyShortcut
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ActivationShortcut.ToString() == "Ctrl + V" || ActivationShortcut.ToString() == "Ctrl + Shift + V";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ScheduleSavingOfSettings()
|
private void ScheduleSavingOfSettings()
|
||||||
{
|
{
|
||||||
lock (_delayedActionLock)
|
lock (_delayedActionLock)
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||||
HotkeySettings="{x:Bind Path=ViewModel.ActivationShortcut, Mode=TwoWay}" />
|
HotkeySettings="{x:Bind Path=ViewModel.ActivationShortcut, Mode=TwoWay}" />
|
||||||
</labs:SettingsCard>
|
</labs:SettingsCard>
|
||||||
|
<InfoBar
|
||||||
|
x:Uid="PastePlain_ShortcutWarning"
|
||||||
|
IsClosable="False"
|
||||||
|
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.IsConflictingCopyShortcut}"
|
||||||
|
IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.IsConflictingCopyShortcut}"
|
||||||
|
Severity="Warning" />
|
||||||
</controls:SettingsGroup>
|
</controls:SettingsGroup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</controls:SettingsPageControl.ModuleContent>
|
</controls:SettingsPageControl.ModuleContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user