Skip to content

Commit

Permalink
update 3rd party deps and clean up typography in error view
Browse files Browse the repository at this point in the history
  • Loading branch information
13xforever committed Aug 28, 2023
1 parent bca9b35 commit e972406
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Ps3DiscDumper/Dumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Ps3DiscDumper;

public class Dumper: IDisposable
{
public const string Version = "4.0.1";
public const string Version = "4.0.2";

static Dumper() => Log.Info("PS3 Disc Dumper v" + Version);

Expand Down
2 changes: 1 addition & 1 deletion Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
12 changes: 6 additions & 6 deletions UI.Avalonia/UI.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.3" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.3" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.3" />
<PackageReference Include="Avalonia" Version="11.0.4" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.4" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.4" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.4" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.3" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.3" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.4" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
</ItemGroup>
Expand Down
6 changes: 5 additions & 1 deletion UI.Avalonia/ViewModels/ErrorStubViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
namespace UI.Avalonia.ViewModels;
using CommunityToolkit.Mvvm.ComponentModel;

namespace UI.Avalonia.ViewModels;

public partial class ErrorStubViewModel: ViewModelBase
{
[ObservableProperty] private bool uacIsEnabled = false;
public string UacInfoLink => "https://learn.microsoft.com/en-us/windows/security/application-security/application-control/user-account-control/";
}
28 changes: 28 additions & 0 deletions UI.Avalonia/ViewModels/ErrorStubViewModel.windows.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#if WINDOWS
using System;
using System.Security.AccessControl;
using IrdLibraryClient;
using Microsoft.Win32;

namespace UI.Avalonia.ViewModels;

public partial class ErrorStubViewModel: ViewModelBase
{

public ErrorStubViewModel()
{
try
{
using var key = Registry.LocalMachine.OpenSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Policies\System",
RegistryRights.ReadKey | RegistryRights.QueryValues
);
UacIsEnabled = key?.GetValue("EnableLUA") is 1;
}
catch (Exception e)
{
Log.Warn(e, "Failed to check UAC status");
}
}
}
#endif
33 changes: 22 additions & 11 deletions UI.Avalonia/Views/ErrorStub.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,40 @@
</ExperimentalAcrylicBorder>

<!-- title -->
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="11 11 0 0"
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="19 17 0 0"
FontSize="12"
IsVisible="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=IsExtendedIntoWindowDecorations}"
Text="{Binding PageTitle}"/>

<!-- message -->
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"
Margin="16 64 16 16">
<StackPanel Orientation="Horizontal" MaxWidth="568">
<TextBlock FontFamily="{Binding SymbolFontFamily}" FontSize="36"
Margin="0 0 16 0" Padding="0 4 0 0"
Foreground="{DynamicResource SystemFillColorCriticalBrush}"
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="16 48 16 16">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" MaxWidth="536" Margin="8 0">
<TextBlock FontFamily="{Binding SymbolFontFamily}"
Classes="Critical" FontSize="40" Padding="0 2 0 0"
Text="{Binding ValidationErrorSymbol}"/>
<TextBlock FontSize="28" TextWrapping="Wrap" ClipToBounds="True" MaxWidth="500">
Please do not run software as Administrator unless application was designed to properly handle it, and it is explicitly required.
<TextBlock Classes="TitleTextBlockStyle" Margin="16 0 52 0" TextAlignment="Left">
Unsupported security context
</TextBlock>
</StackPanel>
<StackPanel Margin="68 12 68 0">
<TextBlock Classes="BodyTextBlockStyle" TextWrapping="Wrap" IsVisible="{Binding UacIsEnabled}">
Please do not run software as an Administrator unless the application is designed to properly handle it, and it is explicitly required.
</TextBlock>
<TextBlock Classes="BodyTextBlockStyle" TextWrapping="Wrap" IsVisible="{Binding !UacIsEnabled}">
You are running software with Administrator privileges. Please do not disable standard security mechanisms built into operating systems, including User Account Control. <Button Classes="Link"
Command="{Binding OpenUrlCommand}" CommandParameter="{Binding UacInfoLink}">
Learn more
</Button>
</TextBlock>
</StackPanel>

<Button Margin="0 44 0 0" Padding="32 8" FontSize="24"
<Button Margin="0 24 0 0" Padding="32 8"
MinWidth="200" Height="48"
IsDefault="True" Classes="Accent"
HorizontalAlignment="Center"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
Click="Exit">
Exit
<TextBlock Classes="BodyTextBlockStyle">Exit</TextBlock>
</Button>
</StackPanel>

Expand Down

0 comments on commit e972406

Please sign in to comment.