mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PTRun][Enterprise]GPO for plugin enabled state (#27468)
* try code for gpo with pluginID param * fix typo * fixes * update admx * Add second policy to admx * spelling fixes * admx clean up * add gpo code * small fixes * fixes * fix cast * update settings code * bug fixes * fix plugins disabled warning * Info bar in settings * settings ui fixes * code clean up * fix spelling * fix spelling * code optimization * changes * fix code * switch to char* * update comments * validate plugin ID * spell fixes * spell fixes * fix IPlugin interface * Update Directory.Packages.props hopefully fixes unit tests * revert change of nuget pkg * fixes * fix spell check * add todo comment * improve gpo.h * improve gpo.h * update gpo.h * clean up code in gpo.h * fix build * try to fix build * xaml fix * Fix getting string value from the registry * communicate policy state suing settings.json * various changes and gpo docs * spell fixes * PT Run: Policy handling * spell fix * fix logging * fix admx revision * revision fix 2 * review feedback 1 * review feedback 2 * dev docs update * fix typo
This commit is contained in:
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows.Input;
|
||||
using Common.UI;
|
||||
using global::PowerToys.GPOWrapper;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using PowerLauncher.Helper;
|
||||
using PowerLauncher.Plugin;
|
||||
@@ -242,6 +243,7 @@ namespace PowerLauncher
|
||||
IconPathDark = GetIcon(x.Metadata, x.Metadata.IcoPathDark),
|
||||
IconPathLight = GetIcon(x.Metadata, x.Metadata.IcoPathLight),
|
||||
AdditionalOptions = x.Plugin is ISettingProvider ? (x.Plugin as ISettingProvider).AdditionalOptions : new List<PluginAdditionalOption>(),
|
||||
EnabledPolicyUiState = (int)GpoRuleConfigured.NotConfigured,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -256,11 +258,13 @@ namespace PowerLauncher
|
||||
if (defaultPlugins.ContainsKey(plugin.Id))
|
||||
{
|
||||
var additionalOptions = CombineAdditionalOptions(defaultPlugins[plugin.Id].AdditionalOptions, plugin.AdditionalOptions);
|
||||
var enabledPolicyState = GPOWrapper.GetRunPluginEnabledValue(plugin.Id);
|
||||
plugin.Name = defaultPlugins[plugin.Id].Name;
|
||||
plugin.Description = defaultPlugins[plugin.Id].Description;
|
||||
plugin.Author = defaultPlugins[plugin.Id].Author;
|
||||
plugin.IconPathDark = defaultPlugins[plugin.Id].IconPathDark;
|
||||
plugin.IconPathLight = defaultPlugins[plugin.Id].IconPathLight;
|
||||
plugin.EnabledPolicyUiState = (int)enabledPolicyState;
|
||||
defaultPlugins[plugin.Id] = plugin;
|
||||
defaultPlugins[plugin.Id].AdditionalOptions = additionalOptions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user