From 3830e8566eda3329f2fa22557aeb0bc395b8d2b0 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Mon, 24 Jul 2023 16:43:00 +0100 Subject: [PATCH 1/7] Fix race condition when opening window that causes a crash --- .../Controls/ProfileConfigurationIcon.axaml.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs b/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs index 9ad64cbf8..1a8e91334 100644 --- a/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs +++ b/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs @@ -50,6 +50,9 @@ public partial class ProfileConfigurationIcon : UserControl, IDisposable { Dispatcher.UIThread.Post(() => { + if (ConfigurationIcon is null) + return; + Stream? stream = ConfigurationIcon.GetIconStream(); if (stream == null) Content = new MaterialIcon {Kind = MaterialIconKind.QuestionMark}; From 44691dd5a8536ffcf90c6d7953380cac63871cda Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 27 Jul 2023 20:18:05 +0200 Subject: [PATCH 2/7] Show question mark in race condition --- .../Controls/ProfileConfigurationIcon.axaml.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs b/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs index 1a8e91334..dd652f0d8 100644 --- a/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs +++ b/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs @@ -50,11 +50,8 @@ public partial class ProfileConfigurationIcon : UserControl, IDisposable { Dispatcher.UIThread.Post(() => { - if (ConfigurationIcon is null) - return; - - Stream? stream = ConfigurationIcon.GetIconStream(); - if (stream == null) + Stream? stream = ConfigurationIcon?.GetIconStream(); + if (stream == null || ConfigurationIcon == null) Content = new MaterialIcon {Kind = MaterialIconKind.QuestionMark}; else LoadFromBitmap(ConfigurationIcon, stream); From 1c438be1589e67a11d1eba4de87b9633639593e4 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 27 Jul 2023 20:40:24 +0200 Subject: [PATCH 3/7] Feature flag out the workshop --- src/Artemis.UI/Artemis.UI.csproj | 24 ------------------- src/Artemis.UI/Routing/Routes.cs | 2 ++ .../Screens/Sidebar/SidebarViewModel.cs | 2 ++ src/Artemis.UI/Styles/Artemis.axaml | 2 +- 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index be43581c5..170dec4e1 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -43,28 +43,4 @@ - - - - - - - - - - - - - - - - - ProfileListEntryView.axaml - Code - - - StartupWizardView.axaml - Code - - \ No newline at end of file diff --git a/src/Artemis.UI/Routing/Routes.cs b/src/Artemis.UI/Routing/Routes.cs index cacfab87c..d2709888a 100644 --- a/src/Artemis.UI/Routing/Routes.cs +++ b/src/Artemis.UI/Routing/Routes.cs @@ -16,6 +16,7 @@ public static class Routes public static List ArtemisRoutes = new() { new RouteRegistration("home"), + #if DEBUG new RouteRegistration("workshop") { Children = new List() @@ -26,6 +27,7 @@ public static class Routes new RouteRegistration("layouts/{entryId:guid}") } }, + #endif new RouteRegistration("surface-editor"), new RouteRegistration("settings") { diff --git a/src/Artemis.UI/Screens/Sidebar/SidebarViewModel.cs b/src/Artemis.UI/Screens/Sidebar/SidebarViewModel.cs index 3e666815b..039cc2404 100644 --- a/src/Artemis.UI/Screens/Sidebar/SidebarViewModel.cs +++ b/src/Artemis.UI/Screens/Sidebar/SidebarViewModel.cs @@ -39,11 +39,13 @@ public class SidebarViewModel : ActivatableViewModelBase SidebarScreen = new SidebarScreenViewModel(MaterialIconKind.Abacus, ROOT_SCREEN, "", null, new ObservableCollection() { new(MaterialIconKind.HomeOutline, "Home", "home"), + #if DEBUG new(MaterialIconKind.TestTube, "Workshop", "workshop", null, new ObservableCollection { new(MaterialIconKind.FolderVideo, "Profiles", "workshop/profiles/1", "workshop/profiles"), new(MaterialIconKind.KeyboardVariant, "Layouts", "workshop/layouts/1", "workshop/layouts"), }), + #endif new(MaterialIconKind.Devices, "Surface Editor", "surface-editor"), new(MaterialIconKind.SettingsOutline, "Settings", "settings") }); diff --git a/src/Artemis.UI/Styles/Artemis.axaml b/src/Artemis.UI/Styles/Artemis.axaml index a121ec71b..3b700ecdc 100644 --- a/src/Artemis.UI/Styles/Artemis.axaml +++ b/src/Artemis.UI/Styles/Artemis.axaml @@ -12,7 +12,7 @@ - + From 86a22a9d395d78b0641b956df012740e016d5990 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 27 Jul 2023 20:47:10 +0200 Subject: [PATCH 4/7] Upgrade RGB.NET and hide Mica option outside W11 --- src/Artemis.UI/Screens/Settings/Tabs/GeneralTabView.axaml | 4 ++-- src/Artemis.UI/Screens/Settings/Tabs/GeneralTabViewModel.cs | 2 ++ src/Artemis.props | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Artemis.UI/Screens/Settings/Tabs/GeneralTabView.axaml b/src/Artemis.UI/Screens/Settings/Tabs/GeneralTabView.axaml index c2c394214..378f37b64 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/GeneralTabView.axaml +++ b/src/Artemis.UI/Screens/Settings/Tabs/GeneralTabView.axaml @@ -45,7 +45,7 @@ - + Enable Mica effect @@ -56,7 +56,7 @@ - + diff --git a/src/Artemis.UI/Screens/Settings/Tabs/GeneralTabViewModel.cs b/src/Artemis.UI/Screens/Settings/Tabs/GeneralTabViewModel.cs index ca707b9e3..110c948e8 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/GeneralTabViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Tabs/GeneralTabViewModel.cs @@ -20,6 +20,7 @@ using Artemis.UI.Shared.Services.Builders; using Avalonia.Threading; using DryIoc; using DynamicData; +using FluentAvalonia.Interop; using ReactiveUI; using Serilog.Events; @@ -95,6 +96,7 @@ public class GeneralTabViewModel : ActivatableViewModelBase public ReactiveCommand ShowDataFolder { get; } public bool IsAutoRunSupported => _autoRunProvider != null; + public bool IsWindows11 => OSVersionHelper.IsWindows11(); public ObservableCollection LayerBrushDescriptors { get; } public ObservableCollection GraphicsContexts { get; } diff --git a/src/Artemis.props b/src/Artemis.props index 8bbeacbcb..6292d8cfa 100644 --- a/src/Artemis.props +++ b/src/Artemis.props @@ -2,7 +2,7 @@ 11.0.1 2.0.0 - 2.0.0-prerelease.83 + 2.0.0-prerelease.94 2.88.3 \ No newline at end of file From 704d649fba52d2eebeab379e3c60c3745d636927 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 30 Jul 2023 10:42:31 +0200 Subject: [PATCH 5/7] Core - Limit log file size to 5 MB and only retain max 14 log files --- src/Artemis.Core/DryIoc/Factories/LoggerFactory.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Artemis.Core/DryIoc/Factories/LoggerFactory.cs b/src/Artemis.Core/DryIoc/Factories/LoggerFactory.cs index ba5e90db7..3aaa23f08 100644 --- a/src/Artemis.Core/DryIoc/Factories/LoggerFactory.cs +++ b/src/Artemis.Core/DryIoc/Factories/LoggerFactory.cs @@ -13,7 +13,10 @@ internal class LoggerFactory : ILoggerFactory internal static readonly ILogger Logger = new LoggerConfiguration() .Enrich.FromLogContext() .WriteTo.File(Path.Combine(Constants.LogsFolder, "Artemis log-.log"), + fileSizeLimitBytes: 5 * 1024 * 1024, + rollOnFileSizeLimit: true, rollingInterval: RollingInterval.Day, + retainedFileCountLimit: 14, outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}") .WriteTo.Console() #if DEBUG From 2621542479f2d9a7646d677b5a185558e7c517fb Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 31 Jul 2023 22:30:52 +0200 Subject: [PATCH 6/7] Editor - Fixed crash when moving folders due to a race condition --- .../Panels/Properties/PropertiesViewModel.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/PropertiesViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/PropertiesViewModel.cs index 46228ff84..9ed832d8c 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/PropertiesViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/PropertiesViewModel.cs @@ -111,7 +111,6 @@ public class PropertiesViewModel : ActivatableViewModelBase } public RenderProfileElement? ProfileElement => _profileElement?.Value; - public Layer? Layer => _profileElement?.Value as Layer; public ILayerProperty? LayerProperty => _layerProperty?.Value; public bool SuspendedEditing => _suspendedEditing?.Value ?? false; @@ -133,26 +132,27 @@ public class PropertiesViewModel : ActivatableViewModelBase private void UpdatePropertyGroups() { - if (ProfileElement == null) + RenderProfileElement? profileElement = ProfileElement; + if (profileElement == null) { PropertyGroupViewModels.Clear(); return; } ObservableCollection viewModels = new(); - if (Layer != null) + if (profileElement is Layer layer) { // Add base VMs - viewModels.Add(GetOrCreatePropertyViewModel(Layer.General, null, null)); - viewModels.Add(GetOrCreatePropertyViewModel(Layer.Transform, null, null)); + viewModels.Add(GetOrCreatePropertyViewModel(layer.General, null, null)); + viewModels.Add(GetOrCreatePropertyViewModel(layer.Transform, null, null)); // Add brush VM if the brush has properties - if (Layer.LayerBrush?.BaseProperties != null) - viewModels.Add(GetOrCreatePropertyViewModel(Layer.LayerBrush.BaseProperties, Layer.LayerBrush, null)); + if (layer.LayerBrush?.BaseProperties != null) + viewModels.Add(GetOrCreatePropertyViewModel(layer.LayerBrush.BaseProperties, layer.LayerBrush, null)); } // Add effect VMs - foreach (BaseLayerEffect layerEffect in ProfileElement.LayerEffects.OrderBy(e => e.Order)) + foreach (BaseLayerEffect layerEffect in profileElement.LayerEffects.OrderBy(e => e.Order)) { if (layerEffect.BaseProperties != null) viewModels.Add(GetOrCreatePropertyViewModel(layerEffect.BaseProperties, null, layerEffect)); From e0869e4f28654afa926fdc4d8bb5e30610d93369 Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 9 Aug 2023 11:58:28 +0200 Subject: [PATCH 7/7] UI - Update Avalonia to 11.0.2 UI - Update FluentAvalonia to 2.0.1 --- src/Artemis.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Artemis.props b/src/Artemis.props index 6292d8cfa..a03be36cb 100644 --- a/src/Artemis.props +++ b/src/Artemis.props @@ -1,7 +1,7 @@ - 11.0.1 - 2.0.0 + 11.0.2 + 2.0.1 2.0.0-prerelease.94 2.88.3