diff --git a/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs b/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs index 278d84f184..4afa333210 100644 --- a/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs +++ b/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs @@ -7,18 +7,30 @@ namespace Wox.Plugin.SystemPlugins { public virtual string Name { get { return "System workflow"; } } public virtual string Description { get { return "System workflow"; } } public virtual string IcoPath { get { return null; } } + public virtual bool Enabled { get; set; } protected abstract List QueryInternal(Query query); - protected abstract void InitInternal(PluginInitContext context); + + public List Query(Query query) { - if (string.IsNullOrEmpty(query.RawQuery)) return new List(); - return QueryInternal(query); + if (Enabled) { + if (string.IsNullOrEmpty(query.RawQuery)) return new List(); + return QueryInternal(query); + } } public void Init(PluginInitContext context) { InitInternal(context); } + + + /// + /// Used to save settings + /// + public virtual string PluginId { + get { return null; } + } } } \ No newline at end of file diff --git a/Wox.Plugin.SystemPlugins/ISystemPlugin.cs b/Wox.Plugin.SystemPlugins/ISystemPlugin.cs index cd61777402..417f9d58f1 100644 --- a/Wox.Plugin.SystemPlugins/ISystemPlugin.cs +++ b/Wox.Plugin.SystemPlugins/ISystemPlugin.cs @@ -3,11 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Wox.Plugin.SystemPlugins -{ - public interface ISystemPlugin : IPlugin - { - string Name { get; } - string Description { get; } - } +namespace Wox.Plugin.SystemPlugins { + public interface ISystemPlugin : IPlugin { + string Name { get; } + string Description { get; } + } } diff --git a/Wox.Plugin/IPlugin.cs b/Wox.Plugin/IPlugin.cs index 69f2ba4835..e6603540cc 100644 --- a/Wox.Plugin/IPlugin.cs +++ b/Wox.Plugin/IPlugin.cs @@ -1,10 +1,13 @@ using System.Collections.Generic; -namespace Wox.Plugin -{ - public interface IPlugin - { - List Query(Query query); - void Init(PluginInitContext context); - } +namespace Wox.Plugin { + public interface IPlugin { + List Query(Query query); + void Init(PluginInitContext context); + + /// + /// Used when saving Plug-in settings + /// + string PluginId { get; } + } } \ No newline at end of file diff --git a/Wox/SettingWindow.xaml b/Wox/SettingWindow.xaml index e58ea5bc96..15801e6fd3 100644 --- a/Wox/SettingWindow.xaml +++ b/Wox/SettingWindow.xaml @@ -74,7 +74,7 @@ - +