diff --git a/SPTInstaller/App.axaml b/SPTInstaller/App.axaml
index 5a734ba..84fd4c0 100644
--- a/SPTInstaller/App.axaml
+++ b/SPTInstaller/App.axaml
@@ -38,5 +38,7 @@
/>
+
diff --git a/SPTInstaller/Assets/Styles.axaml b/SPTInstaller/Assets/Styles.axaml
index 7f446d4..b22a99f 100644
--- a/SPTInstaller/Assets/Styles.axaml
+++ b/SPTInstaller/Assets/Styles.axaml
@@ -5,7 +5,7 @@
>
-
+
@@ -190,7 +190,44 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SPTInstaller/Controllers/InstallController.cs b/SPTInstaller/Controllers/InstallController.cs
index ac43ee6..e2b4b15 100644
--- a/SPTInstaller/Controllers/InstallController.cs
+++ b/SPTInstaller/Controllers/InstallController.cs
@@ -1,5 +1,6 @@
using Serilog;
using SharpCompress;
+using SPTInstaller.CustomControls;
using SPTInstaller.Interfaces;
using SPTInstaller.Models;
using System.Collections.Generic;
@@ -26,7 +27,7 @@ public class InstallController
Log.Information("-<>--<>- Running PreChecks -<>--<>-");
var requiredResults = new List();
- _preChecks.ForEach(x => x.IsPending = true);
+ _preChecks.ForEach(x => x.State = StatusSpinner.SpinnerState.Pending);
foreach (var check in _preChecks)
{
diff --git a/SPTInstaller/Converters/StatusSpinnerIsProcessingConverter.cs b/SPTInstaller/Converters/StatusSpinnerIsProcessingConverter.cs
new file mode 100644
index 0000000..e0c391f
--- /dev/null
+++ b/SPTInstaller/Converters/StatusSpinnerIsProcessingConverter.cs
@@ -0,0 +1,26 @@
+using Avalonia.Data.Converters;
+using SPTInstaller.CustomControls;
+using System.Globalization;
+
+namespace SPTInstaller.Converters;
+public class StatusSpinnerIsProcessingConverter : IValueConverter
+{
+ public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ if (value is not StatusSpinner.SpinnerState state)
+ return null;
+
+
+ if (parameter is string parm && parm == "invert")
+ {
+ return state > 0;
+ }
+
+ return state <= 0;
+ }
+
+ public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ return value;
+ }
+}
diff --git a/SPTInstaller/Converters/StatusSpinnerIsStateConverter.cs b/SPTInstaller/Converters/StatusSpinnerIsStateConverter.cs
new file mode 100644
index 0000000..d5951de
--- /dev/null
+++ b/SPTInstaller/Converters/StatusSpinnerIsStateConverter.cs
@@ -0,0 +1,26 @@
+using Avalonia.Data.Converters;
+using SPTInstaller.CustomControls;
+using System.Globalization;
+
+namespace SPTInstaller.Converters;
+public class StatusSpinnerIsStateConverter : IValueConverter
+{
+ public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ if (value == null || parameter == null)
+ return null;
+
+ if (value is not StatusSpinner.SpinnerState state)
+ return null;
+
+ if (parameter is not string stateName)
+ return null;
+
+ return state.ToString().ToLower() == stateName.ToLower();
+ }
+
+ public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ return value;
+ }
+}
diff --git a/SPTInstaller/CustomControls/CacheInfo.axaml b/SPTInstaller/CustomControls/CacheInfo.axaml
new file mode 100644
index 0000000..34352fa
--- /dev/null
+++ b/SPTInstaller/CustomControls/CacheInfo.axaml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SPTInstaller/CustomControls/CacheInfo.axaml.cs b/SPTInstaller/CustomControls/CacheInfo.axaml.cs
new file mode 100644
index 0000000..cbe42b3
--- /dev/null
+++ b/SPTInstaller/CustomControls/CacheInfo.axaml.cs
@@ -0,0 +1,34 @@
+using Avalonia;
+using Avalonia.Controls;
+using DialogHostAvalonia;
+using SPTInstaller.CustomControls.Dialogs;
+using System.Threading.Tasks;
+
+namespace SPTInstaller.CustomControls;
+public partial class CacheInfo : UserControl
+{
+ public CacheInfo()
+ {
+ InitializeComponent();
+ }
+
+ public async Task ShowCacheDialogCommand() => await DialogHost.Show(new WhyCacheThoughDialog());
+
+ public string InfoText
+ {
+ get => GetValue(InfoTextProperty);
+ set => SetValue(InfoTextProperty, value);
+ }
+
+ public static readonly StyledProperty InfoTextProperty =
+ AvaloniaProperty.Register(nameof(InfoText));
+
+ public StatusSpinner.SpinnerState State
+ {
+ get => GetValue(StateProperty);
+ set => SetValue(StateProperty, value);
+ }
+
+ public static readonly StyledProperty StateProperty =
+ AvaloniaProperty.Register(nameof(State));
+}
diff --git a/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml b/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml
index de346ee..87c5d05 100644
--- a/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml
+++ b/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml
@@ -2,29 +2,10 @@
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:cc="using:SPTInstaller.CustomControls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPTInstaller.CustomControls.DetailedPreCheckItem"
Background="Transparent" MinHeight="100">
-
-
-
-
-
-
-
-
-
+
+
diff --git a/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml b/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml
new file mode 100644
index 0000000..79080f5
--- /dev/null
+++ b/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml
@@ -0,0 +1,38 @@
+
+
+
+
+The installer cache is used to ensure you don't re-download large files that you've already downloaded before.
+ You should only delete the cache folder if
+ - You are low on space
+ or
+ - You are not planning on installing SPT again any time soon
+
+If possible, you should leave the cache in place to avoid uneccessary, lengthy downloads.
+It also helps us prevent extra traffic to our limited download mirrors. Every bit helps ♥️
+
+
+
+
+
+
+
diff --git a/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs b/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs
new file mode 100644
index 0000000..57548f8
--- /dev/null
+++ b/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs
@@ -0,0 +1,27 @@
+using Avalonia.Controls;
+using SPTInstaller.Helpers;
+using System.Diagnostics;
+
+namespace SPTInstaller.CustomControls.Dialogs;
+public partial class WhyCacheThoughDialog : UserControl
+{
+ public WhyCacheThoughDialog()
+ {
+ InitializeComponent();
+ }
+
+ public bool CacheExists => Directory.Exists(DownloadCacheHelper.CachePath);
+
+ public void OpenCacheFolder()
+ {
+ if (!CacheExists)
+ return;
+
+ Process.Start(new ProcessStartInfo()
+ {
+ FileName = Path.EndsInDirectorySeparator(DownloadCacheHelper.CachePath) ? DownloadCacheHelper.CachePath : DownloadCacheHelper.CachePath + Path.DirectorySeparatorChar,
+ UseShellExecute = true,
+ Verb = "open"
+ });
+ }
+}
diff --git a/SPTInstaller/CustomControls/PreCheckItem.axaml b/SPTInstaller/CustomControls/PreCheckItem.axaml
index 98fce28..68e7fb3 100644
--- a/SPTInstaller/CustomControls/PreCheckItem.axaml
+++ b/SPTInstaller/CustomControls/PreCheckItem.axaml
@@ -2,65 +2,29 @@
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:cc="using:SPTInstaller.CustomControls"
+ xmlns:convt="using:SPTInstaller.Converters"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPTInstaller.CustomControls.PreCheckItem">
-
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
diff --git a/SPTInstaller/CustomControls/PreCheckItem.axaml.cs b/SPTInstaller/CustomControls/PreCheckItem.axaml.cs
index 5b7182c..c531ccc 100644
--- a/SPTInstaller/CustomControls/PreCheckItem.axaml.cs
+++ b/SPTInstaller/CustomControls/PreCheckItem.axaml.cs
@@ -1,4 +1,4 @@
-using Avalonia;
+using Avalonia;
using Avalonia.Controls;
namespace SPTInstaller.CustomControls;
@@ -19,33 +19,6 @@ public partial class PreCheckItem : UserControl
public static readonly StyledProperty PreCheckNameProperty =
AvaloniaProperty.Register(nameof(PreCheckName));
- public bool IsRunning
- {
- get => GetValue(IsRunningProperty);
- set => SetValue(IsRunningProperty, value);
- }
-
- public static readonly StyledProperty IsRunningProperty =
- AvaloniaProperty.Register(nameof(IsRunning));
-
- public bool IsPending
- {
- get => GetValue(IsPendingProperty);
- set => SetValue(IsPendingProperty, value);
- }
-
- public static readonly StyledProperty IsPendingProperty =
- AvaloniaProperty.Register(nameof(IsPending));
-
- public bool Passed
- {
- get => GetValue(PassedProperty);
- set => SetValue(PassedProperty, value);
- }
-
- public static readonly StyledProperty PassedProperty =
- AvaloniaProperty.Register(nameof(Passed));
-
public bool IsRequired
{
get => GetValue(IsRequiredProperty);
@@ -54,4 +27,13 @@ public partial class PreCheckItem : UserControl
public static readonly StyledProperty IsRequiredProperty =
AvaloniaProperty.Register(nameof(IsRequired));
+
+ public StatusSpinner.SpinnerState State
+ {
+ get => GetValue(StateProperty);
+ set => SetValue(StateProperty, value);
+ }
+
+ public static readonly StyledProperty StateProperty =
+ AvaloniaProperty.Register(nameof(State));
}
\ No newline at end of file
diff --git a/SPTInstaller/CustomControls/StatusSpinner.axaml b/SPTInstaller/CustomControls/StatusSpinner.axaml
new file mode 100644
index 0000000..c10b421
--- /dev/null
+++ b/SPTInstaller/CustomControls/StatusSpinner.axaml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SPTInstaller/CustomControls/StatusSpinner.axaml.cs b/SPTInstaller/CustomControls/StatusSpinner.axaml.cs
new file mode 100644
index 0000000..d845467
--- /dev/null
+++ b/SPTInstaller/CustomControls/StatusSpinner.axaml.cs
@@ -0,0 +1,31 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.ReactiveUI;
+
+namespace SPTInstaller.CustomControls;
+
+public partial class StatusSpinner : ReactiveUserControl
+{
+ public enum SpinnerState
+ {
+ Pending = -1,
+ Running = 0,
+ OK = 1,
+ Warning = 2,
+ Error = 3,
+ }
+
+ public StatusSpinner()
+ {
+ InitializeComponent();
+ }
+
+ public SpinnerState State
+ {
+ get => GetValue(StateProperty);
+ set => SetValue(StateProperty, value);
+ }
+
+ public static readonly StyledProperty StateProperty =
+ AvaloniaProperty.Register(nameof(State));
+}
diff --git a/SPTInstaller/Helpers/DownloadCacheHelper.cs b/SPTInstaller/Helpers/DownloadCacheHelper.cs
index 3fa6ebd..3e51d7f 100644
--- a/SPTInstaller/Helpers/DownloadCacheHelper.cs
+++ b/SPTInstaller/Helpers/DownloadCacheHelper.cs
@@ -11,6 +11,21 @@ public static class DownloadCacheHelper
public static string CachePath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "spt-installer/cache");
+ public static string GetCacheSizeText()
+ {
+ if (!Directory.Exists(CachePath))
+ return "No cache folder";
+
+ var cacheDir = new DirectoryInfo(CachePath);
+
+ var cacheSize = DirectorySizeHelper.GetSizeOfDirectory(cacheDir);
+
+ if (cacheSize == 0)
+ return "Empty";
+
+ return DirectorySizeHelper.SizeSuffix(cacheSize);
+ }
+
private static bool CheckCache(FileInfo cacheFile, string expectedHash = null)
{
try
diff --git a/SPTInstaller/Installer Tasks/PreChecks/TestPreCheck.cs b/SPTInstaller/Installer Tasks/PreChecks/TestPreCheck.cs
new file mode 100644
index 0000000..3073cbb
--- /dev/null
+++ b/SPTInstaller/Installer Tasks/PreChecks/TestPreCheck.cs
@@ -0,0 +1,30 @@
+using SPTInstaller.CustomControls;
+using SPTInstaller.Models;
+using System.Threading.Tasks;
+
+namespace SPTInstaller.Installer_Tasks.PreChecks;
+public class TestPreCheck : PreCheckBase
+{
+ private StatusSpinner.SpinnerState _endState;
+ public static TestPreCheck FromRandomName(StatusSpinner.SpinnerState EndState) => new TestPreCheck($"{EndState} #{new Random().Next(0, 9999)}", EndState == StatusSpinner.SpinnerState.Error, EndState);
+
+ public TestPreCheck(string name, bool isRequired, StatusSpinner.SpinnerState endState) : base(name, isRequired)
+ {
+ _endState = endState;
+ }
+
+ public override async Task CheckOperation()
+ {
+ await Task.Delay(1000);
+
+ switch (_endState)
+ {
+ case StatusSpinner.SpinnerState.Error:
+ return PreCheckResult.FromError("This is what a required precheck failing looks like");
+ case StatusSpinner.SpinnerState.Warning:
+ return PreCheckResult.FromError("This is what a non-required precheck failing looks like");
+ default:
+ return PreCheckResult.FromSuccess("This is what a successful precheck looks like");
+ }
+ }
+}
diff --git a/SPTInstaller/Interfaces/IPreCheck.cs b/SPTInstaller/Interfaces/IPreCheck.cs
index 1bc789c..53e9c0d 100644
--- a/SPTInstaller/Interfaces/IPreCheck.cs
+++ b/SPTInstaller/Interfaces/IPreCheck.cs
@@ -1,4 +1,5 @@
-using System.Threading.Tasks;
+using SPTInstaller.CustomControls;
+using System.Threading.Tasks;
namespace SPTInstaller.Interfaces;
@@ -7,12 +8,8 @@ public interface IPreCheck
public string Id { get; }
public string Name { get; }
public bool IsRequired { get; }
-
- public bool IsPending { get; set; }
-
- public bool Passed { get; }
-
public string PreCheckDetails { get; }
+ public StatusSpinner.SpinnerState State { get; set; }
public Task RunCheck();
}
\ No newline at end of file
diff --git a/SPTInstaller/Models/PreCheckBase.cs b/SPTInstaller/Models/PreCheckBase.cs
index 31bd45f..0e1fe0c 100644
--- a/SPTInstaller/Models/PreCheckBase.cs
+++ b/SPTInstaller/Models/PreCheckBase.cs
@@ -1,4 +1,5 @@
using ReactiveUI;
+using SPTInstaller.CustomControls;
using SPTInstaller.Interfaces;
using System.Threading.Tasks;
using System.Windows.Input;
@@ -28,25 +29,11 @@ public abstract class PreCheckBase : ReactiveObject, IPreCheck
set => this.RaiseAndSetIfChanged(ref _required, value);
}
- private bool _passed;
- public bool Passed
+ private StatusSpinner.SpinnerState _state;
+ public StatusSpinner.SpinnerState State
{
- get => _passed;
- set => this.RaiseAndSetIfChanged(ref _passed, value);
- }
-
- private bool _isPending;
- public bool IsPending
- {
- get => _isPending;
- set => this.RaiseAndSetIfChanged(ref _isPending, value);
- }
-
- private bool _isRunning;
- public bool IsRunning
- {
- get => _isRunning;
- set => this.RaiseAndSetIfChanged(ref _isRunning, value);
+ get => _state;
+ set => this.RaiseAndSetIfChanged(ref _state, value);
}
private string _preCheckDetails;
@@ -89,12 +76,19 @@ public abstract class PreCheckBase : ReactiveObject, IPreCheck
Id = Guid.NewGuid().ToString();
}
+ private StatusSpinner.SpinnerState ProcessResult(PreCheckResult result) =>
+ (result.Succeeded, IsRequired) switch
+ {
+ (true, _) => StatusSpinner.SpinnerState.OK,
+ (false, false) => StatusSpinner.SpinnerState.Warning,
+ (_, _) => StatusSpinner.SpinnerState.Error
+ };
+
public async Task RunCheck()
{
- IsRunning = true;
+ State = StatusSpinner.SpinnerState.Running;
var result = await CheckOperation();
- Passed = result.Succeeded;
PreCheckDetails = !string.IsNullOrWhiteSpace(result.Message)
? result.Message
@@ -104,10 +98,9 @@ public abstract class PreCheckBase : ReactiveObject, IPreCheck
ActionButtonCommand = result.ButtonPressedCommand;
ActionButtonIsVisible = result.ActionButtonIsVisible;
- IsRunning = false;
- IsPending = false;
+ State = ProcessResult(result);
- return Passed ? Result.FromSuccess() : Result.FromError($"PreCheck Failed: {Name}");
+ return State == StatusSpinner.SpinnerState.OK ? Result.FromSuccess() : Result.FromError($"PreCheck Failed: {Name}");
}
public abstract Task CheckOperation();
diff --git a/SPTInstaller/Program.cs b/SPTInstaller/Program.cs
index d2635e7..43f5f78 100644
--- a/SPTInstaller/Program.cs
+++ b/SPTInstaller/Program.cs
@@ -4,6 +4,7 @@ using ReactiveUI;
using Serilog;
using Splat;
using SPTInstaller.Controllers;
+using SPTInstaller.CustomControls;
using SPTInstaller.Helpers;
using SPTInstaller.Installer_Tasks;
using SPTInstaller.Installer_Tasks.PreChecks;
@@ -31,10 +32,11 @@ internal class Program
// Register all the things
// Regestering as base classes so ReactiveUI works correctly. Doesn't seem to like the interfaces :(
ServiceHelper.Register();
+
+#if !TEST
ServiceHelper.Register();
ServiceHelper.Register();
-#if !TEST
ServiceHelper.Register();
var logPath = Path.Join(Environment.CurrentDirectory, "spt-aki-installer_.log");
@@ -52,10 +54,14 @@ internal class Program
ServiceHelper.Register();
ServiceHelper.Register();
#else
- for (int i = 0; i < 5; i++)
- {
- Locator.CurrentMutable.RegisterConstant(TestTask.FromRandomName());
- }
+ for (int i = 0; i < 5; i++)
+ {
+ Locator.CurrentMutable.RegisterConstant(TestTask.FromRandomName());
+ }
+
+ Locator.CurrentMutable.RegisterConstant(TestPreCheck.FromRandomName(StatusSpinner.SpinnerState.OK));
+ Locator.CurrentMutable.RegisterConstant(TestPreCheck.FromRandomName(StatusSpinner.SpinnerState.Warning));
+ Locator.CurrentMutable.RegisterConstant(TestPreCheck.FromRandomName(StatusSpinner.SpinnerState.Error));
#endif
// need the interfaces for the controller and splat won't resolve them since we need to base classes in avalonia (what a mess), so doing it manually here
diff --git a/SPTInstaller/SPTInstaller.csproj b/SPTInstaller/SPTInstaller.csproj
index a2fb9e9..cf67dc2 100644
--- a/SPTInstaller/SPTInstaller.csproj
+++ b/SPTInstaller/SPTInstaller.csproj
@@ -9,8 +9,8 @@
icon.ico
Assets\icon.ico
Debug;Release;TEST
- 2.9
- 2.9
+ 2.10
+ 2.10
diff --git a/SPTInstaller/ViewModels/MessageViewModel.cs b/SPTInstaller/ViewModels/MessageViewModel.cs
index 7324f24..9d1b813 100644
--- a/SPTInstaller/ViewModels/MessageViewModel.cs
+++ b/SPTInstaller/ViewModels/MessageViewModel.cs
@@ -1,7 +1,10 @@
using Avalonia;
using ReactiveUI;
using Serilog;
+using SPTInstaller.CustomControls;
+using SPTInstaller.Helpers;
using SPTInstaller.Interfaces;
+using System.Threading.Tasks;
using System.Windows.Input;
namespace SPTInstaller.ViewModels;
@@ -29,6 +32,20 @@ public class MessageViewModel : ViewModelBase
set => this.RaiseAndSetIfChanged(ref _showCloseButton, value);
}
+ private string _cacheInfoText;
+ public string CacheInfoText
+ {
+ get => _cacheInfoText;
+ set => this.RaiseAndSetIfChanged(ref _cacheInfoText, value);
+ }
+
+ private StatusSpinner.SpinnerState _cacheCheckState;
+ public StatusSpinner.SpinnerState CacheCheckState
+ {
+ get => _cacheCheckState;
+ set => this.RaiseAndSetIfChanged(ref _cacheCheckState, value);
+ }
+
public ICommand CloseCommand { get; set; } = ReactiveCommand.Create(() =>
{
if (Application.Current.ApplicationLifetime is Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime desktopApp)
@@ -42,7 +59,16 @@ public class MessageViewModel : ViewModelBase
ShowCloseButton = showCloseButton;
Message = result.Message;
- if(result.Succeeded)
+ Task.Run(() =>
+ {
+ CacheInfoText = "Getting cache size ...";
+ CacheCheckState = StatusSpinner.SpinnerState.Running;
+
+ CacheInfoText = $"Cache Size: {DownloadCacheHelper.GetCacheSizeText()}";
+ CacheCheckState = StatusSpinner.SpinnerState.OK;
+ });
+
+ if (result.Succeeded)
{
Log.Information(Message);
return;
diff --git a/SPTInstaller/ViewModels/PreChecksViewModel.cs b/SPTInstaller/ViewModels/PreChecksViewModel.cs
index d03365d..e0ff8ca 100644
--- a/SPTInstaller/ViewModels/PreChecksViewModel.cs
+++ b/SPTInstaller/ViewModels/PreChecksViewModel.cs
@@ -7,6 +7,7 @@ using DialogHostAvalonia;
using ReactiveUI;
using Serilog;
using SPTInstaller.Controllers;
+using SPTInstaller.CustomControls;
using SPTInstaller.CustomControls.Dialogs;
using SPTInstaller.Helpers;
using SPTInstaller.Models;
@@ -15,7 +16,6 @@ namespace SPTInstaller.ViewModels;
public class PreChecksViewModel : ViewModelBase
{
-
public ObservableCollection PreChecks { get; set; } = new(ServiceHelper.GetAll());
public ICommand StartInstallCommand { get; set; }
public ICommand ShowDetailedViewCommand { get; set; }
@@ -47,6 +47,20 @@ public class PreChecksViewModel : ViewModelBase
set => this.RaiseAndSetIfChanged(ref _allowDetailsButton, value);
}
+ private string _cacheInfoText;
+ public string CacheInfoText
+ {
+ get => _cacheInfoText;
+ set => this.RaiseAndSetIfChanged(ref _cacheInfoText, value);
+ }
+
+ private StatusSpinner.SpinnerState _cacheCheckState;
+ public StatusSpinner.SpinnerState CacheCheckState
+ {
+ get => _cacheCheckState;
+ set => this.RaiseAndSetIfChanged(ref _cacheCheckState, value);
+ }
+
public PreChecksViewModel(IScreen host) : base(host)
{
var data = ServiceHelper.Get();
@@ -127,5 +141,14 @@ public class PreChecksViewModel : ViewModelBase
AllowDetailsButton = true;
AllowInstall = result.Succeeded;
});
+
+ Task.Run(() =>
+ {
+ CacheInfoText = "Getting cache size ...";
+ CacheCheckState = StatusSpinner.SpinnerState.Running;
+
+ CacheInfoText = $"Cache Size: {DownloadCacheHelper.GetCacheSizeText()}";
+ CacheCheckState = StatusSpinner.SpinnerState.OK;
+ });
}
}
\ No newline at end of file
diff --git a/SPTInstaller/Views/DetailedPreChecksView.axaml b/SPTInstaller/Views/DetailedPreChecksView.axaml
index db78307..0b3c067 100644
--- a/SPTInstaller/Views/DetailedPreChecksView.axaml
+++ b/SPTInstaller/Views/DetailedPreChecksView.axaml
@@ -13,6 +13,10 @@
FontSize="16"
FontWeight="SemiBold"
/>
+
+
diff --git a/SPTInstaller/Views/MainWindow.axaml b/SPTInstaller/Views/MainWindow.axaml
index 9a82919..a6cc124 100644
--- a/SPTInstaller/Views/MainWindow.axaml
+++ b/SPTInstaller/Views/MainWindow.axaml
@@ -34,7 +34,7 @@
MinButtonCommand="{Binding MinimizeCommand}"
/>
-
+
diff --git a/SPTInstaller/Views/MessageView.axaml b/SPTInstaller/Views/MessageView.axaml
index fc1464a..210c9ec 100644
--- a/SPTInstaller/Views/MessageView.axaml
+++ b/SPTInstaller/Views/MessageView.axaml
@@ -2,6 +2,7 @@
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:cc="using:SPTInstaller.CustomControls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPTInstaller.Views.MessageView"
>
@@ -36,5 +37,10 @@
VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
Padding="20 10"
/>
+
+
diff --git a/SPTInstaller/Views/PreChecksView.axaml b/SPTInstaller/Views/PreChecksView.axaml
index 6dc74a3..367e663 100644
--- a/SPTInstaller/Views/PreChecksView.axaml
+++ b/SPTInstaller/Views/PreChecksView.axaml
@@ -26,7 +26,7 @@
IsEnabled="{Binding AllowInstall}"
Command="{Binding StartInstallCommand}"
/>
-
+
@@ -36,14 +36,13 @@
+
+
+