mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
[Powertoys Run] Add setting to confirm system commands (#12427)
* HTTPS by default, HTTP only if specified * Added/Updated unit tests;Added FTPS * Added confirmation to system messages such as shutdown, reboot, and lock * Corrected Typo * Added confirmation to system messages such as shutdown, reboot, and lock * Corrected Typo * Made changes requested by @mykhailopylyp * Further changes per review by mykhailopylyp * Fixes per code review
This commit is contained in:
@@ -4,18 +4,25 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Run.Plugin.System.Win32;
|
using Microsoft.PowerToys.Run.Plugin.System.Win32;
|
||||||
|
using Microsoft.PowerToys.Settings.UI.Library;
|
||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
|
using Wox.Infrastructure.Storage;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Run.Plugin.System
|
namespace Microsoft.PowerToys.Run.Plugin.System
|
||||||
{
|
{
|
||||||
public class Main : IPlugin, IPluginI18n
|
public class Main : IPlugin, IPluginI18n, ISettingProvider
|
||||||
{
|
{
|
||||||
private PluginInitContext _context;
|
private PluginInitContext _context;
|
||||||
|
private const string ConfirmSystemCommands = nameof(ConfirmSystemCommands);
|
||||||
|
|
||||||
internal const int EWXLOGOFF = 0x00000000;
|
internal const int EWXLOGOFF = 0x00000000;
|
||||||
internal const int EWXSHUTDOWN = 0x00000001;
|
internal const int EWXSHUTDOWN = 0x00000001;
|
||||||
@@ -26,13 +33,27 @@ namespace Microsoft.PowerToys.Run.Plugin.System
|
|||||||
|
|
||||||
public string IconTheme { get; set; }
|
public string IconTheme { get; set; }
|
||||||
|
|
||||||
|
public ICommand Command { get; set; }
|
||||||
|
|
||||||
public string Name => Properties.Resources.Microsoft_plugin_sys_plugin_name;
|
public string Name => Properties.Resources.Microsoft_plugin_sys_plugin_name;
|
||||||
|
|
||||||
public string Description => Properties.Resources.Microsoft_plugin_sys_plugin_description;
|
public string Description => Properties.Resources.Microsoft_plugin_sys_plugin_description;
|
||||||
|
|
||||||
|
private bool _confirmSystemCommands;
|
||||||
|
|
||||||
|
public IEnumerable<PluginAdditionalOption> AdditionalOptions => new List<PluginAdditionalOption>()
|
||||||
|
{
|
||||||
|
new PluginAdditionalOption()
|
||||||
|
{
|
||||||
|
Key = ConfirmSystemCommands,
|
||||||
|
DisplayLabel = Properties.Resources.confirm_system_commands,
|
||||||
|
Value = false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
public void Init(PluginInitContext context)
|
public void Init(PluginInitContext context)
|
||||||
{
|
{
|
||||||
this._context = context;
|
_context = context;
|
||||||
_context.API.ThemeChanged += OnThemeChanged;
|
_context.API.ThemeChanged += OnThemeChanged;
|
||||||
UpdateIconTheme(_context.API.GetCurrentTheme());
|
UpdateIconTheme(_context.API.GetCurrentTheme());
|
||||||
}
|
}
|
||||||
@@ -73,8 +94,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System
|
|||||||
IcoPath = $"Images\\shutdown.{IconTheme}.png",
|
IcoPath = $"Images\\shutdown.{IconTheme}.png",
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
Helper.OpenInShell("shutdown", "/s /t 0");
|
return ExecuteCommand(Properties.Resources.Microsoft_plugin_sys_shutdown_computer_confirmation, () => Helper.OpenInShell("shutdown", "/s /t 0"));
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new Result
|
new Result
|
||||||
@@ -84,8 +104,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System
|
|||||||
IcoPath = $"Images\\restart.{IconTheme}.png",
|
IcoPath = $"Images\\restart.{IconTheme}.png",
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
Helper.OpenInShell("shutdown", "/r /t 0");
|
return ExecuteCommand(Properties.Resources.Microsoft_plugin_sys_restart_computer_confirmation, () => Helper.OpenInShell("shutdown", "/r /t 0"));
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new Result
|
new Result
|
||||||
@@ -95,8 +114,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System
|
|||||||
IcoPath = $"Images\\logoff.{IconTheme}.png",
|
IcoPath = $"Images\\logoff.{IconTheme}.png",
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
NativeMethods.ExitWindowsEx(EWXLOGOFF, 0);
|
return ExecuteCommand(Properties.Resources.Microsoft_plugin_sys_sign_out_confirmation, () => NativeMethods.ExitWindowsEx(EWXLOGOFF, 0));
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new Result
|
new Result
|
||||||
@@ -106,8 +124,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System
|
|||||||
IcoPath = $"Images\\lock.{IconTheme}.png",
|
IcoPath = $"Images\\lock.{IconTheme}.png",
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
NativeMethods.LockWorkStation();
|
return ExecuteCommand(Properties.Resources.Microsoft_plugin_sys_lock_confirmation, () => NativeMethods.LockWorkStation());
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new Result
|
new Result
|
||||||
@@ -117,8 +134,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System
|
|||||||
IcoPath = $"Images\\sleep.{IconTheme}.png",
|
IcoPath = $"Images\\sleep.{IconTheme}.png",
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
NativeMethods.SetSuspendState(false, true, true);
|
return ExecuteCommand(Properties.Resources.Microsoft_plugin_sys_sleep_confirmation, () => NativeMethods.SetSuspendState(false, true, true));
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new Result
|
new Result
|
||||||
@@ -128,8 +144,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System
|
|||||||
IcoPath = $"Images\\sleep.{IconTheme}.png", // Icon change needed
|
IcoPath = $"Images\\sleep.{IconTheme}.png", // Icon change needed
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
NativeMethods.SetSuspendState(true, true, true);
|
return ExecuteCommand(Properties.Resources.Microsoft_plugin_sys_hibernate_confirmation, () => NativeMethods.SetSuspendState(true, true, true));
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new Result
|
new Result
|
||||||
@@ -184,5 +199,44 @@ namespace Microsoft.PowerToys.Run.Plugin.System
|
|||||||
{
|
{
|
||||||
return Properties.Resources.Microsoft_plugin_sys_plugin_name;
|
return Properties.Resources.Microsoft_plugin_sys_plugin_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool ExecuteCommand(string confirmationMessage, Action command)
|
||||||
|
{
|
||||||
|
if (_confirmSystemCommands)
|
||||||
|
{
|
||||||
|
MessageBoxResult messageBoxResult = MessageBox.Show(
|
||||||
|
confirmationMessage,
|
||||||
|
Properties.Resources.Microsoft_plugin_sys_confirmation,
|
||||||
|
MessageBoxButton.YesNo,
|
||||||
|
MessageBoxImage.Warning);
|
||||||
|
|
||||||
|
if (messageBoxResult == MessageBoxResult.No)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
command();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Control CreateSettingPanel()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateSettings(PowerLauncherPluginSettings settings)
|
||||||
|
{
|
||||||
|
var confirmSystemCommands = false;
|
||||||
|
|
||||||
|
if (settings != null && settings.AdditionalOptions != null)
|
||||||
|
{
|
||||||
|
var option = settings.AdditionalOptions.FirstOrDefault(x => x.Key == ConfirmSystemCommands);
|
||||||
|
|
||||||
|
confirmSystemCommands = option == null ? false : option.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
_confirmSystemCommands = confirmSystemCommands;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,24 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Show a dialog to confirm system commands.
|
||||||
|
/// </summary>
|
||||||
|
internal static string confirm_system_commands {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("confirm_system_commands", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Please Confirm.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Microsoft_plugin_sys_confirmation {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Microsoft_plugin_sys_confirmation", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Empty Recycle Bin.
|
/// Looks up a localized string similar to Empty Recycle Bin.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -87,6 +105,15 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to You are about to put this computer into hibernation, are you sure?.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Microsoft_plugin_sys_hibernate_confirmation {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Microsoft_plugin_sys_hibernate_confirmation", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Hibernate computer.
|
/// Looks up a localized string similar to Hibernate computer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -105,6 +132,15 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to You are about to lock this computer, are you sure?.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Microsoft_plugin_sys_lock_confirmation {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Microsoft_plugin_sys_lock_confirmation", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Lock computer.
|
/// Looks up a localized string similar to Lock computer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -141,6 +177,15 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to You are about to restart this computer, are you sure?.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Microsoft_plugin_sys_restart_computer_confirmation {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Microsoft_plugin_sys_restart_computer_confirmation", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Restart computer.
|
/// Looks up a localized string similar to Restart computer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -159,6 +204,15 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to You are about to shut down this computer, are you sure?.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Microsoft_plugin_sys_shutdown_computer_confirmation {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Microsoft_plugin_sys_shutdown_computer_confirmation", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Shutdown computer.
|
/// Looks up a localized string similar to Shutdown computer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -177,6 +231,15 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to You are about to sign out of this computer, are you sure?.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Microsoft_plugin_sys_sign_out_confirmation {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Microsoft_plugin_sys_sign_out_confirmation", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Sign out of computer.
|
/// Looks up a localized string similar to Sign out of computer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -195,6 +258,15 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to You are about to put this computer to sleep, are you sure?.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Microsoft_plugin_sys_sleep_confirmation {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Microsoft_plugin_sys_sleep_confirmation", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Put computer to sleep.
|
/// Looks up a localized string similar to Put computer to sleep.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -117,6 +117,13 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<data name="confirm_system_commands" xml:space="preserve">
|
||||||
|
<value>Show a dialog to confirm system commands</value>
|
||||||
|
</data>
|
||||||
|
<data name="Microsoft_plugin_sys_confirmation" xml:space="preserve">
|
||||||
|
<value>Please Confirm</value>
|
||||||
|
<comment>Request confirmation</comment>
|
||||||
|
</data>
|
||||||
<data name="Microsoft_plugin_sys_emptyrecyclebin" xml:space="preserve">
|
<data name="Microsoft_plugin_sys_emptyrecyclebin" xml:space="preserve">
|
||||||
<value>Empty Recycle Bin</value>
|
<value>Empty Recycle Bin</value>
|
||||||
<comment>This should align to the action in Windows of emptying the recycle bin on your computer.</comment>
|
<comment>This should align to the action in Windows of emptying the recycle bin on your computer.</comment>
|
||||||
@@ -129,6 +136,10 @@
|
|||||||
<value>Hibernate</value>
|
<value>Hibernate</value>
|
||||||
<comment>This should align to the action in Windows of a hibernating your computer.</comment>
|
<comment>This should align to the action in Windows of a hibernating your computer.</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Microsoft_plugin_sys_hibernate_confirmation" xml:space="preserve">
|
||||||
|
<value>You are about to put this computer into hibernation, are you sure?</value>
|
||||||
|
<comment>This should align to the action in Windows of a hibernating your computer.</comment>
|
||||||
|
</data>
|
||||||
<data name="Microsoft_plugin_sys_hibernate_description" xml:space="preserve">
|
<data name="Microsoft_plugin_sys_hibernate_description" xml:space="preserve">
|
||||||
<value>Hibernate computer</value>
|
<value>Hibernate computer</value>
|
||||||
<comment>This should align to the action in Windows of a hibernating your computer.</comment>
|
<comment>This should align to the action in Windows of a hibernating your computer.</comment>
|
||||||
@@ -137,6 +148,10 @@
|
|||||||
<value>Lock</value>
|
<value>Lock</value>
|
||||||
<comment>This should align to the action in Windows of a locking your computer.</comment>
|
<comment>This should align to the action in Windows of a locking your computer.</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Microsoft_plugin_sys_lock_confirmation" xml:space="preserve">
|
||||||
|
<value>You are about to lock this computer, are you sure?</value>
|
||||||
|
<comment>This should align to the action in Windows of a locking your computer.</comment>
|
||||||
|
</data>
|
||||||
<data name="Microsoft_plugin_sys_lock_description" xml:space="preserve">
|
<data name="Microsoft_plugin_sys_lock_description" xml:space="preserve">
|
||||||
<value>Lock computer</value>
|
<value>Lock computer</value>
|
||||||
<comment>This should align to the action in Windows of a locking your computer.</comment>
|
<comment>This should align to the action in Windows of a locking your computer.</comment>
|
||||||
@@ -153,6 +168,10 @@
|
|||||||
<value>Restart</value>
|
<value>Restart</value>
|
||||||
<comment>This should align to the action in Windows of a restarting your computer.</comment>
|
<comment>This should align to the action in Windows of a restarting your computer.</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Microsoft_plugin_sys_restart_computer_confirmation" xml:space="preserve">
|
||||||
|
<value>You are about to restart this computer, are you sure?</value>
|
||||||
|
<comment>This should align to the action in Windows of a restarting your computer.</comment>
|
||||||
|
</data>
|
||||||
<data name="Microsoft_plugin_sys_restart_computer_description" xml:space="preserve">
|
<data name="Microsoft_plugin_sys_restart_computer_description" xml:space="preserve">
|
||||||
<value>Restart computer</value>
|
<value>Restart computer</value>
|
||||||
<comment>This should align to the action in Windows of a restarting your computer.</comment>
|
<comment>This should align to the action in Windows of a restarting your computer.</comment>
|
||||||
@@ -161,6 +180,10 @@
|
|||||||
<value>Shutdown</value>
|
<value>Shutdown</value>
|
||||||
<comment>This should align to the action in Windows of a shutting down your computer.</comment>
|
<comment>This should align to the action in Windows of a shutting down your computer.</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Microsoft_plugin_sys_shutdown_computer_confirmation" xml:space="preserve">
|
||||||
|
<value>You are about to shut down this computer, are you sure?</value>
|
||||||
|
<comment>This should align to the action in Windows of a shutting down your computer.</comment>
|
||||||
|
</data>
|
||||||
<data name="Microsoft_plugin_sys_shutdown_computer_description" xml:space="preserve">
|
<data name="Microsoft_plugin_sys_shutdown_computer_description" xml:space="preserve">
|
||||||
<value>Shutdown computer</value>
|
<value>Shutdown computer</value>
|
||||||
<comment>This should align to the action in Windows of a shutting down your computer.</comment>
|
<comment>This should align to the action in Windows of a shutting down your computer.</comment>
|
||||||
@@ -169,6 +192,10 @@
|
|||||||
<value>Sign out</value>
|
<value>Sign out</value>
|
||||||
<comment>This should align to the action in windows of a signing out back to the lock screen.</comment>
|
<comment>This should align to the action in windows of a signing out back to the lock screen.</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Microsoft_plugin_sys_sign_out_confirmation" xml:space="preserve">
|
||||||
|
<value>You are about to sign out of this computer, are you sure?</value>
|
||||||
|
<comment>This should align to the action in windows of a signing out back to the lock screen.</comment>
|
||||||
|
</data>
|
||||||
<data name="Microsoft_plugin_sys_sign_out_description" xml:space="preserve">
|
<data name="Microsoft_plugin_sys_sign_out_description" xml:space="preserve">
|
||||||
<value>Sign out of computer</value>
|
<value>Sign out of computer</value>
|
||||||
<comment>This should align to the action in windows of a signing out back to the lock screen.</comment>
|
<comment>This should align to the action in windows of a signing out back to the lock screen.</comment>
|
||||||
@@ -177,6 +204,10 @@
|
|||||||
<value>Sleep</value>
|
<value>Sleep</value>
|
||||||
<comment>This should align to the action in Windows of a making your computer go to sleep.</comment>
|
<comment>This should align to the action in Windows of a making your computer go to sleep.</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Microsoft_plugin_sys_sleep_confirmation" xml:space="preserve">
|
||||||
|
<value>You are about to put this computer to sleep, are you sure?</value>
|
||||||
|
<comment>This should align to the action in Windows of a making your computer go to sleep.</comment>
|
||||||
|
</data>
|
||||||
<data name="Microsoft_plugin_sys_sleep_description" xml:space="preserve">
|
<data name="Microsoft_plugin_sys_sleep_description" xml:space="preserve">
|
||||||
<value>Put computer to sleep</value>
|
<value>Put computer to sleep</value>
|
||||||
<comment>This should align to the action in Windows of a making your computer go to sleep.</comment>
|
<comment>This should align to the action in Windows of a making your computer go to sleep.</comment>
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ namespace Wox.Plugin
|
|||||||
|
|
||||||
Metadata.ActionKeyword = setting.ActionKeyword;
|
Metadata.ActionKeyword = setting.ActionKeyword;
|
||||||
Metadata.IsGlobal = setting.IsGlobal;
|
Metadata.IsGlobal = setting.IsGlobal;
|
||||||
|
|
||||||
if (Plugin is ISettingProvider)
|
if (Plugin is ISettingProvider)
|
||||||
{
|
{
|
||||||
(Plugin as ISettingProvider).UpdateSettings(setting);
|
(Plugin as ISettingProvider).UpdateSettings(setting);
|
||||||
|
|||||||
@@ -279,19 +279,17 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
IsEnabled="{x:Bind Enabled, Mode=OneWay}" />
|
IsEnabled="{x:Bind Enabled, Mode=OneWay}" />
|
||||||
|
|
||||||
<CheckBox x:Uid="PowerLauncher_IncludeInGlobalResult"
|
<CheckBox x:Uid="PowerLauncher_IncludeInGlobalResult"
|
||||||
IsChecked="{x:Bind Path=IsGlobal, Mode=TwoWay}"
|
IsChecked="{x:Bind Path=IsGlobal, Mode=TwoWay}"
|
||||||
IsEnabled="{x:Bind Enabled, Mode=OneWay}"
|
IsEnabled="{x:Bind Enabled, Mode=OneWay}"
|
||||||
Margin="{StaticResource SmallTopMargin}"/>
|
Margin="{StaticResource SmallTopMargin}"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="AdditionalOptionsTextBlock"
|
||||||
|
x:Uid="Run_AdditionalOptions"
|
||||||
<TextBlock x:Name="AdditionalOptionsTextBlock"
|
Margin="{StaticResource SmallTopMargin}"
|
||||||
x:Uid="Run_AdditionalOptions"
|
Visibility="{x:Bind ShowAdditionalOptions, Converter={StaticResource BoolToVisibilityConverter}}"
|
||||||
Margin="{StaticResource SmallTopMargin}"
|
Style="{StaticResource SettingsGroupTitleStyle}"
|
||||||
Visibility="{x:Bind ShowAdditionalOptions, Converter={StaticResource BoolToVisibilityConverter}}"
|
Opacity="{x:Bind DisabledOpacity}"/>
|
||||||
Style="{StaticResource SettingsGroupTitleStyle}"
|
|
||||||
Opacity="{x:Bind DisabledOpacity}"/>
|
|
||||||
|
|
||||||
<ListView ItemsSource="{x:Bind Path=AdditionalOptions}"
|
<ListView ItemsSource="{x:Bind Path=AdditionalOptions}"
|
||||||
SelectionMode="None"
|
SelectionMode="None"
|
||||||
|
|||||||
Reference in New Issue
Block a user