mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Data model - Added data model visualization view model
Debugger - Split debugger into different tabs Debugger - Added data model debugger
This commit is contained in:
1 parent
291a343428
commit
796c0dc671
33 files changed
+565
-236
No files matched your search
@@ -46,15 +46,19 @@
|
||||
<materialDesign:PackIcon Kind="{Binding Icon}" Width="48" Height="48" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Center" />
|
||||
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Style="{StaticResource MaterialDesignTextBlock}" Text="{Binding PluginInfo.Name}" />
|
||||
<materialDesign:Card Grid.Column="2" Grid.Row="0"
|
||||
Background="#FF4343"
|
||||
Foreground="White"
|
||||
Height="22"
|
||||
Padding="4"
|
||||
Margin="0 -18 0 0"
|
||||
Visibility="{Binding DisplayLoadFailed, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}">
|
||||
LOAD FAILED
|
||||
</materialDesign:Card>
|
||||
<Button Grid.Column="2" Grid.Row="0"
|
||||
Background="#FF4343"
|
||||
BorderBrush="#FF7474"
|
||||
Foreground="White"
|
||||
Height="22"
|
||||
Padding="4"
|
||||
Margin="0 -18 0 0"
|
||||
Visibility="{Binding DisplayLoadFailed, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}"
|
||||
Style="{StaticResource MaterialDesignRaisedButton}"
|
||||
ToolTip="Click to see the full error that occured"
|
||||
Command="{s:Action ShowLoadException}">
|
||||
<TextBlock FontSize="11">LOAD FAILED</TextBlock>
|
||||
</Button>
|
||||
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
@@ -66,7 +70,7 @@
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
|
||||
<Button Style="{StaticResource MaterialDesignOutlinedButton}" ToolTip="MaterialDesignOutlinedButton" Margin="4" s:View.ActionTarget="{Binding}" Command="{s:Action OpenSettings}">
|
||||
<Button Style="{StaticResource MaterialDesignOutlinedButton}" ToolTip="MaterialDesignOutlinedButton" Margin="4" Command="{s:Action OpenSettings}">
|
||||
SETTINGS
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
@@ -32,23 +32,18 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
|
||||
public Plugin Plugin { get; set; }
|
||||
public PluginInfo PluginInfo { get; set; }
|
||||
|
||||
public string Type => Plugin.GetType().BaseType?.Name ?? Plugin.GetType().Name;
|
||||
|
||||
public bool Enabling { get; set; }
|
||||
public PackIconKind Icon => GetIconKind();
|
||||
public string Type => Plugin.GetType().BaseType?.Name ?? Plugin.GetType().Name;
|
||||
public bool CanOpenSettings => IsEnabled && Plugin.HasConfigurationViewModel;
|
||||
public bool DisplayLoadFailed => !Enabling && PluginInfo.LoadException != null;
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
get => PluginInfo.Enabled;
|
||||
get => Plugin.Enabled;
|
||||
set => Task.Run(() => UpdateEnabled(value));
|
||||
}
|
||||
|
||||
public bool CanOpenSettings => IsEnabled && Plugin.HasConfigurationViewModel;
|
||||
|
||||
public bool Enabling { get; set; }
|
||||
|
||||
public bool DisplayLoadFailed => !Enabling && !PluginInfo.LastEnableSuccessful;
|
||||
|
||||
public async Task OpenSettings()
|
||||
{
|
||||
try
|
||||
@@ -76,6 +71,14 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ShowLoadException()
|
||||
{
|
||||
if (PluginInfo.LoadException == null)
|
||||
return;
|
||||
|
||||
await _dialogService.ShowExceptionDialog("The plugin failed to load: " + PluginInfo.LoadException.Message, PluginInfo.LoadException);
|
||||
}
|
||||
|
||||
private PackIconKind GetIconKind()
|
||||
{
|
||||
if (PluginInfo.Icon != null)
|
||||
@@ -106,7 +109,7 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
|
||||
private async Task UpdateEnabled(bool enable)
|
||||
{
|
||||
if (PluginInfo.Enabled == enable)
|
||||
if (Plugin.Enabled == enable)
|
||||
{
|
||||
NotifyOfPropertyChange(nameof(IsEnabled));
|
||||
return;
|
||||
@@ -133,7 +136,6 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
try
|
||||
{
|
||||
_pluginService.EnablePlugin(Plugin);
|
||||
_snackbarMessageQueue.Enqueue($"Enabled plugin {PluginInfo.Name}");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user