mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 09:34:44 +01:00
update mac project
This commit is contained in:
@@ -25,6 +25,7 @@ namespace MediaBrowser.Server.Mac
|
||||
public AppController()
|
||||
{
|
||||
Instance = this;
|
||||
MainClass.AddDependencies (this);
|
||||
}
|
||||
|
||||
public override void AwakeFromNib()
|
||||
|
||||
@@ -15,7 +15,6 @@ using MediaBrowser.Common.Implementations.IO;
|
||||
using MediaBrowser.Common.Implementations.Logging;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Server.Implementations;
|
||||
using MediaBrowser.Server.Mono.Native;
|
||||
using MediaBrowser.Server.Startup.Common;
|
||||
using MediaBrowser.Server.Startup.Common.Browser;
|
||||
using Microsoft.Win32;
|
||||
@@ -54,26 +53,23 @@ namespace MediaBrowser.Server.Mac
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
|
||||
StartApplication(appPaths, logManager, options);
|
||||
RunNSApp (args);
|
||||
NSApplication.Init ();
|
||||
NSApplication.Main (args);
|
||||
var b = true;
|
||||
}
|
||||
|
||||
private static void RunNSApp(string[] args) {
|
||||
|
||||
NSApplication.Init ();
|
||||
|
||||
AppController.Instance.AppHost = _appHost;
|
||||
AppController.Instance.Logger = _logger;
|
||||
AppController.Instance.ConfigurationManager = _appHost.ServerConfigurationManager;
|
||||
AppController.Instance.Localization = _appHost.LocalizationManager;
|
||||
|
||||
NSApplication.Main (args);
|
||||
public static void AddDependencies(AppController appController){
|
||||
appController.AppHost = _appHost;
|
||||
appController.Logger = _logger;
|
||||
appController.ConfigurationManager = _appHost.ServerConfigurationManager;
|
||||
appController.Localization = _appHost.LocalizationManager;
|
||||
}
|
||||
|
||||
private static ServerApplicationPaths CreateApplicationPaths(string applicationPath, string programDataPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(programDataPath))
|
||||
{
|
||||
return new ServerApplicationPaths(applicationPath);
|
||||
programDataPath = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "mediabrowser");
|
||||
}
|
||||
|
||||
return new ServerApplicationPaths(programDataPath, applicationPath);
|
||||
|
||||
@@ -72,9 +72,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
<Folder Include="Native\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="AppDelegate.designer.cs">
|
||||
<DependentUpon>AppDelegate.cs</DependentUpon>
|
||||
@@ -83,6 +83,8 @@
|
||||
<Compile Include="AppController.designer.cs">
|
||||
<DependentUpon>AppController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="Native\NativeApp.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="MainMenu.xib" />
|
||||
|
||||
20
MediaBrowser.Server.Mac/Native/NativeApp.cs
Normal file
20
MediaBrowser.Server.Mac/Native/NativeApp.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using MediaBrowser.Server.Mono.Native;
|
||||
|
||||
namespace MediaBrowser.Server.Mac
|
||||
{
|
||||
/// <summary>
|
||||
/// Class NativeApp
|
||||
/// </summary>
|
||||
public class NativeApp : BaseMonoApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Shutdowns this instance.
|
||||
/// </summary>
|
||||
public override void Shutdown()
|
||||
{
|
||||
MainClass.Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user