Skip to content

Commit 0eef6c2

Browse files
authored
Merge pull request #231 from Flow-Launcher/add_pluginsmanager
Add PluginsManager for managing PluginsManifest repo
2 parents 0928b05 + d69337c commit 0eef6c2

35 files changed

+627
-672
lines changed

Flow.Launcher.Core/Flow.Launcher.Core.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
<ItemGroup>
5656
<PackageReference Include="FSharp.Core" Version="4.7.1" />
5757
<PackageReference Include="squirrel.windows" Version="1.5.2" />
58-
<PackageReference Include="SharpZipLib" Version="1.2.0" />
5958
</ItemGroup>
6059

6160
<ItemGroup>

Flow.Launcher.Core/Plugin/PluginInstaller.cs

Lines changed: 0 additions & 169 deletions
This file was deleted.

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ public static void InitializePlugins(IPublicAPI api)
133133
}
134134
}
135135

136-
public static void InstallPlugin(string path)
137-
{
138-
PluginInstaller.Install(path);
139-
}
140-
141136
public static List<PluginPair> ValidPluginsForQuery(Query query)
142137
{
143138
if (NonGlobalPlugins.ContainsKey(query.ActionKeyword))

Flow.Launcher.Infrastructure/Http/Http.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,12 @@ public static async Task<string> Get([NotNull] string url, string encoding = "UT
6666
response = response.NonNull();
6767
var stream = response.GetResponseStream().NonNull();
6868

69-
using (var reader = new StreamReader(stream, Encoding.GetEncoding(encoding)))
70-
{
71-
var content = await reader.ReadToEndAsync();
72-
if (response.StatusCode == HttpStatusCode.OK)
73-
{
74-
return content;
75-
}
76-
else
77-
{
78-
throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
79-
}
80-
}
69+
using var reader = new StreamReader(stream, Encoding.GetEncoding(encoding));
70+
var content = await reader.ReadToEndAsync();
71+
if (response.StatusCode != HttpStatusCode.OK)
72+
throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
73+
74+
return content;
8175
}
8276
}
8377
}

Flow.Launcher.Plugin/IPublicAPI.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@ public interface IPublicAPI
6363
/// </summary>
6464
void OpenSettingDialog();
6565

66-
/// <summary>
67-
/// Install Flow Launcher plugin
68-
/// </summary>
69-
/// <param name="path">Plugin path (ends with .flowlauncher)</param>
70-
void InstallPlugin(string path);
71-
7266
/// <summary>
7367
/// Get translation of current language
7468
/// You need to implement IPluginI18n if you want to support multiple languages for your plugin

Flow.Launcher.sln

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launc
1515
ProjectSection(ProjectDependencies) = postProject
1616
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}
1717
{0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {0B9DE348-9361-4940-ADB6-F5953BFFCCEC}
18+
{4792A74A-0CEA-4173-A8B2-30E6764C6217} = {4792A74A-0CEA-4173-A8B2-30E6764C6217}
1819
{FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {FDB3555B-58EF-4AE6-B5F1-904719637AB4}
1920
{F9C4C081-4CC3-4146-95F1-E102B4E10A5F} = {F9C4C081-4CC3-4146-95F1-E102B4E10A5F}
2021
{59BD9891-3837-438A-958D-ADC7F91F6F7E} = {59BD9891-3837-438A-958D-ADC7F91F6F7E}
@@ -23,15 +24,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launc
2324
{9B130CC5-14FB-41FF-B310-0A95B6894C37} = {9B130CC5-14FB-41FF-B310-0A95B6894C37}
2425
{FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {FDED22C8-B637-42E8-824A-63B5B6E05A3A}
2526
{A3DCCBCA-ACC1-421D-B16E-210896234C26} = {A3DCCBCA-ACC1-421D-B16E-210896234C26}
26-
{049490F0-ECD2-4148-9B39-2135EC346EBE} = {049490F0-ECD2-4148-9B39-2135EC346EBE}
2727
{403B57F2-1856-4FC7-8A24-36AB346B763E} = {403B57F2-1856-4FC7-8A24-36AB346B763E}
2828
{588088F4-3262-4F9F-9663-A05DE12534C3} = {588088F4-3262-4F9F-9663-A05DE12534C3}
2929
EndProjectSection
3030
EndProject
3131
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Infrastructure", "Flow.Launcher.Infrastructure\Flow.Launcher.Infrastructure.csproj", "{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}"
3232
EndProject
33-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.PluginManagement", "Plugins\Flow.Launcher.Plugin.PluginManagement\Flow.Launcher.Plugin.PluginManagement.csproj", "{049490F0-ECD2-4148-9B39-2135EC346EBE}"
34-
EndProject
3533
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Core", "Flow.Launcher.Core\Flow.Launcher.Core.csproj", "{B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}"
3634
EndProject
3735
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Program", "Plugins\Flow.Launcher.Plugin.Program\Flow.Launcher.Plugin.Program.csproj", "{FDB3555B-58EF-4AE6-B5F1-904719637AB4}"
@@ -71,6 +69,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Explor
7169
EndProject
7270
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.ProcessKiller", "Plugins\Flow.Launcher.Plugin.ProcessKiller\Flow.Launcher.Plugin.ProcessKiller.csproj", "{588088F4-3262-4F9F-9663-A05DE12534C3}"
7371
EndProject
72+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.PluginsManager", "Plugins\Flow.Launcher.Plugin.PluginsManager\Flow.Launcher.Plugin.PluginsManager.csproj", "{4792A74A-0CEA-4173-A8B2-30E6764C6217}"
73+
EndProject
7474
Global
7575
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7676
Debug|Any CPU = Debug|Any CPU
@@ -129,18 +129,6 @@ Global
129129
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Release|x64.Build.0 = Release|Any CPU
130130
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Release|x86.ActiveCfg = Release|Any CPU
131131
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Release|x86.Build.0 = Release|Any CPU
132-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
133-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
134-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Debug|x64.ActiveCfg = Debug|Any CPU
135-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Debug|x64.Build.0 = Debug|Any CPU
136-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Debug|x86.ActiveCfg = Debug|Any CPU
137-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Debug|x86.Build.0 = Debug|Any CPU
138-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
139-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Release|Any CPU.Build.0 = Release|Any CPU
140-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Release|x64.ActiveCfg = Release|Any CPU
141-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Release|x64.Build.0 = Release|Any CPU
142-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Release|x86.ActiveCfg = Release|Any CPU
143-
{049490F0-ECD2-4148-9B39-2135EC346EBE}.Release|x86.Build.0 = Release|Any CPU
144132
{B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
145133
{B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
146134
{B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -298,12 +286,23 @@ Global
298286
{588088F4-3262-4F9F-9663-A05DE12534C3}.Release|x64.Build.0 = Release|Any CPU
299287
{588088F4-3262-4F9F-9663-A05DE12534C3}.Release|x86.ActiveCfg = Release|Any CPU
300288
{588088F4-3262-4F9F-9663-A05DE12534C3}.Release|x86.Build.0 = Release|Any CPU
289+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
290+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Debug|Any CPU.Build.0 = Debug|Any CPU
291+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Debug|x64.ActiveCfg = Debug|Any CPU
292+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Debug|x64.Build.0 = Debug|Any CPU
293+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Debug|x86.ActiveCfg = Debug|Any CPU
294+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Debug|x86.Build.0 = Debug|Any CPU
295+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|Any CPU.ActiveCfg = Release|Any CPU
296+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|Any CPU.Build.0 = Release|Any CPU
297+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x64.ActiveCfg = Release|Any CPU
298+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x64.Build.0 = Release|Any CPU
299+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.ActiveCfg = Release|Any CPU
300+
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.Build.0 = Release|Any CPU
301301
EndGlobalSection
302302
GlobalSection(SolutionProperties) = preSolution
303303
HideSolutionNode = FALSE
304304
EndGlobalSection
305305
GlobalSection(NestedProjects) = preSolution
306-
{049490F0-ECD2-4148-9B39-2135EC346EBE} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
307306
{FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
308307
{403B57F2-1856-4FC7-8A24-36AB346B763E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
309308
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
@@ -316,6 +315,7 @@ Global
316315
{59BD9891-3837-438A-958D-ADC7F91F6F7E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
317316
{F9C4C081-4CC3-4146-95F1-E102B4E10A5F} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
318317
{588088F4-3262-4F9F-9663-A05DE12534C3} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
318+
{4792A74A-0CEA-4173-A8B2-30E6764C6217} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
319319
EndGlobalSection
320320
GlobalSection(ExtensibilityGlobals) = postSolution
321321
SolutionGuid = {F26ACB50-3F6C-4907-B0C9-1ADACC1D0DED}

Flow.Launcher/MainWindow.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
Loaded="OnLoaded"
2323
Initialized="OnInitialized"
2424
Closing="OnClosing"
25-
Drop="OnDrop"
2625
LocationChanged="OnLocationChanged"
2726
Deactivated="OnDeactivated"
2827
PreviewKeyDown="OnKeyDown"

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -199,24 +199,6 @@ private void OnPreviewMouseButtonDown(object sender, MouseButtonEventArgs e)
199199
}
200200
}
201201

202-
private void OnDrop(object sender, DragEventArgs e)
203-
{
204-
if (e.Data.GetDataPresent(DataFormats.FileDrop))
205-
{
206-
// Note that you can have more than one file.
207-
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
208-
if (files[0].ToLower().EndsWith(".flowlauncher"))
209-
{
210-
PluginManager.InstallPlugin(files[0]);
211-
}
212-
else
213-
{
214-
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidFlowLauncherPluginFileFormat"));
215-
}
216-
}
217-
e.Handled = false;
218-
}
219-
220202
private void OnPreviewDragOver(object sender, DragEventArgs e)
221203
{
222204
e.Handled = true;

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ public void StopLoadingBar()
115115
_mainVM.ProgressBarVisibility = Visibility.Collapsed;
116116
}
117117

118-
public void InstallPlugin(string path)
119-
{
120-
Application.Current.Dispatcher.Invoke(() => PluginManager.InstallPlugin(path));
121-
}
122-
123118
public string GetTranslation(string key)
124119
{
125120
return InternationalizationManager.Instance.GetTranslation(key);

0 commit comments

Comments
 (0)