[PT Run] System commands plugin: Update dev docs and UnitTests (#15832)

* update UnitTests

* dev docs

* fix plugin name

* fix spelling

* fix path

* improvement

* fix table
This commit is contained in:
Heiko
2022-02-04 17:56:31 +01:00
committed by GitHub
parent 26e3eb9350
commit 314425e32e
6 changed files with 87 additions and 29 deletions

View File

@@ -34,6 +34,8 @@ namespace Microsoft.PowerToys.Run.Plugin.System
public string IconTheme { get; set; }
public bool IsBootedInUefiMode { get; set; }
public ICommand Command { get; set; }
public string Name => Resources.Microsoft_plugin_sys_plugin_name;
@@ -43,8 +45,6 @@ namespace Microsoft.PowerToys.Run.Plugin.System
private bool _confirmSystemCommands;
private bool _localizeSystemCommands;
private bool isBootedInUefiMode = NativeMethods.GetSystemFirmwareType() == NativeMethods.FirmwareTypes.Uefi;
public IEnumerable<PluginAdditionalOption> AdditionalOptions => new List<PluginAdditionalOption>()
{
new PluginAdditionalOption()
@@ -66,10 +66,11 @@ namespace Microsoft.PowerToys.Run.Plugin.System
_context = context;
_context.API.ThemeChanged += OnThemeChanged;
UpdateIconTheme(_context.API.GetCurrentTheme());
IsBootedInUefiMode = NativeMethods.GetSystemFirmwareType() == NativeMethods.FirmwareTypes.Uefi;
// Log info if the system hasn't boot in uefi mode.
// (Because this is only going into the log we can ignore the fact that normally UEFI and BIOS are written upper case. No need to convert the enumeration value to upper case.)
if (!isBootedInUefiMode)
if (!IsBootedInUefiMode)
{
Wox.Plugin.Logger.Log.Info($"The UEFI command will not show to the user. The system has not booted in UEFI mode or the system does not have an UEFI firmware! (Detected type: {NativeMethods.GetSystemFirmwareType()})", typeof(Main));
}
@@ -196,7 +197,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System
});
// UEFI command/result. It is only available on systems booted in UEFI mode.
if (isBootedInUefiMode)
if (IsBootedInUefiMode)
{
results.Add(new Result
{