Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PowerToys Run] Plugin manager #9872

Merged
merged 20 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b37f70e
Basic settings for Plugin Manager (#9650)
mykhailopylyp Feb 12, 2021
7a3e85c
[Settings] Plugin manager UX fixes (#9715)
niels9001 Feb 15, 2021
f5a15a2
Localize name and description (#9685)
mykhailopylyp Feb 15, 2021
51a6f3a
[Run] [Plugin manager] Updated plugins listview selection logic (#9735)
niels9001 Feb 16, 2021
0811006
Show warning when plugin is not accessible (#9747)
mykhailopylyp Feb 19, 2021
9a28d11
Possibility to use the same action keyword for more than one plugin (…
mykhailopylyp Feb 19, 2021
dbc057c
Move plugin specific options under pluigin settings (#9781)
mykhailopylyp Feb 19, 2021
c239067
fix indexer name (#9833)
mykhailopylyp Feb 22, 2021
6ee3721
rename windows indexer to window search (#9857)
mykhailopylyp Feb 24, 2021
c0e959f
[Run] [Plugin manager] UI fixes (#9838)
mykhailopylyp Feb 24, 2021
e4cb5ef
fix plugins' descriptions
mykhailopylyp Feb 24, 2021
f0ae6d7
fix plugin descriptions
mykhailopylyp Feb 24, 2021
e910315
Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/…
mykhailopylyp Feb 24, 2021
ef98def
Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/…
mykhailopylyp Feb 24, 2021
9ad8d87
disable plugin options when plugin is disabled (#9880)
mykhailopylyp Feb 24, 2021
aa2d49e
fix navigation from additional panel (#9878)
mykhailopylyp Feb 25, 2021
bccf0d7
fix uri plugin name and description
mykhailopylyp Feb 25, 2021
8d71b32
removed etc. from descriptions
mykhailopylyp Feb 25, 2021
ea8e7da
modify descriptions, add description to plugins section
mykhailopylyp Feb 25, 2021
fcbbf19
Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/…
mykhailopylyp Feb 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace Microsoft.Plugin.Folder
{
public class Main : IPlugin, ISettingProvider, IPluginI18n, ISavable, IContextMenu, IDisposable
public class Main : IPlugin, IPluginI18n, ISavable, IContextMenu, IDisposable
{
public const string FolderImagePath = "Images\\folder.dark.png";
public const string FileImagePath = "Images\\file.dark.png";
Expand All @@ -38,6 +38,10 @@ public class Main : IPlugin, ISettingProvider, IPluginI18n, ISavable, IContextMe
private IContextMenu _contextMenuLoader;
private bool _disposed;

public string Name => Properties.Resources.wox_plugin_folder_plugin_name;

public string Description => Properties.Resources.wox_plugin_folder_plugin_description;

public void Save()
{
_storage.Save();
Expand Down Expand Up @@ -119,10 +123,6 @@ public List<ContextMenuResult> LoadContextMenus(Result selectedResult)
return _contextMenuLoader.LoadContextMenus(selectedResult);
}

public void UpdateSettings(PowerLauncherSettings settings)
{
}

public void Dispose()
{
Dispose(disposing: true);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<value>Folder</value>
</data>
<data name="wox_plugin_folder_plugin_description" xml:space="preserve">
<value>Open favorite folder from PowerToys Run directly</value>
<value>Navigates folders starting from a drive letter 'C:\' or from the user home '~'.</value>
</data>
<data name="Microsoft_plugin_folder_copy_path" xml:space="preserve">
<value>Copy path (Ctrl+C)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"ActionKeyword": "",
"IsGlobal": true,
"Name": "Folder",
"Description": "Search and open folders",
"Author": "qianlifeng",
"Version": "1.0.0",
"Language": "csharp",
Expand Down
20 changes: 18 additions & 2 deletions src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,6 +47,20 @@ internal class Main : ISettingProvider, IPlugin, ISavable, IPluginI18n, IContext

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;

Expand Down Expand Up @@ -210,9 +225,10 @@ public List<ContextMenuResult> LoadContextMenus(Result selectedResult)
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()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"ActionKeyword": "?",
"IsGlobal": true,
"Name": "Windows Indexer",
"Description": "Search for files and folders",
"Author": "Microsoft",
"Version": "1.0.0",
"Language": "csharp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ public void ProgramArgumentParserTestsCanParseQuery(string inputQuery, string ex
new NoArgumentsArgumentParser(),
};

// basic version of the Quey parser which can be found at Wox.Core.Plugin.QueryBuilder but did not want to create a project reference
var splittedSearchString = inputQuery?.Split(Query.TermSeparator, System.StringSplitOptions.RemoveEmptyEntries);
var cleanQuery = string.Join(Query.TermSeparator, splittedSearchString);
var query = new Query(cleanQuery, cleanQuery, new ReadOnlyCollection<string>(splittedSearchString), string.Empty);
var query = new Query(inputQuery);

// Act
string program = null, programArguments = null;
Expand Down
4 changes: 4 additions & 0 deletions src/modules/launcher/Plugins/Microsoft.Plugin.Program/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public class Main : IPlugin, IPluginI18n, IContextMenu, ISavable, IReloadable, I

internal static ProgramPluginSettings Settings { get; set; }

public string Name => Properties.Resources.wox_plugin_program_plugin_name;

public string Description => Properties.Resources.wox_plugin_program_plugin_description;

private static PluginInitContext _context;
private readonly PluginJsonStorage<ProgramPluginSettings> _settingsStorage;
private bool _disposed;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<value>Program</value>
</data>
<data name="wox_plugin_program_plugin_description" xml:space="preserve">
<value>Search programs in PowerToys Run</value>
<value>Searches programs.</value>
</data>
<data name="powertoys_run_plugin_program_win32_application" xml:space="preserve">
<value>Application</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"ActionKeyword": ".",
"IsGlobal": true,
"Name": "Program",
"Description": "Search for programs",
"Author": "qianlifeng",
"Version": "1.0.0",
"Language": "csharp",
Expand Down
10 changes: 5 additions & 5 deletions src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace Microsoft.Plugin.Shell
{
public class Main : IPlugin, ISettingProvider, IPluginI18n, IContextMenu, ISavable
public class Main : IPlugin, IPluginI18n, IContextMenu, ISavable
{
private static readonly IFileSystem FileSystem = new FileSystem();
private static readonly IPath Path = FileSystem.Path;
Expand All @@ -34,6 +34,10 @@ public class Main : IPlugin, ISettingProvider, IPluginI18n, IContextMenu, ISavab

private string IconPath { get; set; }

public string Name => Properties.Resources.wox_plugin_cmd_plugin_name;

public string Description => Properties.Resources.wox_plugin_cmd_plugin_description;

private PluginInitContext _context;

public Main()
Expand Down Expand Up @@ -331,9 +335,5 @@ public List<ContextMenuResult> LoadContextMenus(Result selectedResult)

return resultlist;
}

public void UpdateSettings(PowerLauncherSettings settings)
{
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<value>Shell</value>
</data>
<data name="wox_plugin_cmd_plugin_description" xml:space="preserve">
<value>Allows to execute system commands from PowerToys Run. Commands should start with &gt;</value>
<value>Executes commands (e.g 'ping', 'cmd').</value>
</data>
<data name="wox_plugin_cmd_cmd_has_been_executed_times" xml:space="preserve">
<value>this command has been executed {0} times</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"ActionKeyword": ">",
"IsGlobal": false,
"Name": "Shell",
"Description": "Provide executing commands. Commands should start with >",
"Author": "qianlifeng",
"Version": "1.0.0",
"Language": "csharp",
Expand Down
4 changes: 4 additions & 0 deletions src/modules/launcher/Plugins/Microsoft.Plugin.Uri/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public Main()

public PluginInitContext Context { get; protected set; }

public string Name => Properties.Resources.Microsoft_plugin_uri_plugin_name;

public string Description => Properties.Resources.Microsoft_plugin_uri_plugin_description;

public List<ContextMenuResult> LoadContextMenus(Result selectedResult)
{
return new List<ContextMenuResult>(0);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@
<value>Failed to open URL</value>
</data>
<data name="Microsoft_plugin_uri_plugin_description" xml:space="preserve">
<value>Handles urls</value>
<value>Opens URLs and UNC network shares.</value>
</data>
<data name="Microsoft_plugin_uri_plugin_name" xml:space="preserve">
<value>Url Handler</value>
<value>URI Handler</value>
</data>
<data name="Microsoft_plugin_uri_website" xml:space="preserve">
<value>Open in browser</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"ActionKeyword": "//",
"IsGlobal": true,
"Name": "Windows Uri Handler",
"Description": "Handles urls",
"Author": "Microsoft",
"Version": "1.0.0",
"Language": "csharp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public class Main : IPlugin, IPluginI18n

private PluginInitContext Context { get; set; }

public string Name => Properties.Resources.wox_plugin_windowwalker_plugin_name;

public string Description => Properties.Resources.wox_plugin_windowwalker_plugin_description;

static Main()
{
SearchController.Instance.OnSearchResultUpdateEventHandler += SearchResultUpdated;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<value>Window Walker</value>
</data>
<data name="wox_plugin_windowwalker_plugin_description" xml:space="preserve">
<value>Alt-Tab alternative enabling searching through your windows.</value>
<value>Switches between open windows.</value>
</data>
<data name="wox_plugin_windowwalker_running" xml:space="preserve">
<value>Running</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"ActionKeyword": "<",
"IsGlobal": true,
"Name": "Window Walker",
"Description": "Alt-Tab alternative enabling searching through your windows.",
"Author": "betadele",
"Version": "1.0.0",
"Language": "csharp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public class Main : IPlugin, IPluginI18n, IDisposable

private string IconPath { get; set; }

public string Name => Properties.Resources.wox_plugin_calculator_plugin_name;

public string Description => Properties.Resources.wox_plugin_calculator_plugin_description;

private bool _disposed;

public List<Result> Query(Query query)
Expand Down
Loading