mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Show message box with button instead
This commit is contained in:
parent
b5baf3ebea
commit
69d5e33150
2 changed files with 15 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
|
|
@ -327,17 +328,20 @@ public static class PluginInstaller
|
|||
return;
|
||||
}
|
||||
|
||||
if (API.ShowMsgBox(
|
||||
string.Format(API.GetTranslation("updateAllPluginsSubtitle"),
|
||||
Environment.NewLine, string.Join(", ", resultsForUpdate.Select(x => x.PluginExistingMetadata.Name))),
|
||||
// Show message box with button to update all plugins
|
||||
API.ShowMsgWithButton(
|
||||
API.GetTranslation("updateAllPluginsTitle"),
|
||||
MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
API.GetTranslation("updateAllPluginsButtonContent"),
|
||||
() =>
|
||||
{
|
||||
UpdateAllPlugins(resultsForUpdate);
|
||||
},
|
||||
string.Join(", ", resultsForUpdate.Select(x => x.PluginExistingMetadata.Name)));
|
||||
}
|
||||
|
||||
// Update all plugins
|
||||
await Task.WhenAll(resultsForUpdate.Select(async plugin =>
|
||||
private static void UpdateAllPlugins(IEnumerable<dynamic> resultsForUpdate)
|
||||
{
|
||||
_ = Task.WhenAll(resultsForUpdate.Select(async plugin =>
|
||||
{
|
||||
var downloadToFilePath = Path.Combine(Path.GetTempPath(), $"{plugin.Name}-{plugin.NewVersion}.zip");
|
||||
|
||||
|
|
|
|||
|
|
@ -235,8 +235,8 @@
|
|||
<system:String x:Key="installLocalPluginTooltip">Install plugin from local path</system:String>
|
||||
<system:String x:Key="updateNoResultTitle">No update available</system:String>
|
||||
<system:String x:Key="updateNoResultSubtitle">All plugins are up to date</system:String>
|
||||
<system:String x:Key="updateAllPluginsTitle">Update all plugins</system:String>
|
||||
<system:String x:Key="updateAllPluginsSubtitle">Would you like to update these plugins?{0}{0}{1}</system:String>
|
||||
<system:String x:Key="updateAllPluginsTitle">Plugin updates available</system:String>
|
||||
<system:String x:Key="updateAllPluginsButtonContent">Update all plugins</system:String>
|
||||
<system:String x:Key="checkPluginUpdatesTooltip">Check plugin updates</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue