mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
[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:
@@ -91,8 +91,8 @@
|
||||
<InfoBar
|
||||
x:Uid="GPO_SettingIsManaged"
|
||||
IsClosable="False"
|
||||
IsOpen="{x:Bind ViewModel.ClipboardHistoryDisabledByGPO, Mode=OneWay}"
|
||||
IsTabStop="{x:Bind ViewModel.ClipboardHistoryDisabledByGPO, Mode=OneWay}"
|
||||
IsOpen="{x:Bind ViewModel.ShowClipboardHistoryIsGpoConfiguredInfoBar, Mode=OneWay}"
|
||||
IsTabStop="{x:Bind ViewModel.ShowClipboardHistoryIsGpoConfiguredInfoBar, Mode=OneWay}"
|
||||
Severity="Informational" />
|
||||
</controls:SettingsGroup>
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user