Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mostly working app on MacOS #2352

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions NexusMods.App.sln
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,17 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NexusMods.Abstractions.Resources.Resilience", "src\Abstractions\NexusMods.Abstractions.Resources.Resilience\NexusMods.Abstractions.Resources.Resilience.csproj", "{04219A58-C99C-4C3B-A477-5E4B29D1F275}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NexusMods.Abstractions.UI", "src\Abstractions\NexusMods.Abstractions.UI\NexusMods.Abstractions.UI.csproj", "{A7417BB1-7E2C-413A-A999-546F021F683B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NexusMods.DataModel.SchemaVersions", "src\NexusMods.DataModel.SchemaVersions\NexusMods.DataModel.SchemaVersions.csproj", "{79E13AD1-187B-42F7-BDC3-EF8ABA308973}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NexusMods.DataModel.SchemaVersions.Tests", "tests\NexusMods.DataModel.SchemaVersions.Tests\NexusMods.DataModel.SchemaVersions.Tests.csproj", "{A5A2932D-B3EF-480B-BEBC-793F6FC90EDE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NexusMods.Games.MountAndBlade2Bannerlord", "src\Games\NexusMods.Games.MountAndBlade2Bannerlord\NexusMods.Games.MountAndBlade2Bannerlord.csproj", "{8D7E82BB-2F8D-455A-AF12-C486D9EC3B77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NexusMods.App.MacOS", "src\NexusMods.App.MacOS\NexusMods.App.MacOS.csproj", "{8375D256-3C4F-437E-911E-5EC101422A9A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NexusMods.App.Common", "src\NexusMods.App.Common\NexusMods.App.Common.csproj", "{28E7A782-DCC9-4769-A209-8D4601BCEFEC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -721,6 +726,14 @@ Global
{8D7E82BB-2F8D-455A-AF12-C486D9EC3B77}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D7E82BB-2F8D-455A-AF12-C486D9EC3B77}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D7E82BB-2F8D-455A-AF12-C486D9EC3B77}.Release|Any CPU.Build.0 = Release|Any CPU
{8375D256-3C4F-437E-911E-5EC101422A9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8375D256-3C4F-437E-911E-5EC101422A9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8375D256-3C4F-437E-911E-5EC101422A9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8375D256-3C4F-437E-911E-5EC101422A9A}.Release|Any CPU.Build.0 = Release|Any CPU
{28E7A782-DCC9-4769-A209-8D4601BCEFEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28E7A782-DCC9-4769-A209-8D4601BCEFEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28E7A782-DCC9-4769-A209-8D4601BCEFEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28E7A782-DCC9-4769-A209-8D4601BCEFEC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -849,6 +862,8 @@ Global
{79E13AD1-187B-42F7-BDC3-EF8ABA308973} = {E7BAE287-D505-4D6D-A090-665A64309B2D}
{A5A2932D-B3EF-480B-BEBC-793F6FC90EDE} = {52AF9D62-7D5B-4AD0-BA12-86F2AA67428B}
{8D7E82BB-2F8D-455A-AF12-C486D9EC3B77} = {70D38D24-79AE-4600-8E83-17F3C11BA81F}
{8375D256-3C4F-437E-911E-5EC101422A9A} = {E7BAE287-D505-4D6D-A090-665A64309B2D}
{28E7A782-DCC9-4769-A209-8D4601BCEFEC} = {E7BAE287-D505-4D6D-A090-665A64309B2D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9F9F8352-34DD-42C0-8564-EE9AF34A3501}
Expand Down
2 changes: 1 addition & 1 deletion src/Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ public class Program
/// </summary>
// ReSharper disable once UnusedMember.Local
// ReSharper disable once UnusedMember.Global
public static AppBuilder BuildAvaloniaApp() => NexusMods.App.Program.BuildAvaloniaApp();
public static AppBuilder BuildAvaloniaApp() => NexusMods.App.Common.Program.BuildAvaloniaApp();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Application
x:Class="NexusMods.App.App"
x:Class="NexusMods.App.Common.App"
xmlns="https://github.com/avaloniaui"
xmlns:ui="using:NexusMods.App.UI"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
using NexusMods.App.UI;
using NexusMods.App.UI.Settings;
using NexusMods.App.UI.Windows;
using NexusMods.CLI.Types;
using ReactiveUI;
using Splat;
using Splat.Microsoft.Extensions.Logging;

namespace NexusMods.App;
namespace NexusMods.App.Common;

public class App : Application
{
Expand All @@ -25,13 +26,17 @@ public App(IServiceProvider provider)
{
_provider = provider;
_settingsManager = provider.GetRequiredService<ISettingsManager>();
Name = "Nexus Mods";

}

public App()
{
throw new UnreachableException("We don't use the Runtime Loader, so this should never be called.");
}



public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
Expand All @@ -57,6 +62,26 @@ public override void OnFrameworkInitializationCompleted()
var reactiveWindow = _provider.GetRequiredService<MainWindow>();
reactiveWindow.ViewModel = _provider.GetRequiredService<MainWindowViewModel>();
desktop.MainWindow = reactiveWindow;

var activatableLifetime = TryGetFeature(typeof(IActivatableLifetime));
if (activatableLifetime is IActivatableLifetime activatable)
{
activatable.Activated += async (_, args) =>
{
switch (args.Kind)
{
case ActivationKind.OpenUri:
var protocol = (ProtocolActivatedEventArgs)args;
logger.LogInformation("Got Url {Url}", protocol.Uri.ToString());
var handler = _provider.GetRequiredService<IIpcProtocolHandler>();
await handler.Handle(protocol.Uri.ToString(), CancellationToken.None);
break;
default:
break;
}
};
}

}

base.OnFrameworkInitializationCompleted();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.Extensions.Logging;
using NexusMods.App.BuildInfo;

namespace NexusMods.App;
namespace NexusMods.App.Common;

internal static partial class LogMessages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Concurrent;

namespace NexusMods.App;
namespace NexusMods.App.Common;

/// <summary>
/// Holds global information about the application.
Expand Down
56 changes: 56 additions & 0 deletions src/NexusMods.App.Common/NexusMods.App.Common.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ArchiveManagement\NexusMods.FileExtractor\NexusMods.FileExtractor.csproj" />
<ProjectReference Include="..\Games\NexusMods.Games.AdvancedInstaller.UI\NexusMods.Games.AdvancedInstaller.UI.csproj" />
<ProjectReference Include="..\Games\NexusMods.Games.FOMOD.UI\NexusMods.Games.FOMOD.UI.csproj" />
<ProjectReference Include="..\Games\NexusMods.Games.FOMOD\NexusMods.Games.FOMOD.csproj" />
<ProjectReference Include="..\Games\NexusMods.Games.Generic\NexusMods.Games.Generic.csproj" />
<ProjectReference Include="..\Games\NexusMods.Games.Larian\NexusMods.Games.Larian.csproj" />
<ProjectReference Include="..\Games\NexusMods.Games.MountAndBlade2Bannerlord\NexusMods.Games.MountAndBlade2Bannerlord.csproj" />
<ProjectReference Include="..\Games\NexusMods.Games.TestHarness\NexusMods.Games.TestHarness.csproj" />
<ProjectReference Include="..\Networking\NexusMods.Networking.Downloaders\NexusMods.Networking.Downloaders.csproj" />
<ProjectReference Include="..\Networking\NexusMods.Networking.HttpDownloader\NexusMods.Networking.HttpDownloader.csproj" />
<ProjectReference Include="..\Networking\NexusMods.Networking.NexusWebApi\NexusMods.Networking.NexusWebApi.csproj" />
<ProjectReference Include="..\NexusMods.App.UI\NexusMods.App.UI.csproj" />
<ProjectReference Include="..\NexusMods.App.Cli\NexusMods.App.Cli.csproj" />
<ProjectReference Include="..\NexusMods.Collections\NexusMods.Collections.csproj" />
<ProjectReference Include="..\NexusMods.DataModel\NexusMods.DataModel.csproj" />
<ProjectReference Include="..\NexusMods.Jobs\NexusMods.Jobs.csproj" />
<ProjectReference Include="..\NexusMods.Library\NexusMods.Library.csproj" />
<ProjectReference Include="..\NexusMods.ProxyConsole\NexusMods.ProxyConsole.csproj" />
<ProjectReference Include="..\NexusMods.Settings\NexusMods.Settings.csproj" />
<ProjectReference Include="..\NexusMods.SingleProcess\NexusMods.SingleProcess.csproj" />
<ProjectReference Include="..\NexusMods.Telemetry\NexusMods.Telemetry.csproj" />
<ProjectReference Include="..\Themes\NexusMods.Themes.NexusFluentDark\NexusMods.Themes.NexusFluentDark.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Games\NexusMods.Games.StardewValley\NexusMods.Games.StardewValley.csproj" />
<ProjectReference Include="..\Games\NexusMods.Games.RedEngine\NexusMods.Games.RedEngine.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" />
<PackageReference Include="NLog.Extensions.Logging" />
<PackageReference Include="Spectre.Console" />
</ItemGroup>

<ItemGroup>
<Compile Update="App.axaml.cs">
<DependentUpon>App.axaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Update="App.axaml.cs">
<DependentUpon>App.axaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>


</Project>
Loading
Loading