[Settings][Plugin manager] Activation commands: Fix conflict with calc plugin and add warning (#19593)

* update activation commands

* add warning and badges

* fix spelling

* fix badge style

* fixes

* small fixes missed

* spell fix

* revert changes for Program plugin

* small tweaks

* Add Grid control

* merge warnings

* fix spelling

* fix resource

* updating conflicitng keywords

* remove keywordWarning and warningBagde

* fix broken reference

* add new information bar
This commit is contained in:
Heiko
2022-08-23 22:28:41 +02:00
committed by GitHub
parent 4c796c0b53
commit c85305695e
5 changed files with 35 additions and 24 deletions

View File

@@ -56,10 +56,10 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
settings.Disabled = value;
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(ShowNotAccessibleWarning));
NotifyPropertyChanged(nameof(ShowNotAllowedKeywordWarning));
NotifyPropertyChanged(nameof(Enabled));
NotifyPropertyChanged(nameof(DisabledOpacity));
NotifyPropertyChanged(nameof(IsGlobalAndEnabled));
NotifyPropertyChanged(nameof(ShowBadgeOnPluginSettingError));
}
}
}
@@ -91,6 +91,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(ShowNotAccessibleWarning));
NotifyPropertyChanged(nameof(IsGlobalAndEnabled));
NotifyPropertyChanged(nameof(ShowBadgeOnPluginSettingError));
}
}
}
@@ -108,8 +109,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
{
settings.WeightBoost = value;
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(ShowNotAccessibleWarning));
NotifyPropertyChanged(nameof(ShowNotAllowedKeywordWarning));
}
}
}
@@ -128,7 +127,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
settings.ActionKeyword = value;
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(ShowNotAccessibleWarning));
NotifyPropertyChanged(nameof(ShowNotAllowedKeywordWarning));
NotifyPropertyChanged(nameof(ShowBadgeOnPluginSettingError));
}
}
}
@@ -180,14 +179,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
get => !Disabled && !IsGlobal && string.IsNullOrWhiteSpace(ActionKeyword);
}
private static readonly List<string> NotAllowedKeywords = new List<string>()
public bool ShowBadgeOnPluginSettingError
{
"~", @"\", @"\\",
};
public bool ShowNotAllowedKeywordWarning
{
get => !Disabled && NotAllowedKeywords.Contains(ActionKeyword);
get => !Disabled && ShowNotAccessibleWarning;
}
}
}

View File

@@ -101,7 +101,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
{
if (
e.PropertyName == nameof(PowerLauncherPluginViewModel.ShowNotAccessibleWarning)
|| e.PropertyName == nameof(PowerLauncherPluginViewModel.ShowNotAllowedKeywordWarning)
|| e.PropertyName == nameof(PowerLauncherPluginViewModel.ShowBadgeOnPluginSettingError)
)
{
// Don't trigger a settings update if the changed property is for visual notification.