mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[PowerToys Run] Plugin manager (#9872)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user