mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Make python plugins optional
This commit is contained in:
parent
46e0656fe9
commit
ef63f11bbb
4 changed files with 35 additions and 4 deletions
|
|
@ -11,6 +11,12 @@ namespace Wox.Infrastructure.UserSettings
|
||||||
public List<WebSearch> WebSearches { get; set; }
|
public List<WebSearch> WebSearches { get; set; }
|
||||||
public List<CustomPluginHotkey> CustomPluginHotkeys { get; set; }
|
public List<CustomPluginHotkey> CustomPluginHotkeys { get; set; }
|
||||||
public bool StartWoxOnSystemStartup { get; set; }
|
public bool StartWoxOnSystemStartup { get; set; }
|
||||||
|
public bool EnablePythonPlugins { get; set; }
|
||||||
|
|
||||||
|
public UserSetting()
|
||||||
|
{
|
||||||
|
EnablePythonPlugins = false;
|
||||||
|
}
|
||||||
|
|
||||||
public List<WebSearch> LoadDefaultWebSearches()
|
public List<WebSearch> LoadDefaultWebSearches()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Microsoft.CSharp;
|
using Microsoft.CSharp;
|
||||||
using Wox.Helper;
|
using Wox.Helper;
|
||||||
|
using Wox.Infrastructure;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
|
|
||||||
namespace Wox.PluginLoader
|
namespace Wox.PluginLoader
|
||||||
|
|
@ -18,7 +19,11 @@ namespace Wox.PluginLoader
|
||||||
plugins.Clear();
|
plugins.Clear();
|
||||||
BasePluginLoader.ParsePluginsConfig();
|
BasePluginLoader.ParsePluginsConfig();
|
||||||
|
|
||||||
plugins.AddRange(new PythonPluginLoader().LoadPlugin());
|
if (CommonStorage.Instance.UserSetting.EnablePythonPlugins)
|
||||||
|
{
|
||||||
|
plugins.AddRange(new PythonPluginLoader().LoadPlugin());
|
||||||
|
}
|
||||||
|
|
||||||
plugins.AddRange(new CSharpPluginLoader().LoadPlugin());
|
plugins.AddRange(new CSharpPluginLoader().LoadPlugin());
|
||||||
foreach (IPlugin plugin in plugins.Select(pluginPair => pluginPair.Plugin))
|
foreach (IPlugin plugin in plugins.Select(pluginPair => pluginPair.Plugin))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,6 @@
|
||||||
<TextBlock Text="Theme:" />
|
<TextBlock Text="Theme:" />
|
||||||
<ComboBox x:Name="themeComboBox" SelectionChanged="ThemeComboBox_OnSelectionChanged" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120"/>
|
<ComboBox x:Name="themeComboBox" SelectionChanged="ThemeComboBox_OnSelectionChanged" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Margin="10">
|
|
||||||
<Button x:Name="btnEnableInstaller" Click="BtnEnableInstaller_OnClick">enable plugin installer</Button>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Hotkey">
|
<TabItem Header="Hotkey">
|
||||||
|
|
@ -107,5 +104,16 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem Header="Plugins">
|
||||||
|
<StackPanel Orientation="Vertical" Margin="10">
|
||||||
|
<StackPanel Orientation="Horizontal" Margin="10">
|
||||||
|
<CheckBox x:Name="cbEnablePythonPlugins" />
|
||||||
|
<TextBlock Text="Enable Python Plugins" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Margin="10">
|
||||||
|
<Button x:Name="btnEnableInstaller" Click="BtnEnableInstaller_OnClick">enable plugin installer</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,17 @@ namespace Wox
|
||||||
CommonStorage.Instance.Save();
|
CommonStorage.Instance.Save();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cbEnablePythonPlugins.Checked += (o, e) =>
|
||||||
|
{
|
||||||
|
CommonStorage.Instance.UserSetting.EnablePythonPlugins = true;
|
||||||
|
CommonStorage.Instance.Save();
|
||||||
|
};
|
||||||
|
cbEnablePythonPlugins.Unchecked += (o, e) =>
|
||||||
|
{
|
||||||
|
CommonStorage.Instance.UserSetting.EnablePythonPlugins = false;
|
||||||
|
CommonStorage.Instance.Save();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
foreach (string theme in LoadAvailableThemes())
|
foreach (string theme in LoadAvailableThemes())
|
||||||
{
|
{
|
||||||
|
|
@ -57,6 +68,7 @@ namespace Wox
|
||||||
cbReplaceWinR.IsChecked = CommonStorage.Instance.UserSetting.ReplaceWinR;
|
cbReplaceWinR.IsChecked = CommonStorage.Instance.UserSetting.ReplaceWinR;
|
||||||
webSearchView.ItemsSource = CommonStorage.Instance.UserSetting.WebSearches;
|
webSearchView.ItemsSource = CommonStorage.Instance.UserSetting.WebSearches;
|
||||||
lvCustomHotkey.ItemsSource = CommonStorage.Instance.UserSetting.CustomPluginHotkeys;
|
lvCustomHotkey.ItemsSource = CommonStorage.Instance.UserSetting.CustomPluginHotkeys;
|
||||||
|
cbEnablePythonPlugins.IsChecked = CommonStorage.Instance.UserSetting.EnablePythonPlugins;
|
||||||
cbStartWithWindows.IsChecked = File.Exists(woxLinkPath);
|
cbStartWithWindows.IsChecked = File.Exists(woxLinkPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue