Merge pull request #429 from taooceros/SpecialCtrl

Add special ctrl for Pluginsmanager and Shell plugin
This commit is contained in:
Jeremy Wu 2021-05-17 06:58:16 +10:00 committed by GitHub
commit 7092263e7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 7 deletions

View file

@ -318,6 +318,12 @@ namespace Flow.Launcher.Plugin.PluginsManager
IcoPath = icoPath,
Action = e =>
{
if (e.SpecialKeyState.CtrlPressed)
{
SearchWeb.NewTabInBrowser(x.Website);
return ShouldHideWindow;
}
Application.Current.MainWindow.Hide();
_ = InstallOrUpdate(x); // No need to wait
return ShouldHideWindow;

View file

@ -6,7 +6,7 @@
"Name": "Plugins Manager",
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
"Author": "Jeremy Wu",
"Version": "1.7.2",
"Version": "1.8.0",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",

View file

@ -86,7 +86,7 @@ namespace Flow.Launcher.Plugin.Shell
IcoPath = Image,
Action = c =>
{
Execute(Process.Start, PrepareProcessStartInfo(m));
Execute(Process.Start, PrepareProcessStartInfo(m, c.SpecialKeyState.CtrlPressed));
return true;
}
}));
@ -182,7 +182,7 @@ namespace Flow.Launcher.Plugin.Shell
if (_settings.Shell == Shell.Cmd)
{
var arguments = _settings.LeaveShellOpen ? $"/k \"{command}\"" : $"/c \"{command}\" & pause";
info = ShellCommand.SetProcessStartInfo("cmd.exe", workingDirectory, arguments, runAsAdministratorArg);
}
else if (_settings.Shell == Shell.Powershell)
@ -232,11 +232,11 @@ namespace Flow.Launcher.Plugin.Shell
return info;
}
private void Execute(Func<ProcessStartInfo, Process> startProcess,ProcessStartInfo info)
private void Execute(Func<ProcessStartInfo, Process> startProcess, ProcessStartInfo info)
{
try
{
startProcess(info);
startProcess(info);
}
catch (FileNotFoundException e)
{
@ -244,7 +244,7 @@ namespace Flow.Launcher.Plugin.Shell
var message = $"Command not found: {e.Message}";
context.API.ShowMsg(name, message);
}
catch(Win32Exception e)
catch (Win32Exception e)
{
var name = "Plugin: Shell";
var message = $"Error running the command: {e.Message}";

View file

@ -4,7 +4,7 @@
"Name": "Shell",
"Description": "Provide executing commands from Flow Launcher",
"Author": "qianlifeng",
"Version": "1.3.2",
"Version": "1.4.0",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Shell.dll",