mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
#21 Add Disable option for each plugin.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins
|
||||
{
|
||||
@@ -6,6 +8,8 @@ namespace Wox.Plugin.SystemPlugins
|
||||
public abstract class BaseSystemPlugin : ISystemPlugin
|
||||
{
|
||||
public string PluginDirectory { get; set; }
|
||||
|
||||
public abstract string ID { get; }
|
||||
public virtual string Name { get { return "System workflow"; } }
|
||||
public virtual string Description { get { return "System workflow"; } }
|
||||
public virtual string IcoPath { get { return null; } }
|
||||
@@ -17,6 +21,11 @@ namespace Wox.Plugin.SystemPlugins
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
if (string.IsNullOrEmpty(query.RawQuery)) return new List<Result>();
|
||||
var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == ID);
|
||||
if (customizedPluginConfig != null && customizedPluginConfig.Disabled)
|
||||
{
|
||||
return new List<Result>();
|
||||
}
|
||||
return QueryInternal(query);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user