add changlog stuff
This commit is contained in:
parent
4968f48e8b
commit
820c54b841
2
.idea/.idea.SPTInstaller/.idea/avalonia.xml
generated
2
.idea/.idea.SPTInstaller/.idea/avalonia.xml
generated
@ -7,6 +7,8 @@
|
|||||||
<entry key="SPTInstaller/Assets/Styles.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/Assets/Styles.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
<entry key="SPTInstaller/CustomControls/CacheInfo.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/CustomControls/CacheInfo.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
<entry key="SPTInstaller/CustomControls/DetailedPreCheckItem.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/CustomControls/DetailedPreCheckItem.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
|
<entry key="SPTInstaller/CustomControls/Dialogs/ConfirmationDialog.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
|
<entry key="SPTInstaller/CustomControls/Dialogs/MessageDialog.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
<entry key="SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
<entry key="SPTInstaller/CustomControls/MainInstallerButton.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/CustomControls/MainInstallerButton.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
<entry key="SPTInstaller/CustomControls/PreCheckDetails.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/CustomControls/PreCheckDetails.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
|
21
SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml
Normal file
21
SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="SPTInstaller.CustomControls.Dialogs.ChangeLogDialog"
|
||||||
|
MinWidth="400">
|
||||||
|
<StackPanel>
|
||||||
|
<Label Content="{Binding Version, RelativeSource={RelativeSource AncestorType=UserControl}, StringFormat='{}Installer Change Log for {0}'}" FontSize="18" FontWeight="SemiBold"
|
||||||
|
/>
|
||||||
|
<Separator Margin="0 10" Padding="0" Background="{StaticResource AKI_Yellow}"/>
|
||||||
|
<TextBlock Text="{Binding Message, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||||
|
TextWrapping="Wrap" MinHeight="100"
|
||||||
|
/>
|
||||||
|
<Button Content="Close" Classes="yellow"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHost:DialogHost}, Path=CloseDialogCommand}"
|
||||||
|
/>
|
||||||
|
</StackPanel>
|
||||||
|
</UserControl>
|
27
SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml.cs
Normal file
27
SPTInstaller/CustomControls/Dialogs/ChangeLogDialog.axaml.cs
Normal file
@ -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<string> MessageProperty =
|
||||||
|
// AvaloniaProperty.Register<ChangeLogDialog, string>("Message");
|
||||||
|
//
|
||||||
|
// public string Message
|
||||||
|
// {
|
||||||
|
// get => GetValue(MessageProperty);
|
||||||
|
// set => SetValue(MessageProperty, value);
|
||||||
|
// }
|
||||||
|
}
|
@ -26,7 +26,8 @@
|
|||||||
<Button Content="Not now" CornerRadius="0 20 20 0"
|
<Button Content="Not now" CornerRadius="0 20 20 0"
|
||||||
Command="{Binding DismissCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" />
|
Command="{Binding DismissCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<Button HorizontalAlignment="Center" Content="What's new?" Classes="link"
|
||||||
|
Command="{Binding WhatsNewCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Panel Margin="0 10">
|
<Panel Margin="0 10">
|
||||||
|
@ -50,6 +50,15 @@ public partial class UpdateButton : UserControl
|
|||||||
set => SetValue(UpdateCommandProperty, value);
|
set => SetValue(UpdateCommandProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static readonly StyledProperty<ICommand> WhatsNewCommandProperty =
|
||||||
|
AvaloniaProperty.Register<UpdateButton, ICommand>("WhatsNewCommand");
|
||||||
|
|
||||||
|
public ICommand WhatsNewCommand
|
||||||
|
{
|
||||||
|
get => GetValue(WhatsNewCommandProperty);
|
||||||
|
set => SetValue(WhatsNewCommandProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
public static readonly StyledProperty<bool> UpdatingProperty = AvaloniaProperty.Register<UpdateButton, bool>(
|
public static readonly StyledProperty<bool> UpdatingProperty = AvaloniaProperty.Register<UpdateButton, bool>(
|
||||||
"Updating");
|
"Updating");
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace SPTInstaller.Models;
|
|||||||
|
|
||||||
public class InstallerUpdateInfo : ReactiveObject
|
public class InstallerUpdateInfo : ReactiveObject
|
||||||
{
|
{
|
||||||
private Version? _newVersion;
|
public Version? NewVersion { get; private set; }
|
||||||
|
|
||||||
public string ChangeLog = "";
|
public string ChangeLog = "";
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ public class InstallerUpdateInfo : ReactiveObject
|
|||||||
|
|
||||||
private async Task<string> DownloadNewInstaller()
|
private async Task<string> DownloadNewInstaller()
|
||||||
{
|
{
|
||||||
UpdateInfoText = $"Downloading installer v{_newVersion}";
|
UpdateInfoText = $"Downloading installer v{NewVersion}";
|
||||||
|
|
||||||
var progress = new Progress<double>(x => DownloadProgress = (int)x);
|
var progress = new Progress<double>(x => DownloadProgress = (int)x);
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ public class InstallerUpdateInfo : ReactiveObject
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_newVersion = latestVersion;
|
NewVersion = latestVersion;
|
||||||
ChangeLog = installerInfo.ChangeLog;
|
ChangeLog = installerInfo.ChangeLog;
|
||||||
|
|
||||||
EndCheck($"Update available: v{latestVersion}", true);
|
EndCheck($"Update available: v{latestVersion}", true);
|
||||||
|
@ -36,6 +36,8 @@ public class PreChecksViewModel : ViewModelBase
|
|||||||
|
|
||||||
public ICommand DismissUpdateCommand { get; set; }
|
public ICommand DismissUpdateCommand { get; set; }
|
||||||
|
|
||||||
|
public ICommand WhatsNewCommand { get; set; }
|
||||||
|
|
||||||
public ICommand LaunchWithDebug { get; set; }
|
public ICommand LaunchWithDebug { get; set; }
|
||||||
|
|
||||||
public InstallerUpdateInfo UpdateInfo { get; set; } = new();
|
public InstallerUpdateInfo UpdateInfo { get; set; } = new();
|
||||||
@ -267,6 +269,9 @@ public class PreChecksViewModel : ViewModelBase
|
|||||||
|
|
||||||
DismissUpdateCommand = ReactiveCommand.Create(() => { UpdateInfo.Show = false; });
|
DismissUpdateCommand = ReactiveCommand.Create(() => { UpdateInfo.Show = false; });
|
||||||
|
|
||||||
|
WhatsNewCommand =
|
||||||
|
ReactiveCommand.Create(async () => await DialogHost.Show(new ChangeLogDialog(UpdateInfo.NewVersion.ToString(), UpdateInfo.ChangeLog)));
|
||||||
|
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
|
@ -90,6 +90,7 @@
|
|||||||
Updating="{Binding UpdateInfo.Updating}"
|
Updating="{Binding UpdateInfo.Updating}"
|
||||||
DismissCommand="{Binding DismissUpdateCommand}"
|
DismissCommand="{Binding DismissUpdateCommand}"
|
||||||
UpdateCommand="{Binding UpdateInstallerCommand}"
|
UpdateCommand="{Binding UpdateInstallerCommand}"
|
||||||
|
WhatsNewCommand="{Binding WhatsNewCommand}"
|
||||||
DownloadProgress="{Binding UpdateInfo.DownloadProgress}"
|
DownloadProgress="{Binding UpdateInfo.DownloadProgress}"
|
||||||
UpdateAvailable="{Binding UpdateInfo.UpdateAvailable}"
|
UpdateAvailable="{Binding UpdateInfo.UpdateAvailable}"
|
||||||
CheckingForUpdate="{Binding UpdateInfo.CheckingForUpdates}" />
|
CheckingForUpdate="{Binding UpdateInfo.CheckingForUpdates}" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user