Skip to content

Commit 59812a7

Browse files
authored
Merge branch 'dev' into l10n_dev
2 parents abeed1b + 0cfea2e commit 59812a7

File tree

6 files changed

+43
-12
lines changed

6 files changed

+43
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<ItemGroup>
5656
<PackageReference Include="Droplex" Version="1.7.0" />
57-
<PackageReference Include="FSharp.Core" Version="8.0.301" />
57+
<PackageReference Include="FSharp.Core" Version="8.0.401" />
5858
<PackageReference Include="Meziantou.Framework.Win32.Jobs" Version="3.4.0" />
5959
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
6060
<PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" />

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44
using System.Windows;
55
using System.Windows.Controls;
66
using System.Windows.Documents;
7+
using System.Windows.Forms;
78
using Flow.Launcher.Infrastructure.Storage;
89
using Flow.Launcher.Plugin;
10+
using CheckBox = System.Windows.Controls.CheckBox;
11+
using ComboBox = System.Windows.Controls.ComboBox;
12+
using Control = System.Windows.Controls.Control;
13+
using Orientation = System.Windows.Controls.Orientation;
14+
using TextBox = System.Windows.Controls.TextBox;
15+
using UserControl = System.Windows.Controls.UserControl;
916

1017
namespace Flow.Launcher.Core.Plugin
1118
{
@@ -224,6 +231,7 @@ public Control CreateSettingPanel()
224231
break;
225232
}
226233
case "inputWithFileBtn":
234+
case "inputWithFolderBtn":
227235
{
228236
var textBox = new TextBox()
229237
{
@@ -243,6 +251,24 @@ public Control CreateSettingPanel()
243251
Margin = new Thickness(10, 0, 0, 0), Content = "Browse"
244252
};
245253

254+
Btn.Click += (_, _) =>
255+
{
256+
using CommonDialog dialog = type switch
257+
{
258+
"inputWithFolderBtn" => new FolderBrowserDialog(),
259+
_ => new OpenFileDialog(),
260+
};
261+
if (dialog.ShowDialog() != DialogResult.OK) return;
262+
263+
var path = dialog switch
264+
{
265+
FolderBrowserDialog folderDialog => folderDialog.SelectedPath,
266+
OpenFileDialog fileDialog => fileDialog.FileName,
267+
};
268+
textBox.Text = path;
269+
Settings[attribute.Name] = path;
270+
};
271+
246272
var dockPanel = new DockPanel() { Margin = settingControlMargin };
247273

248274
DockPanel.SetDock(Btn, Dock.Right);

Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
6868
</PackageReference>
6969
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
70-
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
70+
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
7171
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
7272
</ItemGroup>
7373

Flow.Launcher/Flow.Launcher.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<PackageReference Include="NHotkey.Wpf" Version="3.0.0" />
9797
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
9898
<PackageReference Include="SemanticVersioning" Version="3.0.0-beta2" />
99-
<PackageReference Include="VirtualizingWrapPanel" Version="2.0.11" />
99+
<PackageReference Include="VirtualizingWrapPanel" Version="2.0.12" />
100100
</ItemGroup>
101101

102102
<ItemGroup>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</ItemGroup>
4646

4747
<ItemGroup>
48-
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
48+
<PackageReference Include="System.Data.OleDb" Version="8.0.1" />
4949
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
5050
<PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" />
5151
</ItemGroup>

Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,11 @@ internal async ValueTask<List<Result>> RequestUpdateAsync(string search, Cancell
203203
pluginFromLocalPath = Utilities.GetPluginInfoFromZip(search);
204204
pluginFromLocalPath.LocalInstallPath = search;
205205
updateFromLocalPath = true;
206-
}
206+
}
207207

208208
var updateSource = !updateFromLocalPath
209-
? PluginsManifest.UserPlugins
210-
: new List<UserPlugin> { pluginFromLocalPath };
209+
? PluginsManifest.UserPlugins
210+
: new List<UserPlugin> { pluginFromLocalPath };
211211

212212
var resultsForUpdate = (
213213
from existingPlugin in Context.API.GetAllPlugins()
@@ -291,7 +291,7 @@ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
291291
{
292292
downloadToFilePath = x.PluginNewUserPlugin.LocalInstallPath;
293293
}
294-
294+
295295

296296
PluginManager.UpdatePlugin(x.PluginExistingMetadata, x.PluginNewUserPlugin,
297297
downloadToFilePath);
@@ -327,7 +327,6 @@ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
327327
}, TaskContinuationOptions.OnlyOnFaulted);
328328

329329
return true;
330-
331330
},
332331
ContextData =
333332
new UserPlugin
@@ -513,7 +512,8 @@ internal List<Result> InstallFromLocalPath(string localPath)
513512
{
514513
if (!InstallSourceKnown(plugin.Website)
515514
&& MessageBox.Show(string.Format(
516-
Context.API.GetTranslation("plugin_pluginsmanager_install_unknown_source_warning"),
515+
Context.API.GetTranslation(
516+
"plugin_pluginsmanager_install_unknown_source_warning"),
517517
Environment.NewLine),
518518
Context.API.GetTranslation(
519519
"plugin_pluginsmanager_install_unknown_source_warning_title"),
@@ -532,7 +532,12 @@ internal List<Result> InstallFromLocalPath(string localPath)
532532

533533
private bool InstallSourceKnown(string url)
534534
{
535-
var author = url.Split('/')[3];
535+
var pieces = url.Split('/');
536+
537+
if (pieces.Length < 4)
538+
return false;
539+
540+
var author = pieces[3];
536541
var acceptedSource = "https://github.com";
537542
var constructedUrlPart = string.Format("{0}/{1}/", acceptedSource, author);
538543

@@ -589,7 +594,7 @@ private void Install(UserPlugin plugin, string downloadedFilePath)
589594
try
590595
{
591596
PluginManager.InstallPlugin(plugin, downloadedFilePath);
592-
597+
593598
if (!plugin.IsFromLocalInstallPath)
594599
File.Delete(downloadedFilePath);
595600
}

0 commit comments

Comments
 (0)