[Updates] Toast notification for new updates: Add setting (#30794)

* code changes from #30606

* Update admx revision
This commit is contained in:
Heiko
2024-01-19 16:18:05 +01:00
committed by GitHub
parent f971f3d968
commit d7c7711518
13 changed files with 100 additions and 5 deletions

View File

@@ -121,6 +121,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
_startup = GeneralSettingsConfig.Startup;
_showNewUpdatesToastNotification = GeneralSettingsConfig.ShowNewUpdatesToastNotification;
_autoDownloadUpdates = GeneralSettingsConfig.AutoDownloadUpdates;
_showWhatsNewAfterUpdates = GeneralSettingsConfig.ShowWhatsNewAfterUpdates;
_enableExperimentation = GeneralSettingsConfig.EnableExperimentation;
@@ -139,8 +140,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_newAvailableVersionLink = UpdatingSettingsConfig.ReleasePageLink;
_updateCheckedDate = UpdatingSettingsConfig.LastCheckedDateLocalized;
_experimentationIsGpoDisallowed = GPOWrapper.GetAllowExperimentationValue() == GpoRuleConfigured.Disabled;
_newUpdatesToastIsGpoDisabled = GPOWrapper.GetDisableNewUpdateToastValue() == GpoRuleConfigured.Enabled;
_autoDownloadUpdatesIsGpoDisabled = GPOWrapper.GetDisableAutomaticUpdateDownloadValue() == GpoRuleConfigured.Enabled;
_experimentationIsGpoDisallowed = GPOWrapper.GetAllowExperimentationValue() == GpoRuleConfigured.Disabled;
_showWhatsNewAfterUpdatesIsGpoDisabled = GPOWrapper.GetDisableShowWhatsNewAfterUpdatesValue() == GpoRuleConfigured.Enabled;
if (dispatcherAction != null)
@@ -156,6 +158,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private bool _enableWarningsElevatedApps;
private int _themeIndex;
private bool _showNewUpdatesToastNotification;
private bool _newUpdatesToastIsGpoDisabled;
private bool _autoDownloadUpdates;
private bool _autoDownloadUpdatesIsGpoDisabled;
private bool _showWhatsNewAfterUpdates;
@@ -303,6 +307,29 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
public bool ShowNewUpdatesToastNotification
{
get
{
return _showNewUpdatesToastNotification && !_newUpdatesToastIsGpoDisabled;
}
set
{
if (_showNewUpdatesToastNotification != value)
{
_showNewUpdatesToastNotification = value;
GeneralSettingsConfig.ShowNewUpdatesToastNotification = value;
NotifyPropertyChanged();
}
}
}
public bool IsNewUpdatesToastDisabledGpoConfigured
{
get => _newUpdatesToastIsGpoDisabled;
}
public bool AutoDownloadUpdates
{
get