diff --git a/src/PlanViewer.App/AboutWindow.axaml.cs b/src/PlanViewer.App/AboutWindow.axaml.cs index d05e435..c66bdca 100644 --- a/src/PlanViewer.App/AboutWindow.axaml.cs +++ b/src/PlanViewer.App/AboutWindow.axaml.cs @@ -136,10 +136,49 @@ private async void CheckUpdate_Click(object? sender, RoutedEventArgs e) private async void UpdateLink_Click(object? sender, PointerPressedEventArgs e) { - // Step 3: User clicks "Restart now" after download + // Step 3: User clicks "Restart now" after download — confirm first if (_updateDownloaded && _velopackMgr != null && _velopackUpdate != null) { - _velopackMgr.ApplyUpdatesAndRestart(_velopackUpdate.TargetFullRelease); + var dialog = new Avalonia.Controls.Window + { + Title = "Update Ready", + Width = 350, Height = 150, + WindowStartupLocation = Avalonia.Controls.WindowStartupLocation.CenterOwner, + CanResize = false + }; + + var result = false; + var panel = new Avalonia.Controls.StackPanel + { + Margin = new Avalonia.Thickness(20), + Spacing = 15 + }; + panel.Children.Add(new Avalonia.Controls.TextBlock + { + Text = "The application will close and restart with the new version. Continue?", + TextWrapping = Avalonia.Media.TextWrapping.Wrap + }); + var buttonPanel = new Avalonia.Controls.StackPanel + { + Orientation = Avalonia.Layout.Orientation.Horizontal, + HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Right, + Spacing = 8 + }; + var okButton = new Avalonia.Controls.Button { Content = "Restart Now" }; + var cancelButton = new Avalonia.Controls.Button { Content = "Later" }; + okButton.Click += (_, _) => { result = true; dialog.Close(); }; + cancelButton.Click += (_, _) => { dialog.Close(); }; + buttonPanel.Children.Add(okButton); + buttonPanel.Children.Add(cancelButton); + panel.Children.Add(buttonPanel); + dialog.Content = panel; + + await dialog.ShowDialog(this); + + if (result) + { + _velopackMgr.ApplyUpdatesAndRestart(_velopackUpdate.TargetFullRelease); + } return; } diff --git a/src/PlanViewer.App/PlanViewer.App.csproj b/src/PlanViewer.App/PlanViewer.App.csproj index 3ed5833..54f8908 100644 --- a/src/PlanViewer.App/PlanViewer.App.csproj +++ b/src/PlanViewer.App/PlanViewer.App.csproj @@ -6,7 +6,7 @@ app.manifest EDD.ico true - 1.2.4 + 1.2.5 Erik Darling Darling Data LLC Performance Studio diff --git a/src/PlanViewer.Cli/PlanViewer.Cli.csproj b/src/PlanViewer.Cli/PlanViewer.Cli.csproj index 111629e..66a0e68 100644 --- a/src/PlanViewer.Cli/PlanViewer.Cli.csproj +++ b/src/PlanViewer.Cli/PlanViewer.Cli.csproj @@ -11,7 +11,7 @@ enable PlanViewer.Cli planview - 1.2.4 + 1.2.5 Erik Darling Darling Data LLC Performance Studio diff --git a/src/PlanViewer.Core/PlanViewer.Core.csproj b/src/PlanViewer.Core/PlanViewer.Core.csproj index 5c277ec..f02483d 100644 --- a/src/PlanViewer.Core/PlanViewer.Core.csproj +++ b/src/PlanViewer.Core/PlanViewer.Core.csproj @@ -5,7 +5,7 @@ enable enable PlanViewer.Core - 1.2.4 + 1.2.5 Erik Darling Darling Data LLC SQL Performance Studio diff --git a/src/PlanViewer.Ssms.Installer/PlanViewer.Ssms.Installer.csproj b/src/PlanViewer.Ssms.Installer/PlanViewer.Ssms.Installer.csproj index 469a553..a8f8bc0 100644 --- a/src/PlanViewer.Ssms.Installer/PlanViewer.Ssms.Installer.csproj +++ b/src/PlanViewer.Ssms.Installer/PlanViewer.Ssms.Installer.csproj @@ -6,7 +6,7 @@ InstallSsmsExtension PlanViewer.Ssms.Installer app.manifest - 1.2.4 + 1.2.5 Erik Darling Darling Data LLC SQL Performance Studio