From 9d78a45cd8e66a5cda8553a59da171ca5202bbe5 Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 28 Feb 2024 22:41:21 -0800 Subject: [PATCH 1/4] Fix ImageViewerDialog arrow key nav & update nugets --- Avalonia.Gif/Avalonia.Gif.csproj | 2 +- CHANGELOG.md | 6 ++++ ...tabilityMatrix.Avalonia.Diagnostics.csproj | 4 +-- .../StabilityMatrix.Avalonia.csproj | 28 +++++++++---------- .../Views/Dialogs/ImageViewerDialog.axaml | 3 +- .../StabilityMatrix.Core.csproj | 18 ++++++------ .../StabilityMatrix.Tests.csproj | 14 +++++----- .../StabilityMatrix.UITests.csproj | 14 +++++----- 8 files changed, 48 insertions(+), 41 deletions(-) diff --git a/Avalonia.Gif/Avalonia.Gif.csproj b/Avalonia.Gif/Avalonia.Gif.csproj index 858b974e..6a363589 100644 --- a/Avalonia.Gif/Avalonia.Gif.csproj +++ b/Avalonia.Gif/Avalonia.Gif.csproj @@ -10,7 +10,7 @@ true - + diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a08a1ca..9f127f79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to Stability Matrix will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). +## v2.9.0-pre.2 +### Changed +- (Internal) Updated to Avalonia 11.0.9 +### Fixed +- Fixed image viewer dialog arrow key navigation not working + ## v2.9.0-pre.1 ### Added - Added Inference Prompt Styles, with Prompt Expansion model support (i.e. Fooocus V2) diff --git a/StabilityMatrix.Avalonia.Diagnostics/StabilityMatrix.Avalonia.Diagnostics.csproj b/StabilityMatrix.Avalonia.Diagnostics/StabilityMatrix.Avalonia.Diagnostics.csproj index e635ad2f..71efd8bb 100644 --- a/StabilityMatrix.Avalonia.Diagnostics/StabilityMatrix.Avalonia.Diagnostics.csproj +++ b/StabilityMatrix.Avalonia.Diagnostics/StabilityMatrix.Avalonia.Diagnostics.csproj @@ -19,8 +19,8 @@ - - + + diff --git a/StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj b/StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj index 07665379..0b33f42b 100644 --- a/StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj +++ b/StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj @@ -39,13 +39,13 @@ - + - - - + + + - + @@ -65,8 +65,8 @@ - - + + @@ -77,24 +77,24 @@ - + - + - + - - + + - - + + diff --git a/StabilityMatrix.Avalonia/Views/Dialogs/ImageViewerDialog.axaml b/StabilityMatrix.Avalonia/Views/Dialogs/ImageViewerDialog.axaml index bafc43ad..ee304641 100644 --- a/StabilityMatrix.Avalonia/Views/Dialogs/ImageViewerDialog.axaml +++ b/StabilityMatrix.Avalonia/Views/Dialogs/ImageViewerDialog.axaml @@ -59,7 +59,7 @@ @@ -72,6 +72,7 @@ diff --git a/StabilityMatrix.Core/StabilityMatrix.Core.csproj b/StabilityMatrix.Core/StabilityMatrix.Core.csproj index 4fe1c9fe..de135217 100644 --- a/StabilityMatrix.Core/StabilityMatrix.Core.csproj +++ b/StabilityMatrix.Core/StabilityMatrix.Core.csproj @@ -17,7 +17,7 @@ - + @@ -32,9 +32,9 @@ - - - + + + @@ -42,10 +42,10 @@ - + - + @@ -53,11 +53,11 @@ - + - - + + diff --git a/StabilityMatrix.Tests/StabilityMatrix.Tests.csproj b/StabilityMatrix.Tests/StabilityMatrix.Tests.csproj index ad5c3f67..6283704a 100644 --- a/StabilityMatrix.Tests/StabilityMatrix.Tests.csproj +++ b/StabilityMatrix.Tests/StabilityMatrix.Tests.csproj @@ -17,18 +17,18 @@ - + - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/StabilityMatrix.UITests/StabilityMatrix.UITests.csproj b/StabilityMatrix.UITests/StabilityMatrix.UITests.csproj index 90484174..e44c1c98 100644 --- a/StabilityMatrix.UITests/StabilityMatrix.UITests.csproj +++ b/StabilityMatrix.UITests/StabilityMatrix.UITests.csproj @@ -15,21 +15,21 @@ - + - + - + - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 736ea7929279f25613af5da4f560bc37c33abda5 Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 28 Feb 2024 22:48:03 -0800 Subject: [PATCH 2/4] add System.Drawing.Common --- StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj | 1 + StabilityMatrix.UITests/StabilityMatrix.UITests.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj b/StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj index 0b33f42b..3b6779fa 100644 --- a/StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj +++ b/StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj @@ -95,6 +95,7 @@ + diff --git a/StabilityMatrix.UITests/StabilityMatrix.UITests.csproj b/StabilityMatrix.UITests/StabilityMatrix.UITests.csproj index e44c1c98..d4c1e79e 100644 --- a/StabilityMatrix.UITests/StabilityMatrix.UITests.csproj +++ b/StabilityMatrix.UITests/StabilityMatrix.UITests.csproj @@ -19,6 +19,7 @@ + From 50b7c2cdff862214b7e2471676dcc8abced8a365 Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 28 Feb 2024 22:56:43 -0800 Subject: [PATCH 3/4] added `--launch-package` argument for launching a package on startup --- CHANGELOG.md | 2 ++ StabilityMatrix.Avalonia/Models/AppArgs.cs | 3 +++ .../ViewModels/LaunchPageViewModel.cs | 22 +++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f127f79..95f5de92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). ## v2.9.0-pre.2 +### Added +- Added `--launch-package` argument to launch a specific package on startup, using display name or package ID (i.e. `--launch-package "Stable Diffusion WebUI Forge"` or `--launch-package c0b3ecc5-9664-4be9-952d-a10b3dcaee14`) ### Changed - (Internal) Updated to Avalonia 11.0.9 ### Fixed diff --git a/StabilityMatrix.Avalonia/Models/AppArgs.cs b/StabilityMatrix.Avalonia/Models/AppArgs.cs index b1e72bf9..ff094d03 100644 --- a/StabilityMatrix.Avalonia/Models/AppArgs.cs +++ b/StabilityMatrix.Avalonia/Models/AppArgs.cs @@ -77,6 +77,9 @@ public class AppArgs [Option("data-dir", HelpText = "Override data directory")] public string? DataDirectoryOverride { get; set; } + [Option("launch-package", HelpText = "Package ID or name to launch on startup")] + public string? LaunchPackageName { get; set; } + /// /// Custom Uri protocol handler /// This will send the Uri to the running instance of the app via IPC and exit diff --git a/StabilityMatrix.Avalonia/ViewModels/LaunchPageViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/LaunchPageViewModel.cs index f3a61a29..522eb590 100644 --- a/StabilityMatrix.Avalonia/ViewModels/LaunchPageViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/LaunchPageViewModel.cs @@ -181,6 +181,26 @@ public partial class LaunchPageViewModel : PageViewModelBase, IDisposable, IAsyn } } + protected override Task OnInitialLoadedAsync() + { + if (string.IsNullOrWhiteSpace(Program.Args.LaunchPackageName)) + return base.OnInitialLoadedAsync(); + + var package = InstalledPackages.FirstOrDefault(x => x.DisplayName == Program.Args.LaunchPackageName); + if (package is not null) + { + SelectedPackage = package; + return LaunchAsync(); + } + + package = InstalledPackages.FirstOrDefault(x => x.Id.ToString() == Program.Args.LaunchPackageName); + if (package is null) + return base.OnInitialLoadedAsync(); + + SelectedPackage = package; + return LaunchAsync(); + } + public override void OnLoaded() { // Load installed packages @@ -203,6 +223,8 @@ public partial class LaunchPageViewModel : PageViewModelBase, IDisposable, IAsyn // Load active package SelectedPackage = settingsManager.Settings.ActiveInstalledPackage; AutoScrollToEnd = settingsManager.Settings.AutoScrollLaunchConsoleToEnd; + + base.OnLoaded(); } [RelayCommand] From fb3257ed4f08db586f3532a6c09bc2c8bd6bcd98 Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 28 Feb 2024 22:58:00 -0800 Subject: [PATCH 4/4] added xmldoc --- StabilityMatrix.Avalonia/Models/AppArgs.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/StabilityMatrix.Avalonia/Models/AppArgs.cs b/StabilityMatrix.Avalonia/Models/AppArgs.cs index ff094d03..7f836b11 100644 --- a/StabilityMatrix.Avalonia/Models/AppArgs.cs +++ b/StabilityMatrix.Avalonia/Models/AppArgs.cs @@ -77,6 +77,10 @@ public class AppArgs [Option("data-dir", HelpText = "Override data directory")] public string? DataDirectoryOverride { get; set; } + /// + /// Launch an installed package on startup + /// Can use package ID or name + /// [Option("launch-package", HelpText = "Package ID or name to launch on startup")] public string? LaunchPackageName { get; set; }