[Settings]Add setting and policy to disable Whats new after updates (#30609)

* add scoobe setting

* update comment

* fix spelling

* fix settings layout

* fix xaml formatting

* fix viewModel

* fix settings page

* fix general_settings.cpp

* Update policy name and description

* Update the settings name
This commit is contained in:
Heiko
2024-01-18 16:18:17 +01:00
committed by GitHub
parent d51dbbe11d
commit f07c2314a9
13 changed files with 100 additions and 7 deletions

View File

@@ -122,6 +122,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_startup = GeneralSettingsConfig.Startup;
_autoDownloadUpdates = GeneralSettingsConfig.AutoDownloadUpdates;
_showWhatsNewAfterUpdates = GeneralSettingsConfig.ShowWhatsNewAfterUpdates;
_enableExperimentation = GeneralSettingsConfig.EnableExperimentation;
_isElevated = isElevated;
@@ -140,6 +141,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_experimentationIsGpoDisallowed = GPOWrapper.GetAllowExperimentationValue() == GpoRuleConfigured.Disabled;
_autoDownloadUpdatesIsGpoDisabled = GPOWrapper.GetDisableAutomaticUpdateDownloadValue() == GpoRuleConfigured.Enabled;
_showWhatsNewAfterUpdatesIsGpoDisabled = GPOWrapper.GetDisableShowWhatsNewAfterUpdatesValue() == GpoRuleConfigured.Enabled;
if (dispatcherAction != null)
{
@@ -156,6 +158,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private bool _autoDownloadUpdates;
private bool _autoDownloadUpdatesIsGpoDisabled;
private bool _showWhatsNewAfterUpdates;
private bool _showWhatsNewAfterUpdatesIsGpoDisabled;
private bool _enableExperimentation;
private bool _experimentationIsGpoDisallowed;
@@ -329,6 +333,29 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
get => _isAdmin && _autoDownloadUpdatesIsGpoDisabled;
}
public bool ShowWhatsNewAfterUpdates
{
get
{
return _showWhatsNewAfterUpdates && !_showWhatsNewAfterUpdatesIsGpoDisabled;
}
set
{
if (_showWhatsNewAfterUpdates != value)
{
_showWhatsNewAfterUpdates = value;
GeneralSettingsConfig.ShowWhatsNewAfterUpdates = value;
NotifyPropertyChanged();
}
}
}
public bool ShowWhatsNewAfterUpdatesIsGpoDisabled
{
get => _showWhatsNewAfterUpdatesIsGpoDisabled;
}
public bool EnableExperimentation
{
get