Skip to content

Commit c56a275

Browse files
authored
Merge pull request #1097 from Flow-Launcher/explorerMerge
Merge Explorer & Everything Plugins
2 parents 4d712a1 + bcc8013 commit c56a275

File tree

59 files changed

+4353
-1148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4353
-1148
lines changed

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ public interface IPublicAPI
183183
/// <param name="oldActionKeyword">The actionkeyword that is supposed to be removed</param>
184184
void RemoveActionKeyword(string pluginId, string oldActionKeyword);
185185

186+
/// <summary>
187+
/// Check whether specific ActionKeyword is assigned to any of the plugin
188+
/// </summary>
189+
/// <param name="actionKeyword">The actionkeyword for checking</param>
190+
/// <returns>True if the actionkeyword is already assigned, False otherwise</returns>
191+
bool ActionKeywordAssigned(string actionKeyword);
192+
186193
/// <summary>
187194
/// Log debug message
188195
/// Message will only be logged in Debug mode

Flow.Launcher.Test/Plugins/ExplorerTest.cs

Lines changed: 45 additions & 111 deletions
Large diffs are not rendered by default.

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ private void OnKeyDown(object sender, KeyEventArgs e)
608608
&& QueryTextBox.CaretIndex == QueryTextBox.Text.Length)
609609
{
610610
var queryWithoutActionKeyword =
611-
QueryBuilder.Build(QueryTextBox.Text.Trim(), PluginManager.NonGlobalPlugins).Search;
611+
QueryBuilder.Build(QueryTextBox.Text.Trim(), PluginManager.NonGlobalPlugins)?.Search;
612612

613613
if (FilesFolders.IsLocationPathString(queryWithoutActionKeyword))
614614
{

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath,
141141
public void AddActionKeyword(string pluginId, string newActionKeyword) =>
142142
PluginManager.AddActionKeyword(pluginId, newActionKeyword);
143143

144+
public bool ActionKeywordAssigned(string actionKeyword) => PluginManager.ActionKeywordRegistered(actionKeyword);
145+
144146
public void RemoveActionKeyword(string pluginId, string oldActionKeyword) =>
145147
PluginManager.RemoveActionKeyword(pluginId, oldActionKeyword);
146148

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Lines changed: 134 additions & 44 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#nullable enable
2+
3+
using System;
4+
using System.Threading.Tasks;
5+
using System.Windows;
6+
using Flow.Launcher.Plugin.Explorer.Search.IProvider;
7+
using JetBrains.Annotations;
8+
9+
namespace Flow.Launcher.Plugin.Explorer.Exceptions;
10+
11+
public class EngineNotAvailableException : Exception
12+
{
13+
public string EngineName { get; }
14+
public string Resolution { get; }
15+
public Func<ActionContext, ValueTask<bool>>? Action { get; }
16+
17+
public string? ErrorIcon { get; init; }
18+
19+
public EngineNotAvailableException(
20+
string engineName,
21+
string resolution,
22+
string message,
23+
Func<ActionContext, ValueTask<bool>> action = null) : base(message)
24+
{
25+
EngineName = engineName;
26+
Resolution = resolution;
27+
Action = action ?? (_ =>
28+
{
29+
Clipboard.SetDataObject(this.ToString());
30+
return ValueTask.FromResult(true);
31+
});
32+
}
33+
34+
public EngineNotAvailableException(
35+
string engineName,
36+
string resolution,
37+
string message,
38+
Exception innerException) : base(message, innerException)
39+
{
40+
EngineName = engineName;
41+
Resolution = resolution;
42+
}
43+
44+
public override string ToString()
45+
{
46+
return $"Engine {EngineName} is not available.\n Try to {Resolution}\n {base.ToString()}";
47+
}
48+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
3+
namespace Flow.Launcher.Plugin.Explorer.Exceptions
4+
{
5+
public class SearchException : Exception
6+
{
7+
public string EngineName { get; }
8+
public SearchException(string engineName, string message) : base(message)
9+
{
10+
EngineName = engineName;
11+
}
12+
13+
public SearchException(string engineName, string message, Exception innerException) : base(message, innerException)
14+
{
15+
EngineName = engineName;
16+
}
17+
18+
public override string ToString()
19+
{
20+
return $"{EngineName} Search Exception:\n {base.ToString()}";
21+
}
22+
}
23+
}

Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
99
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1010
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
11+
<Nullable>warnings</Nullable>
1112
<ApplicationIcon />
1213
<StartupObject />
1314
</PropertyGroup>
@@ -24,6 +25,12 @@
2425
<None Include="plugin.json">
2526
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2627
</None>
28+
<None Update="EverythingSDK\x64\Everything.dll">
29+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30+
</None>
31+
<None Update="EverythingSDK\x86\Everything.dll">
32+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
33+
</None>
2734
</ItemGroup>
2835

2936
<ItemGroup>
@@ -39,6 +46,7 @@
3946

4047
<ItemGroup>
4148
<PackageReference Include="System.Data.OleDb" Version="5.0.0" />
49+
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
4250
<PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" />
4351
</ItemGroup>
4452

@@ -47,5 +55,5 @@
4755
<ProjectReference Include="..\..\Flow.Launcher.Infrastructure\Flow.Launcher.Infrastructure.csproj" />
4856
<ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
4957
</ItemGroup>
50-
58+
5159
</Project>

0 commit comments

Comments
 (0)