[Settings][AdvPaste]Fix visible gpo infobars on disabled module (#33124)

* Update AdvancedPasteViewModel.cs

* Update AdvancedPasteViewModel.cs

* Update AdvancedPaste.xaml

* Update AdvancedPaste.xaml

* Update AdvancedPasteViewModel.cs

* Fix not updating infobar visibility
This commit is contained in:
Heiko
2024-06-08 22:56:01 +02:00
committed by GitHub
parent bf42abc328
commit 126a03e3b0
2 changed files with 12 additions and 3 deletions

View File

@@ -108,6 +108,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
_isEnabled = value;
OnPropertyChanged(nameof(IsEnabled));
OnPropertyChanged(nameof(ShowOnlineAIModelsGpoConfiguredInfoBar));
OnPropertyChanged(nameof(ShowClipboardHistoryIsGpoConfiguredInfoBar));
// Set the status of AdvancedPaste in the general settings
GeneralSettingsConfig.Enabled.AdvancedPaste = value;
@@ -149,7 +151,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
public bool ShowOnlineAIModelsGpoConfiguredInfoBar
{
get => _onlineAIModelsDisallowedByGPO && _enabledGpoRuleConfiguration != GpoRuleConfigured.Disabled;
get => _onlineAIModelsDisallowedByGPO && _isEnabled;
}
private bool IsClipboardHistoryEnabled()
@@ -216,6 +218,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
get => IsClipboardHistoryDisabledByGPO();
}
public bool ShowClipboardHistoryIsGpoConfiguredInfoBar
{
get => IsClipboardHistoryDisabledByGPO() && _isEnabled;
}
public HotkeySettings AdvancedPasteUIShortcut
{
get => _advancedPasteSettings.Properties.AdvancedPasteUIShortcut;
@@ -332,6 +339,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
InitializeEnabledValue();
OnPropertyChanged(nameof(IsEnabled));
OnPropertyChanged(nameof(ShowOnlineAIModelsGpoConfiguredInfoBar));
OnPropertyChanged(nameof(ShowClipboardHistoryIsGpoConfiguredInfoBar));
}
protected virtual void Dispose(bool disposing)