mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +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()
|
||||
|
||||
@@ -60,6 +60,15 @@ namespace Microsoft.Plugin.Indexer.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Disable drive detection warning.
|
||||
/// </summary>
|
||||
public static string disable_drive_detection_warning {
|
||||
get {
|
||||
return ResourceManager.GetString("disable_drive_detection_warning", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Fail to set text in clipboard.
|
||||
/// </summary>
|
||||
@@ -151,7 +160,7 @@ namespace Microsoft.Plugin.Indexer.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Returns files and folders.
|
||||
/// Looks up a localized string similar to Searches files and folders..
|
||||
/// </summary>
|
||||
public static string Microsoft_plugin_indexer_plugin_description {
|
||||
get {
|
||||
@@ -160,7 +169,7 @@ namespace Microsoft.Plugin.Indexer.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Windows Indexer.
|
||||
/// Looks up a localized string similar to Windows Search.
|
||||
/// </summary>
|
||||
public static string Microsoft_plugin_indexer_plugin_name {
|
||||
get {
|
||||
|
||||
@@ -151,12 +151,15 @@
|
||||
<value>Fail to open folder at</value>
|
||||
</data>
|
||||
<data name="Microsoft_plugin_indexer_plugin_description" xml:space="preserve">
|
||||
<value>Returns files and folders</value>
|
||||
<value>Searches files and folders.</value>
|
||||
</data>
|
||||
<data name="Microsoft_plugin_indexer_plugin_name" xml:space="preserve">
|
||||
<value>Windows Indexer</value>
|
||||
<value>Windows Search</value>
|
||||
</data>
|
||||
<data name="Microsoft_plugin_indexer_subtitle_header" xml:space="preserve">
|
||||
<value>Search</value>
|
||||
</data>
|
||||
<data name="disable_drive_detection_warning" xml:space="preserve">
|
||||
<value>Disable drive detection warning</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -3,7 +3,6 @@
|
||||
"ActionKeyword": "?",
|
||||
"IsGlobal": true,
|
||||
"Name": "Windows Indexer",
|
||||
"Description": "Search for files and folders",
|
||||
"Author": "Microsoft",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
|
||||
Reference in New Issue
Block a user