aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mac
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-11-26 14:30:04 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-11-26 14:30:04 -0500
commit43ce4438320dd9025898dbb2fafa01bd1be72fb0 (patch)
treea1ac47e6ee1c70641c5421ba5d6a5a15f65fc537 /MediaBrowser.Server.Mac
parentdfed3a11bcbce756277606c08f11253b447d455d (diff)
parent13cef31b4f52ff61595bd2e4a12e217b022a2705 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Mac')
-rw-r--r--MediaBrowser.Server.Mac/AppController.cs1
-rw-r--r--MediaBrowser.Server.Mac/Main.cs22
-rw-r--r--MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj4
-rw-r--r--MediaBrowser.Server.Mac/Native/NativeApp.cs20
4 files changed, 33 insertions, 14 deletions
diff --git a/MediaBrowser.Server.Mac/AppController.cs b/MediaBrowser.Server.Mac/AppController.cs
index 1823e2152..c500084e2 100644
--- a/MediaBrowser.Server.Mac/AppController.cs
+++ b/MediaBrowser.Server.Mac/AppController.cs
@@ -25,6 +25,7 @@ namespace MediaBrowser.Server.Mac
public AppController()
{
Instance = this;
+ MainClass.AddDependencies (this);
}
public override void AwakeFromNib()
diff --git a/MediaBrowser.Server.Mac/Main.cs b/MediaBrowser.Server.Mac/Main.cs
index 88b9497ea..6b76a63f1 100644
--- a/MediaBrowser.Server.Mac/Main.cs
+++ b/MediaBrowser.Server.Mac/Main.cs
@@ -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);
- }
-
- 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);
+ var b = true;
+ }
+
+ 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);
diff --git a/MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj b/MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj
index 2f6787488..648bdca05 100644
--- a/MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj
+++ b/MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj
@@ -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" />
diff --git a/MediaBrowser.Server.Mac/Native/NativeApp.cs b/MediaBrowser.Server.Mac/Native/NativeApp.cs
new file mode 100644
index 000000000..aedce3d66
--- /dev/null
+++ b/MediaBrowser.Server.Mac/Native/NativeApp.cs
@@ -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();
+ }
+ }
+}
+