From c360e6b6a722a8c66989ee08879fe32a8d9fd719 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sat, 6 Apr 2024 17:35:30 +0200 Subject: [PATCH] MainWindow: Add feedback for users when App.CheckForUpdates finds no updates --- Elwig/App.xaml.cs | 7 +++++-- Elwig/Windows/MainWindow.xaml.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Elwig/App.xaml.cs b/Elwig/App.xaml.cs index c593abe..d5e3281 100644 --- a/Elwig/App.xaml.cs +++ b/Elwig/App.xaml.cs @@ -212,11 +212,11 @@ namespace Elwig { if (w is UpdateDialog) return; } if (Utils.HasInternetConnectivity()) { - Utils.RunBackground("Auto Updater", CheckForUpdates); + Utils.RunBackground("Auto Updater", async () => await CheckForUpdates()); } } - public static async Task CheckForUpdates() { + public static async Task CheckForUpdates(bool showSuccess = false) { if (Config.UpdateUrl == null) return; var latest = await Utils.GetLatestInstallerUrl(Config.UpdateUrl); if (latest != null && new Version(latest.Value.Version) > new Version(Version)) { @@ -227,6 +227,9 @@ namespace Elwig { Current.Shutdown(); } }); + } else if (showSuccess) { + MessageBox.Show("Elwig ist auf dem aktuellsten Stand!", "Nach Updates suchen", + MessageBoxButton.OK, MessageBoxImage.Information); } } diff --git a/Elwig/Windows/MainWindow.xaml.cs b/Elwig/Windows/MainWindow.xaml.cs index 6d8c19e..2a30b8f 100644 --- a/Elwig/Windows/MainWindow.xaml.cs +++ b/Elwig/Windows/MainWindow.xaml.cs @@ -41,7 +41,7 @@ namespace Elwig.Windows { } private async void Menu_Help_Update_Click(object sender, RoutedEventArgs evt) { - await App.CheckForUpdates(); + await App.CheckForUpdates(true); } private async void Menu_Help_Smtp_Click(object sender, RoutedEventArgs evt) {