mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-23 06:59:39 +01:00
[GPO]Add setting to disallow experimentation (#24131)
* [GPO]Add policy to disallow experimentation * Refresh experimentation setting UI * Reflect gpo value in Settings UI * Fix adml errors * Update src/settings-ui/Settings.UI/Strings/en-us/Resources.resw * Update src/settings-ui/Settings.UI/Strings/en-us/Resources.resw * Update src/gpo/assets/en-US/PowerToys.adml * Small grammar fixes * Update src/gpo/assets/en-US/PowerToys.adml --------- Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
This commit is contained in:
@@ -12,6 +12,7 @@ using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using global::PowerToys.GPOWrapper;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
||||
@@ -140,6 +141,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
_newAvailableVersionLink = UpdatingSettingsConfig.ReleasePageLink;
|
||||
_updateCheckedDate = UpdatingSettingsConfig.LastCheckedDateLocalized;
|
||||
|
||||
_experimentationIsGpoDisallowed = GPOWrapper.GetAllowExperimentationValue() == GpoRuleConfigured.Disabled;
|
||||
|
||||
if (dispatcherAction != null)
|
||||
{
|
||||
_fileWatcher = Helper.GetFileWatcher(string.Empty, UpdatingSettings.SettingsFile, dispatcherAction);
|
||||
@@ -154,6 +157,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
|
||||
private bool _autoDownloadUpdates;
|
||||
private bool _enableExperimentation;
|
||||
private bool _experimentationIsGpoDisallowed;
|
||||
|
||||
private UpdatingSettings.UpdatingState _updatingState = UpdatingSettings.UpdatingState.UpToDate;
|
||||
private string _newAvailableVersion = string.Empty;
|
||||
@@ -290,7 +294,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
{
|
||||
get
|
||||
{
|
||||
return _enableExperimentation;
|
||||
return _enableExperimentation && !_experimentationIsGpoDisallowed;
|
||||
}
|
||||
|
||||
set
|
||||
@@ -304,6 +308,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsExperimentationGpoDisallowed
|
||||
{
|
||||
get => _experimentationIsGpoDisallowed;
|
||||
}
|
||||
|
||||
public static bool AutoUpdatesEnabled
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user