Skip to content

Commit 69d5e33

Browse files
committed
Show message box with button instead
1 parent b5baf3e commit 69d5e33

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

Flow.Launcher.Core/Plugin/PluginInstaller.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.IO;
34
using System.IO.Compression;
45
using System.Linq;
@@ -327,17 +328,20 @@ where string.Compare(existingPlugin.Metadata.Version, pluginUpdateSource.Version
327328
return;
328329
}
329330

330-
if (API.ShowMsgBox(
331-
string.Format(API.GetTranslation("updateAllPluginsSubtitle"),
332-
Environment.NewLine, string.Join(", ", resultsForUpdate.Select(x => x.PluginExistingMetadata.Name))),
331+
// Show message box with button to update all plugins
332+
API.ShowMsgWithButton(
333333
API.GetTranslation("updateAllPluginsTitle"),
334-
MessageBoxButton.YesNo) == MessageBoxResult.No)
335-
{
336-
return;
337-
}
334+
API.GetTranslation("updateAllPluginsButtonContent"),
335+
() =>
336+
{
337+
UpdateAllPlugins(resultsForUpdate);
338+
},
339+
string.Join(", ", resultsForUpdate.Select(x => x.PluginExistingMetadata.Name)));
340+
}
338341

339-
// Update all plugins
340-
await Task.WhenAll(resultsForUpdate.Select(async plugin =>
342+
private static void UpdateAllPlugins(IEnumerable<dynamic> resultsForUpdate)
343+
{
344+
_ = Task.WhenAll(resultsForUpdate.Select(async plugin =>
341345
{
342346
var downloadToFilePath = Path.Combine(Path.GetTempPath(), $"{plugin.Name}-{plugin.NewVersion}.zip");
343347

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@
235235
<system:String x:Key="installLocalPluginTooltip">Install plugin from local path</system:String>
236236
<system:String x:Key="updateNoResultTitle">No update available</system:String>
237237
<system:String x:Key="updateNoResultSubtitle">All plugins are up to date</system:String>
238-
<system:String x:Key="updateAllPluginsTitle">Update all plugins</system:String>
239-
<system:String x:Key="updateAllPluginsSubtitle">Would you like to update these plugins?{0}{0}{1}</system:String>
238+
<system:String x:Key="updateAllPluginsTitle">Plugin updates available</system:String>
239+
<system:String x:Key="updateAllPluginsButtonContent">Update all plugins</system:String>
240240
<system:String x:Key="checkPluginUpdatesTooltip">Check plugin updates</system:String>
241241

242242
<!-- Setting Theme -->

0 commit comments

Comments
 (0)