mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Move get default hotkeys to pluginmanger and make Main.Context non-static
This commit is contained in:
parent
00457ddc29
commit
bb9682f791
3 changed files with 38 additions and 41 deletions
|
|
@ -13,7 +13,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
||||||
{
|
{
|
||||||
public class Main : ISettingProvider, IPlugin, ISavable, IContextMenu, IPluginI18n
|
public class Main : ISettingProvider, IPlugin, ISavable, IContextMenu, IPluginI18n
|
||||||
{
|
{
|
||||||
internal static PluginInitContext Context { get; set; }
|
internal PluginInitContext Context { get; set; }
|
||||||
|
|
||||||
internal Settings Settings;
|
internal Settings Settings;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,43 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
||||||
await pluginsManifest.DownloadManifest();
|
await pluginsManifest.DownloadManifest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal List<Result> GetDefaultHotKeys()
|
||||||
|
{
|
||||||
|
return new List<Result>()
|
||||||
|
{
|
||||||
|
new Result()
|
||||||
|
{
|
||||||
|
Title = Settings.HotKeyInstall,
|
||||||
|
IcoPath = icoPath,
|
||||||
|
Action = _ =>
|
||||||
|
{
|
||||||
|
Context.API.ChangeQuery("pm install ");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Result()
|
||||||
|
{
|
||||||
|
Title = Settings.HotkeyUninstall,
|
||||||
|
IcoPath = icoPath,
|
||||||
|
Action = _ =>
|
||||||
|
{
|
||||||
|
Context.API.ChangeQuery("pm uninstall ");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Result()
|
||||||
|
{
|
||||||
|
Title = Settings.HotkeyUpdate,
|
||||||
|
IcoPath = icoPath,
|
||||||
|
Action = _ =>
|
||||||
|
{
|
||||||
|
Context.API.ChangeQuery("pm update ");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
internal void InstallOrUpdate(UserPlugin plugin)
|
internal void InstallOrUpdate(UserPlugin plugin)
|
||||||
{
|
{
|
||||||
if (PluginExists(plugin.ID))
|
if (PluginExists(plugin.ID))
|
||||||
|
|
|
||||||
|
|
@ -12,46 +12,6 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
||||||
internal string HotkeyUpdate { get; set; } = "update";
|
internal string HotkeyUpdate { get; set; } = "update";
|
||||||
|
|
||||||
internal readonly string icoPath = "Images\\pluginsmanager.png";
|
internal readonly string icoPath = "Images\\pluginsmanager.png";
|
||||||
|
|
||||||
|
|
||||||
internal List<Result> HotKeys
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new List<Result>()
|
|
||||||
{
|
|
||||||
new Result()
|
|
||||||
{
|
|
||||||
Title = HotKeyInstall,
|
|
||||||
IcoPath = icoPath,
|
|
||||||
Action = _ =>
|
|
||||||
{
|
|
||||||
Main.Context.API.ChangeQuery("pm install ");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Result()
|
|
||||||
{
|
|
||||||
Title = HotkeyUninstall,
|
|
||||||
IcoPath = icoPath,
|
|
||||||
Action = _ =>
|
|
||||||
{
|
|
||||||
Main.Context.API.ChangeQuery("pm uninstall ");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Result()
|
|
||||||
{
|
|
||||||
Title = HotkeyUpdate,
|
|
||||||
IcoPath = icoPath,
|
|
||||||
Action = _ =>
|
|
||||||
{
|
|
||||||
Main.Context.API.ChangeQuery("pm update ");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue