mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
UI - Added setup wizard
This commit is contained in:
parent
aacf3d749b
commit
c6181ea823
@ -31,4 +31,15 @@
|
||||
</Style.Resources>
|
||||
<Setter Property="MaxWidth" Value="500" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Hyperlink" x:Key="ArtemisHyperlink">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
|
||||
<Setter Property="TextDecorations">
|
||||
<Setter.Value>
|
||||
<TextDecorationCollection>
|
||||
<TextDecoration />
|
||||
</TextDecorationCollection>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@ -10,12 +10,14 @@ using Artemis.Core.Services;
|
||||
using Artemis.UI.Events;
|
||||
using Artemis.UI.Screens.Modules;
|
||||
using Artemis.UI.Screens.Settings.Tabs.General;
|
||||
using Artemis.UI.Screens.SetupWizard;
|
||||
using Artemis.UI.Screens.Sidebar;
|
||||
using Artemis.UI.Services;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using Artemis.UI.Utilities;
|
||||
using MaterialDesignExtensions.Controls;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using Ninject;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens
|
||||
@ -25,8 +27,11 @@ namespace Artemis.UI.Screens
|
||||
private readonly IRegistrationService _builtInRegistrationService;
|
||||
private readonly PluginSetting<ApplicationColorScheme> _colorScheme;
|
||||
private readonly ICoreService _coreService;
|
||||
private readonly IWindowManager _windowManager;
|
||||
private readonly IDebugService _debugService;
|
||||
private readonly IKernel _kernel;
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
private readonly ISettingsService _settingsService;
|
||||
private readonly Timer _frameTimeUpdateTimer;
|
||||
private readonly SidebarViewModel _sidebarViewModel;
|
||||
private readonly ISnackbarMessageQueue _snackbarMessageQueue;
|
||||
@ -40,16 +45,21 @@ namespace Artemis.UI.Screens
|
||||
private string _windowTitle;
|
||||
|
||||
public RootViewModel(
|
||||
IKernel kernel,
|
||||
IEventAggregator eventAggregator,
|
||||
ISettingsService settingsService,
|
||||
ICoreService coreService,
|
||||
IWindowManager windowManager,
|
||||
IDebugService debugService,
|
||||
IRegistrationService builtInRegistrationService,
|
||||
ISnackbarMessageQueue snackbarMessageQueue,
|
||||
SidebarViewModel sidebarViewModel)
|
||||
{
|
||||
_kernel = kernel;
|
||||
_eventAggregator = eventAggregator;
|
||||
_settingsService = settingsService;
|
||||
_coreService = coreService;
|
||||
_windowManager = windowManager;
|
||||
_debugService = debugService;
|
||||
_builtInRegistrationService = builtInRegistrationService;
|
||||
_snackbarMessageQueue = snackbarMessageQueue;
|
||||
@ -57,16 +67,16 @@ namespace Artemis.UI.Screens
|
||||
|
||||
_frameTimeUpdateTimer = new Timer(500);
|
||||
|
||||
_colorScheme = settingsService.GetSetting("UI.ColorScheme", ApplicationColorScheme.Automatic);
|
||||
_windowSize = settingsService.GetSetting<WindowSize>("UI.RootWindowSize");
|
||||
_colorScheme = _settingsService.GetSetting("UI.ColorScheme", ApplicationColorScheme.Automatic);
|
||||
_windowSize = _settingsService.GetSetting<WindowSize>("UI.RootWindowSize");
|
||||
|
||||
_themeWatcher = new ThemeWatcher();
|
||||
ApplyColorSchemeSetting();
|
||||
|
||||
ActiveItem = sidebarViewModel.SelectedItem;
|
||||
ActiveItemReady = true;
|
||||
PinSidebar = settingsService.GetSetting("UI.PinSidebar", false);
|
||||
|
||||
PinSidebar = _settingsService.GetSetting("UI.PinSidebar", false);
|
||||
|
||||
AssemblyInformationalVersionAttribute versionAttribute = typeof(RootViewModel).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
WindowTitle = $"Artemis {versionAttribute?.InformationalVersion}";
|
||||
}
|
||||
@ -281,9 +291,18 @@ namespace Artemis.UI.Screens
|
||||
|
||||
_window = (MaterialWindow) View;
|
||||
|
||||
PluginSetting<bool> setupWizardCompleted = _settingsService.GetSetting("UI.SetupWizardCompleted", false);
|
||||
if (!setupWizardCompleted.Value)
|
||||
ShowSetupWizard();
|
||||
|
||||
base.OnInitialActivate();
|
||||
}
|
||||
|
||||
private void ShowSetupWizard()
|
||||
{
|
||||
_windowManager.ShowDialog(_kernel.Get<SetupWizardViewModel>());
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
// Ensure no element with focus can leak, if we don't do this the root VM is retained by Window.EffectiveValues
|
||||
|
||||
@ -80,6 +80,29 @@
|
||||
</Grid>
|
||||
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" VerticalAlignment="Center">
|
||||
<TextBlock Style="{StaticResource MaterialDesignTextBlock}">Setup wizard</TextBlock>
|
||||
<TextBlock Style="{StaticResource MaterialDesignTextBlock}" Foreground="{DynamicResource MaterialDesignNavigationItemSubheader}">
|
||||
Opens the setup wizard usually shown when Artemis first starts.
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
|
||||
<Button Style="{StaticResource MaterialDesignOutlinedButton}" Command="{s:Action ShowSetupWizard}" Width="150">
|
||||
SHOW WIZARD
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
@ -148,7 +171,7 @@
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
|
||||
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
|
||||
@ -7,9 +7,11 @@ using System.Threading.Tasks;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.LayerBrushes;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.UI.Screens.SetupWizard;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using Artemis.UI.Shared;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using Ninject;
|
||||
using Serilog.Events;
|
||||
using Stylet;
|
||||
|
||||
@ -18,6 +20,8 @@ namespace Artemis.UI.Screens.Settings.Tabs.General
|
||||
public class GeneralSettingsTabViewModel : Screen
|
||||
{
|
||||
private readonly IDebugService _debugService;
|
||||
private readonly IKernel _kernel;
|
||||
private readonly IWindowManager _windowManager;
|
||||
private readonly IDialogService _dialogService;
|
||||
private readonly ISettingsService _settingsService;
|
||||
private List<Tuple<string, double>> _renderScales;
|
||||
@ -25,10 +29,18 @@ namespace Artemis.UI.Screens.Settings.Tabs.General
|
||||
private List<Tuple<string, int>> _targetFrameRates;
|
||||
private readonly PluginSetting<LayerBrushReference> _defaultLayerBrushDescriptor;
|
||||
|
||||
public GeneralSettingsTabViewModel(IDialogService dialogService, IDebugService debugService, ISettingsService settingsService, IPluginManagementService pluginManagementService)
|
||||
public GeneralSettingsTabViewModel(
|
||||
IKernel kernel,
|
||||
IWindowManager windowManager,
|
||||
IDialogService dialogService,
|
||||
IDebugService debugService,
|
||||
ISettingsService settingsService,
|
||||
IPluginManagementService pluginManagementService)
|
||||
{
|
||||
DisplayName = "GENERAL";
|
||||
|
||||
_kernel = kernel;
|
||||
_windowManager = windowManager;
|
||||
_dialogService = dialogService;
|
||||
_debugService = debugService;
|
||||
_settingsService = settingsService;
|
||||
@ -199,6 +211,11 @@ namespace Artemis.UI.Screens.Settings.Tabs.General
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowSetupWizard()
|
||||
{
|
||||
_windowManager.ShowDialog(_kernel.Get<SetupWizardViewModel>());
|
||||
}
|
||||
|
||||
public void ShowDataFolder()
|
||||
{
|
||||
try
|
||||
|
||||
63
src/Artemis.UI/Screens/SetupWizard/SetupWizardView.xaml
Normal file
63
src/Artemis.UI/Screens/SetupWizard/SetupWizardView.xaml
Normal file
@ -0,0 +1,63 @@
|
||||
<mde:MaterialWindow x:Class="Artemis.UI.Screens.SetupWizard.SetupWizardView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.SetupWizard"
|
||||
xmlns:mde="https://spiegelp.github.io/MaterialDesignExtensions/winfx/xaml"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
Width="800"
|
||||
Height="600"
|
||||
ResizeMode="NoResize"
|
||||
Icon="/Resources/Images/Logo/logo-512.png"
|
||||
Title="Artemis setup wizard"
|
||||
TitleBarIcon="{StaticResource BowIcon}"
|
||||
Foreground="{DynamicResource MaterialDesignBody}"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
|
||||
<mde:Stepper IsLinear="True" Layout="Horizontal" ActiveStepChanged="{s:Action ActiveStepChanged}" CancelNavigation="{s:Action SkipOrFinishWizard}" Margin="15">
|
||||
<mde:Step>
|
||||
<mde:Step.Header>
|
||||
<mde:StepTitleHeader FirstLevelTitle="Welcome" />
|
||||
</mde:Step.Header>
|
||||
<mde:Step.Content>
|
||||
<ContentControl s:View.Model="{Binding ActiveItem}" />
|
||||
</mde:Step.Content>
|
||||
</mde:Step>
|
||||
<mde:Step>
|
||||
<mde:Step.Header>
|
||||
<mde:StepTitleHeader FirstLevelTitle="Devices" SecondLevelTitle="Pick your brands" />
|
||||
</mde:Step.Header>
|
||||
<mde:Step.Content>
|
||||
<ContentControl s:View.Model="{Binding ActiveItem}" />
|
||||
</mde:Step.Content>
|
||||
</mde:Step>
|
||||
<mde:Step>
|
||||
<mde:Step.Header>
|
||||
<mde:StepTitleHeader FirstLevelTitle="Desktop layout" SecondLevelTitle="Map your surface" />
|
||||
</mde:Step.Header>
|
||||
<mde:Step.Content>
|
||||
<ContentControl s:View.Model="{Binding ActiveItem}" />
|
||||
</mde:Step.Content>
|
||||
</mde:Step>
|
||||
<mde:Step>
|
||||
<mde:Step.Header>
|
||||
<mde:StepTitleHeader FirstLevelTitle="Settings" SecondLevelTitle="Choose your preferences" />
|
||||
</mde:Step.Header>
|
||||
<mde:Step.Content>
|
||||
<ContentControl s:View.Model="{Binding ActiveItem}" />
|
||||
</mde:Step.Content>
|
||||
</mde:Step>
|
||||
<mde:Step>
|
||||
<mde:Step.Header>
|
||||
<mde:StepTitleHeader FirstLevelTitle="Finish" />
|
||||
</mde:Step.Header>
|
||||
<mde:Step.Content>
|
||||
<ContentControl s:View.Model="{Binding ActiveItem}" />
|
||||
</mde:Step.Content>
|
||||
</mde:Step>
|
||||
</mde:Stepper>
|
||||
</mde:MaterialWindow>
|
||||
64
src/Artemis.UI/Screens/SetupWizard/SetupWizardViewModel.cs
Normal file
64
src/Artemis.UI/Screens/SetupWizard/SetupWizardViewModel.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.UI.Screens.SetupWizard.Steps;
|
||||
using MaterialDesignExtensions.Controllers;
|
||||
using MaterialDesignExtensions.Controls;
|
||||
using MaterialDesignExtensions.Model;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SetupWizard
|
||||
{
|
||||
public class SetupWizardViewModel : Conductor<Screen>.Collection.OneActive
|
||||
{
|
||||
private readonly ISettingsService _settingsService;
|
||||
private StepperController _stepperController;
|
||||
|
||||
public SetupWizardViewModel(ISettingsService settingsService,
|
||||
WelcomeStepViewModel welcome,
|
||||
DevicesStepViewModel devices,
|
||||
LayoutStepViewModel layout,
|
||||
SettingsStepViewModel settings,
|
||||
FinishStepViewModel finish)
|
||||
{
|
||||
_settingsService = settingsService;
|
||||
Items.Add(welcome);
|
||||
Items.Add(devices);
|
||||
Items.Add(layout);
|
||||
Items.Add(settings);
|
||||
Items.Add(finish);
|
||||
|
||||
ActiveItem = Items.First();
|
||||
}
|
||||
|
||||
public void ActiveStepChanged(object sender, ActiveStepChangedEventArgs e)
|
||||
{
|
||||
Stepper stepper = (Stepper) sender;
|
||||
_stepperController = stepper.Controller;
|
||||
|
||||
int activeStepIndex = stepper.Steps.IndexOf(e.Step);
|
||||
ActiveItem = Items[activeStepIndex];
|
||||
}
|
||||
|
||||
public void SkipOrFinishWizard()
|
||||
{
|
||||
RequestClose();
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
PluginSetting<bool> setting = _settingsService.GetSetting("UI.SetupWizardCompleted", false);
|
||||
setting.Value = true;
|
||||
setting.Save();
|
||||
|
||||
base.OnClose();
|
||||
}
|
||||
|
||||
public void Continue()
|
||||
{
|
||||
_stepperController.Continue();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
<UserControl x:Class="Artemis.UI.Screens.SetupWizard.Steps.DevicesStepView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mde="https://spiegelp.github.io/MaterialDesignExtensions/winfx/xaml"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap">
|
||||
Devices are supported through the use of device providers. <LineBreak />
|
||||
In the list below you can enable device providers for each brand you own by checking <Run Text="Feature enabled" FontWeight="Bold" />.
|
||||
</TextBlock>
|
||||
|
||||
<ListBox Grid.Row="1" ItemsSource="{Binding Items}" HorizontalContentAlignment="Stretch" VirtualizingPanel.ScrollUnit="Pixel" Margin="0 15">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl s:View.Model="{Binding}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Grid.Row="2" Style="{StaticResource MaterialDesignBody1TextBlock}" Foreground="#FFB9A40A" TextWrapping="Wrap">
|
||||
<Run Text="Note:" FontWeight="Bold" /> To avoid possible instability it's recommended to disable the device providers of brands you don't own.
|
||||
</TextBlock>
|
||||
|
||||
<mde:StepButtonBar Grid.Row="3" VerticalAlignment="Bottom" Continue="CONTINUE" Back="BACK" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -0,0 +1,34 @@
|
||||
using System.Linq;
|
||||
using Artemis.Core.DeviceProviders;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.UI.Ninject.Factories;
|
||||
using Artemis.UI.Screens.Settings.Tabs.Plugins;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SetupWizard.Steps
|
||||
{
|
||||
public class DevicesStepViewModel : Conductor<PluginFeatureViewModel>.Collection.AllActive
|
||||
{
|
||||
private readonly IPluginManagementService _pluginManagementService;
|
||||
private readonly ISettingsVmFactory _settingsVmFactory;
|
||||
|
||||
public DevicesStepViewModel(IPluginManagementService pluginManagementService, ISettingsVmFactory settingsVmFactory)
|
||||
{
|
||||
_pluginManagementService = pluginManagementService;
|
||||
_settingsVmFactory = settingsVmFactory;
|
||||
}
|
||||
|
||||
#region Overrides of Screen
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnActivate()
|
||||
{
|
||||
Items.Clear();
|
||||
Items.AddRange(_pluginManagementService.GetFeaturesOfType<DeviceProvider>().Select(d => _settingsVmFactory.CreatePluginFeatureViewModel(d)));
|
||||
|
||||
base.OnActivate();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
66
src/Artemis.UI/Screens/SetupWizard/Steps/FinishStepView.xaml
Normal file
66
src/Artemis.UI/Screens/SetupWizard/Steps/FinishStepView.xaml
Normal file
@ -0,0 +1,66 @@
|
||||
<UserControl x:Class="Artemis.UI.Screens.SetupWizard.Steps.FinishStepView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.SetupWizard.Steps"
|
||||
xmlns:mde="https://spiegelp.github.io/MaterialDesignExtensions/winfx/xaml"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2">
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadline4TextBlock}">All finished!</TextBlock>
|
||||
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap">
|
||||
You are now ready to start using Artemis, enjoy! (●'◡'●)<LineBreak />
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap">
|
||||
To learn more about Artemis and how to use it you may find these resources useful:
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap" Margin="5 5 0 0">
|
||||
- The
|
||||
<Hyperlink NavigateUri="https://wiki.artemis-rgb.com/" RequestNavigate="{s:Action OpenHyperlink}" Style="{StaticResource ArtemisHyperlink}">
|
||||
Artemis wiki
|
||||
</Hyperlink>
|
||||
and more specifically the
|
||||
<Hyperlink NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/introduction" RequestNavigate="{s:Action OpenHyperlink}" Style="{StaticResource ArtemisHyperlink}">
|
||||
getting started
|
||||
</Hyperlink>
|
||||
guide
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap" Margin="5 0 0 0">
|
||||
- The Artemis
|
||||
<Hyperlink NavigateUri="https://github.com/Artemis-RGB/Artemis" RequestNavigate="{s:Action OpenHyperlink}" Style="{StaticResource ArtemisHyperlink}">
|
||||
GitHub repository
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap" Margin="5 0 0 0">
|
||||
- Our
|
||||
<Hyperlink NavigateUri="https://discord.gg/S3MVaC9" RequestNavigate="{s:Action OpenHyperlink}" Style="{StaticResource ArtemisHyperlink}">
|
||||
Discord server
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<mde:StepButtonBar Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" Back="BACK" />
|
||||
<Button Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="0 8"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{StaticResource MaterialDesignFlatButton}"
|
||||
Command="{s:Action Finish}">
|
||||
FINISH
|
||||
</Button>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -0,0 +1,18 @@
|
||||
using System.Windows.Navigation;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SetupWizard.Steps
|
||||
{
|
||||
public class FinishStepViewModel : Screen
|
||||
{
|
||||
public void OpenHyperlink(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
Core.Utilities.OpenUrl(e.Uri.AbsoluteUri);
|
||||
}
|
||||
|
||||
public void Finish()
|
||||
{
|
||||
((SetupWizardViewModel) Parent).SkipOrFinishWizard();
|
||||
}
|
||||
}
|
||||
}
|
||||
73
src/Artemis.UI/Screens/SetupWizard/Steps/LayoutStepView.xaml
Normal file
73
src/Artemis.UI/Screens/SetupWizard/Steps/LayoutStepView.xaml
Normal file
@ -0,0 +1,73 @@
|
||||
<UserControl x:Class="Artemis.UI.Screens.SetupWizard.Steps.LayoutStepView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.SetupWizard.Steps"
|
||||
xmlns:mde="https://spiegelp.github.io/MaterialDesignExtensions/winfx/xaml"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap">
|
||||
Artemis uses <Run Text="spatial awareness" FontStyle="Italic" /> to create realistic effects across multiple devices. <LineBreak />
|
||||
In order to do this correctly, we need to know where your devices are located on your desk.
|
||||
Select one of the two presets below, after the setup wizard finishes you can tweak this in detail in the <Run Text="Surface editor" FontWeight="Bold" Foreground="{StaticResource PrimaryHueMidBrush}"/>.
|
||||
</TextBlock>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource MaterialDesignFlatButton}"
|
||||
Foreground="{DynamicResource MaterialDesignBody}"
|
||||
Command="{s:Action ApplyLeftHandedPreset}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0 0 10 0"
|
||||
Width="280"
|
||||
Height="280"
|
||||
IsEnabled="False">
|
||||
<StackPanel>
|
||||
<materialDesign:PackIcon Kind="HandLeft" Width="150" Height="150" HorizontalAlignment="Center" />
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource MaterialDesignHeadline6TextBlock}" Margin="0 10 0 0">
|
||||
Left-handed preset
|
||||
</TextBlock>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource MaterialDesignBody2TextBlock}" TextWrapping="Wrap">
|
||||
A preset with the mouse on the left side of the keyboard
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource MaterialDesignFlatButton}"
|
||||
Foreground="{DynamicResource MaterialDesignBody}"
|
||||
Command="{s:Action ApplyRightHandedPreset}"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="10 0 0 0"
|
||||
Width="280"
|
||||
Height="280">
|
||||
<StackPanel>
|
||||
<materialDesign:PackIcon Kind="HandRight" Width="150" Height="150" HorizontalAlignment="Center" />
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource MaterialDesignHeadline6TextBlock}" Margin="0 10 0 0">
|
||||
Right-handed preset
|
||||
</TextBlock>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource MaterialDesignBody2TextBlock}" TextWrapping="Wrap">
|
||||
A preset with the mouse on the right side of the keyboard
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<mde:StepButtonBar Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Bottom" Back="BACK" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -0,0 +1,29 @@
|
||||
using Artemis.Core.Services;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SetupWizard.Steps
|
||||
{
|
||||
public class LayoutStepViewModel : Screen
|
||||
{
|
||||
private readonly ISurfaceService _surfaceService;
|
||||
|
||||
public LayoutStepViewModel(ISurfaceService surfaceService)
|
||||
{
|
||||
_surfaceService = surfaceService;
|
||||
}
|
||||
|
||||
public void ApplyLeftHandedPreset()
|
||||
{
|
||||
_surfaceService.AutoArrange();
|
||||
SetupWizardViewModel setupWizardViewModel = (SetupWizardViewModel) Parent;
|
||||
setupWizardViewModel.Continue();
|
||||
}
|
||||
|
||||
public void ApplyRightHandedPreset()
|
||||
{
|
||||
_surfaceService.AutoArrange();
|
||||
SetupWizardViewModel setupWizardViewModel = (SetupWizardViewModel) Parent;
|
||||
setupWizardViewModel.Continue();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
<UserControl x:Class="Artemis.UI.Screens.SetupWizard.Steps.SettingsStepView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:mde="https://spiegelp.github.io/MaterialDesignExtensions/winfx/xaml"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap">
|
||||
Artemis comes with a variety of settings you can change to tweak everything to your liking. <LineBreak/>
|
||||
Below you can find a few relevant settings, many more can be changed later on the <Run Text="Settings" FontWeight="Bold" Foreground="{StaticResource PrimaryHueMidBrush}"/> page.
|
||||
</TextBlock>
|
||||
|
||||
<materialDesign:Card Grid.Row="1" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch" Margin="0 20 0 0">
|
||||
<StackPanel Margin="15">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Style="{StaticResource MaterialDesignTextBlock}">Start up with Windows</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
|
||||
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" IsChecked="{Binding StartWithWindows}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Style="{StaticResource MaterialDesignTextBlock}">Start up with Windows minimized</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
|
||||
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" IsChecked="{Binding StartMinimized}" IsEnabled="{Binding StartWithWindows}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Style="{StaticResource MaterialDesignTextBlock}">Color scheme</TextBlock>
|
||||
<TextBlock Style="{StaticResource MaterialDesignTextBlock}" Foreground="{DynamicResource MaterialDesignNavigationItemSubheader}" TextWrapping="Wrap">
|
||||
Pick between a light and dark color scheme, the automatic option copies your Windows settings.
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
|
||||
<ComboBox Width="80" SelectedValue="{Binding SelectedColorScheme}" ItemsSource="{Binding ColorSchemes}" SelectedValuePath="Value" DisplayMemberPath="Description" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
|
||||
<mde:StepButtonBar Grid.Row="2" VerticalAlignment="Bottom" Continue="CONTINUE" Back="BACK" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.UI.Screens.Settings.Tabs.General;
|
||||
using Artemis.UI.Screens.Settings.Tabs.Plugins;
|
||||
using Artemis.UI.Shared;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SetupWizard.Steps
|
||||
{
|
||||
public class SettingsStepViewModel : Conductor<PluginFeatureViewModel>.Collection.AllActive
|
||||
{
|
||||
private readonly IDialogService _dialogService;
|
||||
private readonly ISettingsService _settingsService;
|
||||
|
||||
public SettingsStepViewModel(IDialogService dialogService, ISettingsService settingsService)
|
||||
{
|
||||
_dialogService = dialogService;
|
||||
_settingsService = settingsService;
|
||||
|
||||
ColorSchemes = new BindableCollection<ValueDescription>(EnumUtilities.GetAllValuesAndDescriptions(typeof(ApplicationColorScheme)));
|
||||
}
|
||||
|
||||
public BindableCollection<ValueDescription> ColorSchemes { get; }
|
||||
|
||||
public bool StartWithWindows
|
||||
{
|
||||
get => _settingsService.GetSetting("UI.AutoRun", false).Value;
|
||||
set
|
||||
{
|
||||
_settingsService.GetSetting("UI.AutoRun", false).Value = value;
|
||||
_settingsService.GetSetting("UI.AutoRun", false).Save();
|
||||
Task.Run(ApplyAutorun);
|
||||
}
|
||||
}
|
||||
|
||||
public bool StartMinimized
|
||||
{
|
||||
get => !_settingsService.GetSetting("UI.ShowOnStartup", true).Value;
|
||||
set
|
||||
{
|
||||
_settingsService.GetSetting("UI.ShowOnStartup", true).Value = !value;
|
||||
_settingsService.GetSetting("UI.ShowOnStartup", true).Save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ApplicationColorScheme SelectedColorScheme
|
||||
{
|
||||
get => _settingsService.GetSetting("UI.ColorScheme", ApplicationColorScheme.Automatic).Value;
|
||||
set
|
||||
{
|
||||
_settingsService.GetSetting("UI.ColorScheme", ApplicationColorScheme.Automatic).Value = value;
|
||||
_settingsService.GetSetting("UI.ColorScheme", ApplicationColorScheme.Automatic).Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyAutorun()
|
||||
{
|
||||
try
|
||||
{
|
||||
string autoRunFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "Artemis.lnk");
|
||||
string executableFile = Constants.ExecutablePath;
|
||||
|
||||
if (File.Exists(autoRunFile))
|
||||
File.Delete(autoRunFile);
|
||||
if (StartWithWindows)
|
||||
ShortcutUtilities.Create(autoRunFile, executableFile, "--autorun", new FileInfo(executableFile).DirectoryName, "Artemis", "", "");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_dialogService.ShowExceptionDialog("An exception occured while trying to apply the auto run setting", e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<UserControl x:Class="Artemis.UI.Screens.SetupWizard.Steps.WelcomeStepView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mde="https://spiegelp.github.io/MaterialDesignExtensions/winfx/xaml"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadline4TextBlock}">Welcome to the Artemis setup wizard!</TextBlock>
|
||||
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap">
|
||||
In this wizard we'll walk you through the initial configuration of Artemis.<LineBreak/>
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap">
|
||||
Before you can start you need to tell Artemis which devices you want to use and where they are placed on your desk.
|
||||
You will also get the opportunity to choose some plugins to start off with.<LineBreak/>
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Foreground="{DynamicResource MaterialDesignBodyLight}" TextWrapping="Wrap">
|
||||
PS: You can also skip the wizard and set things up yourself.<LineBreak/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<mde:StepButtonBar Grid.Row="1" VerticalAlignment="Bottom" Continue="CONTINUE" Cancel="SKIP WIZARD"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using Artemis.UI.Shared;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SetupWizard.Steps
|
||||
{
|
||||
public class WelcomeStepViewModel : Screen
|
||||
{
|
||||
public WelcomeStepViewModel()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user