mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 19:27:56 +01:00
UI staff
This commit is contained in:
@@ -144,6 +144,7 @@ namespace WinAlfred
|
||||
|
||||
case Key.Enter:
|
||||
resultCtrl.AcceptSelect();
|
||||
HideWinAlfred();
|
||||
e.Handled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace WinAlfred.PluginLoader
|
||||
private PluginMetadata metadata;
|
||||
|
||||
[DllImport("PyWinAlfred.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
||||
private extern static IntPtr ExecPython(string directory, string file, string query);
|
||||
private extern static IntPtr ExecPython(string directory, string file,string method,string para);
|
||||
[DllImport("PyWinAlfred.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
||||
private extern static void InitPythonEnv();
|
||||
|
||||
@@ -22,9 +22,16 @@ namespace WinAlfred.PluginLoader
|
||||
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
string s = Marshal.PtrToStringAnsi(ExecPython(metadata.PluginDirecotry, metadata.ExecuteFileName.Replace(".py", ""), query.RawQuery));
|
||||
List<Result> o = JsonConvert.DeserializeObject<List<Result>>(s);
|
||||
return o;
|
||||
string s = Marshal.PtrToStringAnsi(ExecPython(metadata.PluginDirecotry, metadata.ExecuteFileName.Replace(".py", ""),"query",query.RawQuery));
|
||||
List<PythonResult> o = JsonConvert.DeserializeObject<List<PythonResult>>(s);
|
||||
List<Result> r = new List<Result>();
|
||||
foreach (PythonResult pythonResult in o)
|
||||
{
|
||||
PythonResult ps = pythonResult;
|
||||
ps.Action = () => ExecPython(metadata.PluginDirecotry, metadata.ExecuteFileName.Replace(".py", ""),ps.ActionName,ps.ActionPara);
|
||||
r.Add(ps);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
public void Init()
|
||||
|
||||
Reference in New Issue
Block a user