Display message box with button

This commit is contained in:
Jack251970 2025-06-09 14:42:48 +08:00
parent 3d555e7442
commit d787bba9a7
2 changed files with 14 additions and 2 deletions

View file

@ -369,6 +369,8 @@
<system:String x:Key="seeMoreReleaseNotes">See more release notes on GitHub</system:String>
<system:String x:Key="checkNetworkConnectionTitle">Failed to fetch release notes</system:String>
<system:String x:Key="checkNetworkConnectionSubTitle">Please check your network connection or ensure GitHub is accessible</system:String>
<system:String x:Key="appUpdateTitle">Flow Launcher has been updated to {0}</system:String>
<system:String x:Key="appUpdateButtonContent">Click here to view the release notes</system:String>
<!-- FileManager Setting Dialog -->
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>

View file

@ -140,8 +140,18 @@ namespace Flow.Launcher
// Update release notes version
_settings.ReleaseNotesVersion = Constant.Version;
var releaseNotesWindow = new ReleaseNotesWindow();
releaseNotesWindow.Show();
// Display message box with button
App.API.ShowMsgWithButton(
string.Format(App.API.GetTranslation("appUpdateTitle"), Constant.Version),
App.API.GetTranslation("appUpdateButtonContent"),
() =>
{
Application.Current.Dispatcher.Invoke(() =>
{
var releaseNotesWindow = new ReleaseNotesWindow();
releaseNotesWindow.Show();
});
});
}
// Initialize place holder