mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 03:07:56 +01: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">
|
||||
<value>Launch Registry Preview</value>
|
||||
</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>
|
||||
@@ -128,6 +128,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
{
|
||||
_pastePlainSettings.Properties.ActivationShortcut = value;
|
||||
OnPropertyChanged(nameof(ActivationShortcut));
|
||||
OnPropertyChanged(nameof(IsConflictingCopyShortcut));
|
||||
|
||||
_settingsUtils.SaveSettings(_pastePlainSettings.ToJsonString(), PastePlainSettings.ModuleName);
|
||||
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()
|
||||
{
|
||||
lock (_delayedActionLock)
|
||||
|
||||
@@ -42,6 +42,12 @@
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
HotkeySettings="{x:Bind Path=ViewModel.ActivationShortcut, Mode=TwoWay}" />
|
||||
</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>
|
||||
</StackPanel>
|
||||
</controls:SettingsPageControl.ModuleContent>
|
||||
|
||||
Reference in New Issue
Block a user