diff --git a/.idea/.idea.SPTInstaller/.idea/avalonia.xml b/.idea/.idea.SPTInstaller/.idea/avalonia.xml
index 1ff4164..209db0b 100644
--- a/.idea/.idea.SPTInstaller/.idea/avalonia.xml
+++ b/.idea/.idea.SPTInstaller/.idea/avalonia.xml
@@ -7,6 +7,8 @@
+
+
diff --git a/SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml b/SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml
new file mode 100644
index 0000000..1bf3a39
--- /dev/null
+++ b/SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
diff --git a/SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml.cs b/SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml.cs
new file mode 100644
index 0000000..b3552ed
--- /dev/null
+++ b/SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml.cs
@@ -0,0 +1,27 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+using Tmds.DBus.Protocol;
+
+namespace SPTInstaller.CustomControls.Dialogs;
+
+public partial class ChangeLogDialog : UserControl
+{
+ public string Message { get; set; }
+ public string Version { get; set; }
+ public ChangeLogDialog(string newVersion, string message)
+ {
+ InitializeComponent();
+ Message = message;
+ Version = newVersion;
+ }
+
+ // public static readonly StyledProperty MessageProperty =
+ // AvaloniaProperty.Register("Message");
+ //
+ // public string Message
+ // {
+ // get => GetValue(MessageProperty);
+ // set => SetValue(MessageProperty, value);
+ // }
+}
\ No newline at end of file
diff --git a/SPTInstaller/CustomControls/UpdateButton.axaml b/SPTInstaller/CustomControls/UpdateButton.axaml
index b2425a3..6c63fe7 100644
--- a/SPTInstaller/CustomControls/UpdateButton.axaml
+++ b/SPTInstaller/CustomControls/UpdateButton.axaml
@@ -26,7 +26,8 @@
-
+
diff --git a/SPTInstaller/CustomControls/UpdateButton.axaml.cs b/SPTInstaller/CustomControls/UpdateButton.axaml.cs
index 4ea2783..155311d 100644
--- a/SPTInstaller/CustomControls/UpdateButton.axaml.cs
+++ b/SPTInstaller/CustomControls/UpdateButton.axaml.cs
@@ -50,6 +50,15 @@ public partial class UpdateButton : UserControl
set => SetValue(UpdateCommandProperty, value);
}
+ public static readonly StyledProperty WhatsNewCommandProperty =
+ AvaloniaProperty.Register("WhatsNewCommand");
+
+ public ICommand WhatsNewCommand
+ {
+ get => GetValue(WhatsNewCommandProperty);
+ set => SetValue(WhatsNewCommandProperty, value);
+ }
+
public static readonly StyledProperty UpdatingProperty = AvaloniaProperty.Register(
"Updating");
diff --git a/SPTInstaller/Models/InstallerUpdateInfo.cs b/SPTInstaller/Models/InstallerUpdateInfo.cs
index 2c7106c..1c971f2 100644
--- a/SPTInstaller/Models/InstallerUpdateInfo.cs
+++ b/SPTInstaller/Models/InstallerUpdateInfo.cs
@@ -9,7 +9,7 @@ namespace SPTInstaller.Models;
public class InstallerUpdateInfo : ReactiveObject
{
- private Version? _newVersion;
+ public Version? NewVersion { get; private set; }
public string ChangeLog = "";
@@ -99,7 +99,7 @@ public class InstallerUpdateInfo : ReactiveObject
private async Task DownloadNewInstaller()
{
- UpdateInfoText = $"Downloading installer v{_newVersion}";
+ UpdateInfoText = $"Downloading installer v{NewVersion}";
var progress = new Progress(x => DownloadProgress = (int)x);
@@ -166,7 +166,7 @@ public class InstallerUpdateInfo : ReactiveObject
return;
}
- _newVersion = latestVersion;
+ NewVersion = latestVersion;
ChangeLog = installerInfo.ChangeLog;
EndCheck($"Update available: v{latestVersion}", true);
diff --git a/SPTInstaller/ViewModels/PreChecksViewModel.cs b/SPTInstaller/ViewModels/PreChecksViewModel.cs
index a042188..182db76 100644
--- a/SPTInstaller/ViewModels/PreChecksViewModel.cs
+++ b/SPTInstaller/ViewModels/PreChecksViewModel.cs
@@ -36,6 +36,8 @@ public class PreChecksViewModel : ViewModelBase
public ICommand DismissUpdateCommand { get; set; }
+ public ICommand WhatsNewCommand { get; set; }
+
public ICommand LaunchWithDebug { get; set; }
public InstallerUpdateInfo UpdateInfo { get; set; } = new();
@@ -267,6 +269,9 @@ public class PreChecksViewModel : ViewModelBase
DismissUpdateCommand = ReactiveCommand.Create(() => { UpdateInfo.Show = false; });
+ WhatsNewCommand =
+ ReactiveCommand.Create(async () => await DialogHost.Show(new ChangeLogDialog(UpdateInfo.NewVersion.ToString(), UpdateInfo.ChangeLog)));
+
Task.Run(async () =>
{
diff --git a/SPTInstaller/Views/PreChecksView.axaml b/SPTInstaller/Views/PreChecksView.axaml
index c987fa8..970a57b 100644
--- a/SPTInstaller/Views/PreChecksView.axaml
+++ b/SPTInstaller/Views/PreChecksView.axaml
@@ -90,6 +90,7 @@
Updating="{Binding UpdateInfo.Updating}"
DismissCommand="{Binding DismissUpdateCommand}"
UpdateCommand="{Binding UpdateInstallerCommand}"
+ WhatsNewCommand="{Binding WhatsNewCommand}"
DownloadProgress="{Binding UpdateInfo.DownloadProgress}"
UpdateAvailable="{Binding UpdateInfo.UpdateAvailable}"
CheckingForUpdate="{Binding UpdateInfo.CheckingForUpdates}" />