diff --git a/CHANGELIST.md b/CHANGELIST.md index fbfa3693..edabb93b 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -9,6 +9,7 @@ - Add horizontal scroll to user input - Tweak new disc information fields and tabs - Allow internal serial and volume label to be hidden +- Be smarter about showing update checks ### 2.2 (2021-12-30) - Fix Saturn header finding diff --git a/MPF/ViewModels/MainViewModel.cs b/MPF/ViewModels/MainViewModel.cs index 1e603eb5..7c605d67 100644 --- a/MPF/ViewModels/MainViewModel.cs +++ b/MPF/ViewModels/MainViewModel.cs @@ -86,7 +86,7 @@ namespace MPF.GUI.ViewModels // Check for updates, if necessary if (App.Options.CheckForUpdatesOnStartup) - CheckForUpdates(); + CheckForUpdates(showIfSame: false); } #region Population @@ -209,7 +209,8 @@ namespace MPF.GUI.ViewModels /// /// Check for available updates /// - public void CheckForUpdates() + /// True to show the box even if it's the same, false to only show if it's different + public void CheckForUpdates(bool showIfSame) { (bool different, string message, string url) = Tools.CheckForNewVersion(); @@ -221,7 +222,8 @@ namespace MPF.GUI.ViewModels if (url == null) message = "An exception occurred while checking for versions, please try again later. See the log window for more details."; - CustomMessageBox.Show(App.Instance, message, "Version Update Check", MessageBoxButton.OK, different ? MessageBoxImage.Exclamation : MessageBoxImage.Information); + if (showIfSame || different) + CustomMessageBox.Show(App.Instance, message, "Version Update Check", MessageBoxButton.OK, different ? MessageBoxImage.Exclamation : MessageBoxImage.Information); } /// @@ -1247,7 +1249,7 @@ namespace MPF.GUI.ViewModels /// Handler for CheckForUpdatesMenuItem Click event /// private void CheckForUpdatesClick(object sender, RoutedEventArgs e) => - CheckForUpdates(); + CheckForUpdates(showIfSame: true); /// /// Handler for OptionsMenuItem Click event