[PowerToys Run] Plugin manager (#9872)

This commit is contained in:
Mykhailo Pylyp
2021-02-26 13:21:58 +02:00
committed by GitHub
parent f839a408de
commit 4a9e920a1c
66 changed files with 749 additions and 276 deletions

View File

@@ -23,6 +23,7 @@ namespace Microsoft.Plugin.Indexer
{
internal class Main : ISettingProvider, IPlugin, ISavable, IPluginI18n, IContextMenu, IDisposable, IDelayedExecutionPlugin
{
private const string DisableDriveDetectionWarning = nameof(DisableDriveDetectionWarning);
private static readonly IFileSystem _fileSystem = new FileSystem();
// This variable contains metadata about the Plugin
@@ -46,6 +47,20 @@ namespace Microsoft.Plugin.Indexer
private string WarningIconPath { get; set; }
public string Name => Properties.Resources.Microsoft_plugin_indexer_plugin_name;
public string Description => Properties.Resources.Microsoft_plugin_indexer_plugin_description;
public IEnumerable<PluginAdditionalOption> AdditionalOptions => new List<PluginAdditionalOption>()
{
new PluginAdditionalOption()
{
Key = DisableDriveDetectionWarning,
DisplayLabel = Properties.Resources.disable_drive_detection_warning,
Value = false,
},
};
private IContextMenu _contextMenuLoader;
private bool disposedValue;
@@ -210,9 +225,10 @@ namespace Microsoft.Plugin.Indexer
return _contextMenuLoader.LoadContextMenus(selectedResult);
}
public void UpdateSettings(PowerLauncherSettings settings)
public void UpdateSettings(PowerLauncherPluginSettings settings)
{
_driveDetection.IsDriveDetectionWarningCheckBoxSelected = settings.Properties.DisableDriveDetectionWarning;
var option = settings.AdditionalOptions.FirstOrDefault(x => x.Key == DisableDriveDetectionWarning);
_driveDetection.IsDriveDetectionWarningCheckBoxSelected = option == null ? false : option.Value;
}
public Control CreateSettingPanel()