mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Setup wizard - Added and auto-show on home open
UI - Slightly darkened W11 effect
This commit is contained in:
1 parent
5c1da6d2c4
commit
1210dc3f63
37 files changed
+1177
-487
No files matched your search
@@ -10,8 +10,10 @@ using System.Threading.Tasks;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.LayerBrushes;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.UI.Screens.StartupWizard;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using Artemis.UI.Shared;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using Avalonia;
|
||||
using DynamicData;
|
||||
using FluentAvalonia.Styling;
|
||||
@@ -26,12 +28,14 @@ namespace Artemis.UI.Screens.Settings
|
||||
private readonly PluginSetting<LayerBrushReference> _defaultLayerBrushDescriptor;
|
||||
private readonly ISettingsService _settingsService;
|
||||
private readonly IDebugService _debugService;
|
||||
private readonly IWindowService _windowService;
|
||||
|
||||
public GeneralTabViewModel(IKernel kernel, ISettingsService settingsService, IPluginManagementService pluginManagementService, IDebugService debugService)
|
||||
public GeneralTabViewModel(IKernel kernel, ISettingsService settingsService, IPluginManagementService pluginManagementService, IDebugService debugService, IWindowService windowService)
|
||||
{
|
||||
DisplayName = "General";
|
||||
_settingsService = settingsService;
|
||||
_debugService = debugService;
|
||||
_windowService = windowService;
|
||||
|
||||
List<LayerBrushProvider> layerBrushProviders = pluginManagementService.GetFeaturesOfType<LayerBrushProvider>();
|
||||
LayerBrushDescriptors = new ObservableCollection<LayerBrushDescriptor>(layerBrushProviders.SelectMany(l => l.LayerBrushDescriptors));
|
||||
@@ -48,7 +52,7 @@ namespace Artemis.UI.Screens.Settings
|
||||
|
||||
ShowLogs = ReactiveCommand.Create(ExecuteShowLogs);
|
||||
CheckForUpdate = ReactiveCommand.CreateFromTask(ExecuteCheckForUpdate);
|
||||
ShowSetupWizard = ReactiveCommand.Create(ExecuteShowSetupWizard);
|
||||
ShowSetupWizard = ReactiveCommand.CreateFromTask(ExecuteShowSetupWizard);
|
||||
ShowDebugger = ReactiveCommand.Create(ExecuteShowDebugger);
|
||||
ShowDataFolder = ReactiveCommand.Create(ExecuteShowDataFolder);
|
||||
}
|
||||
@@ -139,8 +143,9 @@ namespace Artemis.UI.Screens.Settings
|
||||
|
||||
#region Tools
|
||||
|
||||
private void ExecuteShowSetupWizard()
|
||||
private async Task ExecuteShowSetupWizard()
|
||||
{
|
||||
await _windowService.ShowDialogAsync<StartupWizardViewModel, bool>();
|
||||
}
|
||||
|
||||
private void ExecuteShowDebugger()
|
||||
@@ -164,11 +169,4 @@ namespace Artemis.UI.Screens.Settings
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum ApplicationColorScheme
|
||||
{
|
||||
Light,
|
||||
Dark,
|
||||
Automatic
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace Artemis.UI.Screens.Settings
|
||||
plugins.Connect()
|
||||
.Filter(pluginFilter)
|
||||
.Sort(SortExpressionComparer<Plugin>.Ascending(p => p.Info.Name))
|
||||
.TransformAsync(p => Dispatcher.UIThread.InvokeAsync(() => settingsVmFactory.CreatePluginSettingsViewModel(p), DispatcherPriority.Background))
|
||||
.TransformAsync(p => Dispatcher.UIThread.InvokeAsync(() => settingsVmFactory.PluginSettingsViewModel(p), DispatcherPriority.Background))
|
||||
.Bind(out ReadOnlyObservableCollection<PluginSettingsViewModel> pluginViewModels)
|
||||
.Subscribe();
|
||||
Plugins = pluginViewModels;
|
||||
@@ -88,9 +88,9 @@ namespace Artemis.UI.Screens.Settings
|
||||
// Wait for the VM to be created asynchronously (it would be better to respond to some event here)
|
||||
await Task.Delay(200);
|
||||
// Enable it via the VM to enable the prerequisite dialog
|
||||
PluginSettingsViewModel? pluginViewModel = Plugins.FirstOrDefault(i => i.Plugin == plugin);
|
||||
if (pluginViewModel is {IsEnabled: false})
|
||||
await pluginViewModel.UpdateEnabled(true);
|
||||
PluginSettingsViewModel? settingsViewModel = Plugins.FirstOrDefault(i => i.PluginViewModel.Plugin == plugin);
|
||||
if (settingsViewModel != null && !settingsViewModel.PluginViewModel.IsEnabled)
|
||||
await settingsViewModel.PluginViewModel.UpdateEnabled(true);
|
||||
|
||||
_notificationService.CreateNotification()
|
||||
.WithTitle("Plugin imported")
|
||||
|
||||
Reference in new issue
Block a user