Browse Source

Add Launch tooltip for first install & hook up RemoveSymlinksOnShutdown checkbox

pull/55/head
JT 1 year ago
parent
commit
4534cd9e96
  1. 6
      StabilityMatrix.Avalonia/ViewModels/LaunchPageViewModel.cs
  2. 5
      StabilityMatrix.Avalonia/ViewModels/SettingsViewModel.cs
  3. 6
      StabilityMatrix.Avalonia/Views/LaunchPageView.axaml
  4. 6
      StabilityMatrix.Avalonia/Views/SettingsPage.axaml

6
StabilityMatrix.Avalonia/ViewModels/LaunchPageViewModel.cs

@ -93,6 +93,7 @@ public partial class LaunchPageViewModel : PageViewModelBase, IDisposable
EventManager.Instance.PackageLaunchRequested += OnPackageLaunchRequested;
EventManager.Instance.OneClickInstallFinished += OnOneClickInstallFinished;
EventManager.Instance.InstalledPackagesChanged += OnInstalledPackagesChanged;
EventManager.Instance.TeachingTooltipNeeded += OnTeachingTooltipNeeded;
// Handler for console input
Console.ApcInput += (_, message) =>
{
@ -103,6 +104,9 @@ public partial class LaunchPageViewModel : PageViewModelBase, IDisposable
};
}
private void OnTeachingTooltipNeeded(object? sender, EventArgs e) =>
IsLaunchTeachingTipsOpen = true;
private void OnInstalledPackagesChanged(object? sender, EventArgs e) => OnLoaded();
private void OnPackageLaunchRequested(object? sender, Guid e)
@ -132,6 +136,8 @@ public partial class LaunchPageViewModel : PageViewModelBase, IDisposable
[RelayCommand]
private async Task LaunchAsync()
{
IsLaunchTeachingTipsOpen = false;
var activeInstall = SelectedPackage;
if (activeInstall == null)
{

5
StabilityMatrix.Avalonia/ViewModels/SettingsViewModel.cs

@ -84,6 +84,11 @@ public partial class SettingsViewModel : PageViewModelBase
};
}
partial void OnRemoveSymlinksOnShutdownChanged(bool value)
{
settingsManager.Transaction(s => s.RemoveFolderLinksOnShutdown = value);
}
[RelayCommand]
private async Task CheckPythonVersion()
{

6
StabilityMatrix.Avalonia/Views/LaunchPageView.axaml

@ -31,12 +31,18 @@
Grid.Row="0"
Grid.Column="0"
Width="72"
Name="LaunchBtn"
Margin="16,8,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
Classes="success"
Command="{Binding LaunchCommand}"
Content="Launch" />
<ui:TeachingTip Grid.Row="0" Grid.Column="0" Name="TeachingTip1"
Target="{Binding #LaunchBtn}"
Title="Click Launch to get started!"
PreferredPlacement="BottomRight"
IsOpen="{Binding IsLaunchTeachingTipsOpen}"/>
<Button
Grid.Row="0"
Grid.Column="0"

6
StabilityMatrix.Avalonia/Views/SettingsPage.axaml

@ -16,7 +16,8 @@
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid>
<StackPanel Spacing="4">
<ui:SettingsExpander Header="Theme" Margin="8">
<ui:SettingsExpander Header="Theme" Margin="8"
IconSource="WeatherMoon">
<ui:SettingsExpander.Footer>
<ComboBox
ItemsSource="{Binding AvailableThemes}"
@ -41,7 +42,8 @@
Description="Select this option if you're having problems moving Stability Matrix to another drive."
Margin="8">
<ui:SettingsExpander.Footer>
<CheckBox Margin="8" />
<CheckBox Margin="8"
IsChecked="{Binding RemoveSymlinksOnShutdown}"/>
</ui:SettingsExpander.Footer>
</ui:SettingsExpander>
</StackPanel>

Loading…
Cancel
Save