mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-01-06 12:27:01 +01:00
Compare commits
7 Commits
leilzh/fuz
...
v0.55.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbde5e3854 | ||
|
|
bed7f2a240 | ||
|
|
73a6f76610 | ||
|
|
9d70f784a2 | ||
|
|
4ded7132a5 | ||
|
|
b469b87d75 | ||
|
|
12f9239889 |
@@ -173,7 +173,6 @@
|
|||||||
"HelixToolkit.Core.Wpf.dll",
|
"HelixToolkit.Core.Wpf.dll",
|
||||||
"Mages.Core.dll",
|
"Mages.Core.dll",
|
||||||
"JetBrains.Annotations.dll",
|
"JetBrains.Annotations.dll",
|
||||||
"ICSharpCode.SharpZipLib.dll",
|
|
||||||
"NLog.Extensions.Logging.dll",
|
"NLog.Extensions.Logging.dll",
|
||||||
"concrt140_app.dll",
|
"concrt140_app.dll",
|
||||||
"msvcp140_1_app.dll",
|
"msvcp140_1_app.dll",
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
Impersonate="yes"
|
Impersonate="yes"
|
||||||
Return="asyncNoWait"
|
Return="asyncNoWait"
|
||||||
FileKey="PowerToys.exe"
|
FileKey="PowerToys.exe"
|
||||||
ExeCommand="" />
|
ExeCommand="--dont-elevate" />
|
||||||
|
|
||||||
<CustomAction
|
<CustomAction
|
||||||
Id="TerminateProcesses"
|
Id="TerminateProcesses"
|
||||||
@@ -1379,7 +1379,7 @@
|
|||||||
|
|
||||||
<Component Id="launcherInstallComponent" Directory="LauncherInstallFolder" Guid="5E688DB4-C522-4268-BA54-ED1CDFFE9DB6">
|
<Component Id="launcherInstallComponent" Directory="LauncherInstallFolder" Guid="5E688DB4-C522-4268-BA54-ED1CDFFE9DB6">
|
||||||
<File Source="$(var.BinX64Dir)modules\Launcher\PowerToys.Launcher.dll" />
|
<File Source="$(var.BinX64Dir)modules\Launcher\PowerToys.Launcher.dll" />
|
||||||
<?foreach File in concrt140_app.dll;e_sqlite3.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;Mages.Core.dll;Microsoft.Search.Interop.dll;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;NLog.dll;NLog.Extensions.Logging.dll;PowerToys.PowerLauncher.deps.json;PowerToys.PowerLauncher.dll;PowerToys.PowerLauncher.exe;Microsoft.Xaml.Behaviors.dll;System.Text.Json.dll;PowerToys.PowerLauncher.runtimeconfig.json;System.Data.OleDb.dll;UnitsNet.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToys.Interop.dll;PowerToys.ManagedTelemetry.dll;PowerToys.PowerLauncher.Telemetry.dll;Microsoft.Data.Sqlite.dll;SQLitePCLRaw.batteries_v2.dll;SQLitePCLRaw.core.dll;SQLitePCLRaw.provider.e_sqlite3.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll;ControlzEx.dll;PowerToys.ManagedCommon.dll;System.IO.Abstractions.dll;PowerToys.Common.UI.dll;System.ServiceProcess.ServiceController.dll;Microsoft.Toolkit.Uwp.Notifications.dll;ModernWpf.Controls.dll;ModernWpf.dll;WinRT.Runtime.dll;Microsoft.Windows.SDK.NET.dll?>
|
<?foreach File in concrt140_app.dll;e_sqlite3.dll;JetBrains.Annotations.dll;Mages.Core.dll;Microsoft.Search.Interop.dll;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;NLog.dll;NLog.Extensions.Logging.dll;PowerToys.PowerLauncher.deps.json;PowerToys.PowerLauncher.dll;PowerToys.PowerLauncher.exe;Microsoft.Xaml.Behaviors.dll;System.Text.Json.dll;PowerToys.PowerLauncher.runtimeconfig.json;System.Data.OleDb.dll;UnitsNet.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToys.Interop.dll;PowerToys.ManagedTelemetry.dll;PowerToys.PowerLauncher.Telemetry.dll;Microsoft.Data.Sqlite.dll;SQLitePCLRaw.batteries_v2.dll;SQLitePCLRaw.core.dll;SQLitePCLRaw.provider.e_sqlite3.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll;ControlzEx.dll;PowerToys.ManagedCommon.dll;System.IO.Abstractions.dll;PowerToys.Common.UI.dll;System.ServiceProcess.ServiceController.dll;Microsoft.Toolkit.Uwp.Notifications.dll;ModernWpf.Controls.dll;ModernWpf.dll;WinRT.Runtime.dll;Microsoft.Windows.SDK.NET.dll?>
|
||||||
<File Id="File_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\$(var.File)" />
|
<File Id="File_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\$(var.File)" />
|
||||||
<?endforeach?>
|
<?endforeach?>
|
||||||
<File Source="$(var.BinX64Dir)Settings\PowerToys.Settings.UI.Lib.dll" />
|
<File Source="$(var.BinX64Dir)Settings\PowerToys.Settings.UI.Lib.dll" />
|
||||||
|
|||||||
@@ -598,6 +598,12 @@ public:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Runtime objects already created. Should update in the owner thread.
|
// Runtime objects already created. Should update in the owner thread.
|
||||||
|
if (m_dispatcherQueueController == nullptr)
|
||||||
|
{
|
||||||
|
Logger::warn("Tried accessing the dispatch queue controller before it was initialized.");
|
||||||
|
// No dispatcher Queue Controller? Means initialization still hasn't run, so settings will be applied then.
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
||||||
FindMyMouseSettings localSettings = settings;
|
FindMyMouseSettings localSettings = settings;
|
||||||
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
||||||
|
|||||||
@@ -277,6 +277,12 @@ void InclusiveCrosshairs::ApplySettings(InclusiveCrosshairsSettings& settings, b
|
|||||||
if (applyToRunTimeObjects)
|
if (applyToRunTimeObjects)
|
||||||
{
|
{
|
||||||
// Runtime objects already created. Should update in the owner thread.
|
// Runtime objects already created. Should update in the owner thread.
|
||||||
|
if (m_dispatcherQueueController == nullptr)
|
||||||
|
{
|
||||||
|
Logger::warn("Tried accessing the dispatch queue controller before it was initialized.");
|
||||||
|
// No dispatcher Queue Controller? Means initialization still hasn't run, so settings will be applied then.
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
||||||
InclusiveCrosshairsSettings localSettings = settings;
|
InclusiveCrosshairsSettings localSettings = settings;
|
||||||
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
||||||
|
|||||||
@@ -92,10 +92,12 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
|||||||
{
|
{
|
||||||
// To hide (not add) preloaded uwp app windows that are invisible to the user we check the cloak state in DWM to be "none". (Issue #13637.)
|
// To hide (not add) preloaded uwp app windows that are invisible to the user we check the cloak state in DWM to be "none". (Issue #13637.)
|
||||||
// (If user asking to see these windows again we can add an optional plugin setting in the future.)
|
// (If user asking to see these windows again we can add an optional plugin setting in the future.)
|
||||||
if (!newWindow.IsCloaked)
|
// [@htcfreek, 2022-02-01: Removed the IsCloaked check to list windows from virtual desktops other than the current one again (#15887). In a second PR I will fix it re-implement it with improved code again.]
|
||||||
{
|
// if (!newWindow.IsCloaked)
|
||||||
windows.Add(newWindow);
|
// {
|
||||||
}
|
windows.Add(newWindow);
|
||||||
|
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,232 +0,0 @@
|
|||||||
// Copyright (c) Microsoft Corporation
|
|
||||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
||||||
// See the LICENSE file in the project root for more information.
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.IO.Abstractions;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text.Json;
|
|
||||||
using System.Windows;
|
|
||||||
using ICSharpCode.SharpZipLib.Zip;
|
|
||||||
using Wox.Plugin;
|
|
||||||
using Wox.Plugin.Logger;
|
|
||||||
|
|
||||||
namespace PowerLauncher.Plugin
|
|
||||||
{
|
|
||||||
internal class PluginInstaller
|
|
||||||
{
|
|
||||||
private static readonly IFileSystem FileSystem = new FileSystem();
|
|
||||||
private static readonly IPath Path = FileSystem.Path;
|
|
||||||
private static readonly IFile File = FileSystem.File;
|
|
||||||
private static readonly IDirectory Directory = FileSystem.Directory;
|
|
||||||
|
|
||||||
internal static void Install(string path)
|
|
||||||
{
|
|
||||||
if (File.Exists(path))
|
|
||||||
{
|
|
||||||
string tempFolder = Path.Combine(Path.GetTempPath(), "wox\\plugins");
|
|
||||||
if (Directory.Exists(tempFolder))
|
|
||||||
{
|
|
||||||
Directory.Delete(tempFolder, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
UnZip(path, tempFolder, true);
|
|
||||||
|
|
||||||
string iniPath = Path.Combine(tempFolder, "plugin.json");
|
|
||||||
if (!File.Exists(iniPath))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Install failed: plugin config is missing");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PluginMetadata plugin = GetMetadataFromJson(tempFolder);
|
|
||||||
if (plugin?.Name == null)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Install failed: plugin config is invalid");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
string pluginFolderPath = Constant.PluginsDirectory;
|
|
||||||
|
|
||||||
// Using Ordinal since this is part of a path
|
|
||||||
string newPluginName = plugin.Name
|
|
||||||
.Replace("/", "_", StringComparison.Ordinal)
|
|
||||||
.Replace("\\", "_", StringComparison.Ordinal)
|
|
||||||
.Replace(":", "_", StringComparison.Ordinal)
|
|
||||||
.Replace("<", "_", StringComparison.Ordinal)
|
|
||||||
.Replace(">", "_", StringComparison.Ordinal)
|
|
||||||
.Replace("?", "_", StringComparison.Ordinal)
|
|
||||||
.Replace("*", "_", StringComparison.Ordinal)
|
|
||||||
.Replace("|", "_", StringComparison.Ordinal)
|
|
||||||
+ "-" + Guid.NewGuid();
|
|
||||||
string newPluginPath = Path.Combine(pluginFolderPath, newPluginName);
|
|
||||||
string content = $"Do you want to install following plugin?{Environment.NewLine}{Environment.NewLine}" +
|
|
||||||
$"Name: {plugin.Name}{Environment.NewLine}" +
|
|
||||||
$"Version: {plugin.Version}{Environment.NewLine}" +
|
|
||||||
$"Author: {plugin.Author}";
|
|
||||||
PluginPair existingPlugin = PluginManager.GetPluginForId(plugin.ID);
|
|
||||||
|
|
||||||
if (existingPlugin != null)
|
|
||||||
{
|
|
||||||
content = $"Do you want to update following plugin?{Environment.NewLine}{Environment.NewLine}" +
|
|
||||||
$"Name: {plugin.Name}{Environment.NewLine}" +
|
|
||||||
$"Old Version: {existingPlugin.Metadata.Version}" +
|
|
||||||
$"{Environment.NewLine}New Version: {plugin.Version}" +
|
|
||||||
$"{Environment.NewLine}Author: {plugin.Author}";
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = MessageBox.Show(content, "Install plugin", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
|
||||||
if (result == MessageBoxResult.Yes)
|
|
||||||
{
|
|
||||||
if (existingPlugin != null && Directory.Exists(existingPlugin.Metadata.PluginDirectory))
|
|
||||||
{
|
|
||||||
// when plugin is in use, we can't delete them. That's why we need to make plugin folder a random name
|
|
||||||
File.Create(Path.Combine(existingPlugin.Metadata.PluginDirectory, "NeedDelete.txt")).Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
UnZip(path, newPluginPath, true);
|
|
||||||
Directory.Delete(tempFolder, true);
|
|
||||||
|
|
||||||
// existing plugins could be loaded by the application,
|
|
||||||
// if we try to delete those kind of plugins, we will get a error that indicate the
|
|
||||||
// file is been used now.
|
|
||||||
// current solution is to restart wox. Ugly.
|
|
||||||
// if (MainWindow.Initialized)
|
|
||||||
// {
|
|
||||||
// Plugins.Initialize();
|
|
||||||
// }
|
|
||||||
if (MessageBox.Show($"You have installed plugin {plugin.Name} successfully.{Environment.NewLine} Restart Wox to take effect?", "Install plugin", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
|
|
||||||
{
|
|
||||||
PluginManager.API.RestartApp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Suppressing this to enable FxCop. We are logging the exception, and going forward general exceptions should not be caught")]
|
|
||||||
private static PluginMetadata GetMetadataFromJson(string pluginDirectory)
|
|
||||||
{
|
|
||||||
string configPath = Path.Combine(pluginDirectory, "plugin.json");
|
|
||||||
PluginMetadata metadata;
|
|
||||||
|
|
||||||
if (!File.Exists(configPath))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
metadata = JsonSerializer.Deserialize<PluginMetadata>(File.ReadAllText(configPath));
|
|
||||||
metadata.PluginDirectory = pluginDirectory;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
string error = $"Parse plugin config {configPath} failed: json format is not valid";
|
|
||||||
Log.Exception(error, e, MethodBase.GetCurrentMethod().DeclaringType);
|
|
||||||
#if DEBUG
|
|
||||||
{
|
|
||||||
throw new Exception(error);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
return null;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!AllowedLanguage.IsAllowed(metadata.Language))
|
|
||||||
{
|
|
||||||
string error = $"Parse plugin config {configPath} failed: invalid language {metadata.Language}";
|
|
||||||
#if DEBUG
|
|
||||||
{
|
|
||||||
throw new Exception(error);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
return null;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!File.Exists(metadata.ExecuteFilePath))
|
|
||||||
{
|
|
||||||
string error = $"Parse plugin config {configPath} failed: ExecuteFile {metadata.ExecuteFilePath} didn't exist";
|
|
||||||
#if DEBUG
|
|
||||||
{
|
|
||||||
throw new Exception(error);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
return null;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
return metadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// unzip
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="zippedFile">The zipped file.</param>
|
|
||||||
/// <param name="strDirectory">The STR directory.</param>
|
|
||||||
/// <param name="overWrite">overwrite</param>
|
|
||||||
private static void UnZip(string zippedFile, string strDirectory, bool overWrite)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(strDirectory))
|
|
||||||
{
|
|
||||||
strDirectory = Directory.GetCurrentDirectory();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Using Ordinal since this is a path
|
|
||||||
if (!strDirectory.EndsWith("\\", StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
strDirectory += "\\";
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ZipInputStream s = new ZipInputStream(File.OpenRead(zippedFile)))
|
|
||||||
{
|
|
||||||
ZipEntry theEntry;
|
|
||||||
|
|
||||||
while ((theEntry = s.GetNextEntry()) != null)
|
|
||||||
{
|
|
||||||
string directoryName = string.Empty;
|
|
||||||
string pathToZip = string.Empty;
|
|
||||||
pathToZip = theEntry.Name;
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(pathToZip))
|
|
||||||
{
|
|
||||||
directoryName = Path.GetDirectoryName(pathToZip) + "\\";
|
|
||||||
}
|
|
||||||
|
|
||||||
string fileName = Path.GetFileName(pathToZip);
|
|
||||||
|
|
||||||
Directory.CreateDirectory(strDirectory + directoryName);
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(fileName))
|
|
||||||
{
|
|
||||||
if ((File.Exists(strDirectory + directoryName + fileName) && overWrite) || (!File.Exists(strDirectory + directoryName + fileName)))
|
|
||||||
{
|
|
||||||
using (Stream streamWriter = File.Create(strDirectory + directoryName + fileName))
|
|
||||||
{
|
|
||||||
byte[] data = new byte[2048];
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
int size = s.Read(data, 0, data.Length);
|
|
||||||
|
|
||||||
if (size > 0)
|
|
||||||
{
|
|
||||||
streamWriter.Write(data, 0, size);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
streamWriter.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
s.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -165,11 +165,6 @@ namespace PowerLauncher.Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InstallPlugin(string path)
|
|
||||||
{
|
|
||||||
PluginInstaller.Install(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Suppressing this to enable FxCop. We are logging the exception, and going forward general exceptions should not be caught")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Suppressing this to enable FxCop. We are logging the exception, and going forward general exceptions should not be caught")]
|
||||||
public static List<Result> QueryForPlugin(PluginPair pair, Query query, bool delayedExecution = false)
|
public static List<Result> QueryForPlugin(PluginPair pair, Query query, bool delayedExecution = false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,7 +103,6 @@
|
|||||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
|
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
|
||||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
|
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
|
||||||
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
|
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
|
||||||
<PackageReference Include="SharpZipLib" Version="1.2.0" />
|
|
||||||
<PackageReference Include="System.Runtime" Version="4.3.1" />
|
<PackageReference Include="System.Runtime" Version="4.3.1" />
|
||||||
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.6" />
|
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.6" />
|
||||||
<PackageReference Include="System.Data.OleDb" Version="4.7.1" />
|
<PackageReference Include="System.Data.OleDb" Version="4.7.1" />
|
||||||
|
|||||||
@@ -103,11 +103,6 @@ namespace Wox
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InstallPlugin(string path)
|
|
||||||
{
|
|
||||||
Application.Current.Dispatcher.Invoke(() => PluginManager.InstallPlugin(path));
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PluginPair> GetAllPlugins()
|
public List<PluginPair> GetAllPlugins()
|
||||||
{
|
{
|
||||||
return PluginManager.AllPlugins.ToList();
|
return PluginManager.AllPlugins.ToList();
|
||||||
|
|||||||
@@ -64,12 +64,6 @@ namespace Wox.Plugin
|
|||||||
/// <param name="iconPath">Message icon path (relative path to your plugin folder)</param>
|
/// <param name="iconPath">Message icon path (relative path to your plugin folder)</param>
|
||||||
void ShowMsg(string title, string subTitle = "", string iconPath = "", bool useMainWindowAsOwner = true);
|
void ShowMsg(string title, string subTitle = "", string iconPath = "", bool useMainWindowAsOwner = true);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Install Wox plugin
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">Plugin path (ends with .wox)</param>
|
|
||||||
void InstallPlugin(string path);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all loaded plugins
|
/// Get all loaded plugins
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -149,7 +149,8 @@ void apply_general_settings(const json::JsonObject& general_configs, bool save)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const bool module_inst_enabled = modules().at(name)->is_enabled();
|
PowertoyModule& powertoy = modules().at(name);
|
||||||
|
const bool module_inst_enabled = powertoy->is_enabled();
|
||||||
const bool target_enabled = value.GetBoolean();
|
const bool target_enabled = value.GetBoolean();
|
||||||
if (module_inst_enabled == target_enabled)
|
if (module_inst_enabled == target_enabled)
|
||||||
{
|
{
|
||||||
@@ -157,12 +158,14 @@ void apply_general_settings(const json::JsonObject& general_configs, bool save)
|
|||||||
}
|
}
|
||||||
if (target_enabled)
|
if (target_enabled)
|
||||||
{
|
{
|
||||||
modules().at(name)->enable();
|
powertoy->enable();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
modules().at(name)->disable();
|
powertoy->disable();
|
||||||
}
|
}
|
||||||
|
// Sync the hotkey state with the module state, so it can be removed for disabled modules.
|
||||||
|
powertoy.UpdateHotkeyEx();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,6 +224,7 @@ void start_enabled_powertoys()
|
|||||||
if (!powertoys_to_disable.contains(name))
|
if (!powertoys_to_disable.contains(name))
|
||||||
{
|
{
|
||||||
powertoy->enable();
|
powertoy->enable();
|
||||||
|
powertoy.UpdateHotkeyEx();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -386,11 +386,21 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
apply_general_settings(general_settings, false);
|
apply_general_settings(general_settings, false);
|
||||||
int rvalue = 0;
|
int rvalue = 0;
|
||||||
const bool elevated = is_process_elevated();
|
const bool elevated = is_process_elevated();
|
||||||
if ((elevated ||
|
|
||||||
|
if (elevated && cmdLine.find("--dont-elevate") != std::string::npos &&
|
||||||
|
general_settings.GetNamedBoolean(L"run_elevated", false) == false) {
|
||||||
|
schedule_restart_as_non_elevated();
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
|
else if ((elevated ||
|
||||||
general_settings.GetNamedBoolean(L"run_elevated", false) == false ||
|
general_settings.GetNamedBoolean(L"run_elevated", false) == false ||
|
||||||
cmdLine.find("--dont-elevate") != std::string::npos))
|
cmdLine.find("--dont-elevate") != std::string::npos))
|
||||||
{
|
{
|
||||||
result = runner(elevated, open_settings, settings_window, openOobe);
|
result = runner(elevated, open_settings, settings_window, openOobe);
|
||||||
|
|
||||||
|
// Save settings on closing
|
||||||
|
auto general_settings = get_general_settings();
|
||||||
|
PTSettingsHelper::save_general_settings(general_settings.to_json());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -405,10 +415,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
result = -1;
|
result = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save settings on closing
|
|
||||||
auto general_settings = get_general_settings();
|
|
||||||
PTSettingsHelper::save_general_settings(general_settings.to_json());
|
|
||||||
|
|
||||||
// We need to release the mutexes to be able to restart the application
|
// We need to release the mutexes to be able to restart the application
|
||||||
if (msi_mutex)
|
if (msi_mutex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,11 +74,12 @@ void PowertoyModule::UpdateHotkeyEx()
|
|||||||
{
|
{
|
||||||
CentralizedHotkeys::UnregisterHotkeysForModule(pt_module->get_key());
|
CentralizedHotkeys::UnregisterHotkeysForModule(pt_module->get_key());
|
||||||
auto container = pt_module->GetHotkeyEx();
|
auto container = pt_module->GetHotkeyEx();
|
||||||
if (container.has_value())
|
if (container.has_value() && pt_module->is_enabled())
|
||||||
{
|
{
|
||||||
auto hotkey = container.value();
|
auto hotkey = container.value();
|
||||||
auto modulePtr = pt_module.get();
|
auto modulePtr = pt_module.get();
|
||||||
auto action = [modulePtr](WORD modifiersMask, WORD vkCode) {
|
auto action = [modulePtr](WORD modifiersMask, WORD vkCode) {
|
||||||
|
Logger::trace(L"{} hotkey Ex is invoked from Centralized keyboard hook", modulePtr->get_key());
|
||||||
modulePtr->OnHotkeyEx();
|
modulePtr->OnHotkeyEx();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<controls:Setting x:Uid="AlwaysOnTop_ExcludedApps" Icon="" Style="{StaticResource ExpanderHeaderSettingStyle}"/>
|
<controls:Setting x:Uid="AlwaysOnTop_ExcludedApps" Icon="" Style="{StaticResource ExpanderHeaderSettingStyle}"/>
|
||||||
</controls:SettingExpander.Header>
|
</controls:SettingExpander.Header>
|
||||||
<controls:SettingExpander.Content>
|
<controls:SettingExpander.Content>
|
||||||
<TextBox x:Uid="FancyZones_ExcludedApps_TextBoxControl"
|
<TextBox x:Uid="AlwaysOnTop_ExcludedApps_TextBoxControl"
|
||||||
Margin="{StaticResource ExpanderSettingMargin}"
|
Margin="{StaticResource ExpanderSettingMargin}"
|
||||||
Text="{x:Bind Mode=TwoWay, Path=ViewModel.ExcludedApps, UpdateSourceTrigger=PropertyChanged}"
|
Text="{x:Bind Mode=TwoWay, Path=ViewModel.ExcludedApps, UpdateSourceTrigger=PropertyChanged}"
|
||||||
ScrollViewer.VerticalScrollBarVisibility ="Visible"
|
ScrollViewer.VerticalScrollBarVisibility ="Visible"
|
||||||
|
|||||||
@@ -19,13 +19,7 @@
|
|||||||
<controls:SettingsPageControl.ModuleContent>
|
<controls:SettingsPageControl.ModuleContent>
|
||||||
|
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<muxc:InfoBar
|
|
||||||
Severity="Warning"
|
|
||||||
x:Uid="VideoConference_RunAsAdminRequired"
|
|
||||||
IsOpen="True"
|
|
||||||
IsTabStop="True"
|
|
||||||
IsClosable="False"
|
|
||||||
Visibility="{Binding Mode=OneWay, Path=IsElevated, Converter={StaticResource BoolToVisibilityConverter}}" />
|
|
||||||
<controls:Setting x:Uid="VideoConference_Enable" IsEnabled="{ Binding Mode=OneWay, Path=IsElevated }">
|
<controls:Setting x:Uid="VideoConference_Enable" IsEnabled="{ Binding Mode=OneWay, Path=IsElevated }">
|
||||||
<controls:Setting.Icon>
|
<controls:Setting.Icon>
|
||||||
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsVideoConferenceMute.png" ShowAsMonochrome="False" />
|
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsVideoConferenceMute.png" ShowAsMonochrome="False" />
|
||||||
@@ -34,7 +28,14 @@
|
|||||||
<ToggleSwitch IsOn="{Binding Mode=TwoWay, Path=IsEnabled}" x:Uid="ToggleSwitch"/>
|
<ToggleSwitch IsOn="{Binding Mode=TwoWay, Path=IsEnabled}" x:Uid="ToggleSwitch"/>
|
||||||
</controls:Setting.ActionContent>
|
</controls:Setting.ActionContent>
|
||||||
</controls:Setting>
|
</controls:Setting>
|
||||||
|
<muxc:InfoBar
|
||||||
|
Severity="Warning"
|
||||||
|
x:Uid="VideoConference_RunAsAdminRequired"
|
||||||
|
IsOpen="True"
|
||||||
|
IsTabStop="True"
|
||||||
|
IsClosable="False"
|
||||||
|
Visibility="{Binding Mode=OneWay, Path=IsElevated, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||||
|
|
||||||
<controls:SettingsGroup x:Uid="VideoConference_Shortcuts" IsEnabled="{Binding Mode=OneWay, Path=IsEnabled}">
|
<controls:SettingsGroup x:Uid="VideoConference_Shortcuts" IsEnabled="{Binding Mode=OneWay, Path=IsEnabled}">
|
||||||
<controls:Setting x:Uid="VideoConference_CameraAndMicrophoneMuteHotkeyControl_Header">
|
<controls:Setting x:Uid="VideoConference_CameraAndMicrophoneMuteHotkeyControl_Header">
|
||||||
<controls:Setting.ActionContent>
|
<controls:Setting.ActionContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user