mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-23 15:09:41 +01:00
[Updates] Toast notification for new updates: Add setting (#30794)
* code changes from #30606 * Update admx revision
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user