浏览代码

Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser

Luke Pulverenti 10 年之前
父节点
当前提交
43ce443832

+ 8 - 7
MediaBrowser.Server.Mac.sln

@@ -286,13 +286,14 @@ Global
 		{C97B98FA-00D4-4880-88B8-C76017A418AB}.Release|x86.Build.0 = Release|Any CPU
 		{C97B98FA-00D4-4880-88B8-C76017A418AB}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(MonoDevelopProperties) = preSolution
 	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = MediaBrowser.Server.Mac\MediaBrowser.Server.Mac.csproj
-		Policies = $0
-		$0.DotNetNamingPolicy = $1
-		$1.DirectoryNamespaceAssociation = None
-		$1.ResourceNamePolicy = FileFormatDefault
-		$0.VersionControlPolicy = $2
-		$2.inheritsSet = Mono
+		StartupItems = $0
+		$0.Item = MediaBrowser.Server.Mac\MediaBrowser.Server.Mac.csproj
+		Policies = $1
+		$1.DotNetNamingPolicy = $2
+		$2.DirectoryNamespaceAssociation = None
+		$2.ResourceNamePolicy = FileFormatDefault
+		$1.VersionControlPolicy = $3
+		$3.inheritsSet = Mono
 		version = 
 		version = 
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal

+ 31 - 9
MediaBrowser.Server.Mac.userprefs

@@ -1,24 +1,46 @@
 <Properties>
 <Properties>
-  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="MediaBrowser.Server.Mac/AppController.cs">
+  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" />
+  <MonoDevelop.Ide.Workbench ActiveDocument="MediaBrowser.Server.Mac/Main.cs">
     <Files>
     <Files>
-      <File FileName="MediaBrowser.Server.Mac/MainWindowController.cs" Line="1" Column="1" />
-      <File FileName="MediaBrowser.Server.Mac/AppDelegate.cs" Line="4" Column="4" />
-      <File FileName="MediaBrowser.Server.Mac/AppController.cs" Line="14" Column="14" />
+      <File FileName="MediaBrowser.Server.Mac/AppController.cs" Line="4" Column="4" />
+      <File FileName="MediaBrowser.Server.Mac/Main.cs" Line="4" Column="4" />
+      <File FileName="MediaBrowser.Common.Implementations/BaseApplicationPaths.cs" Line="13" Column="13" />
+      <File FileName="MediaBrowser.Server.Mac/app.config" Line="56" Column="56" />
+      <File FileName="MediaBrowser.WebDashboard/Api/PackageCreator.cs" Line="99" Column="99" />
+      <File FileName="MediaBrowser.Server.Mac/EmptyXmlFile.xml" Line="1" Column="1" />
+      <File FileName="MediaBrowser.Server.Mono/Program.cs" Line="9" Column="9" />
+      <File FileName="MediaBrowser.Server.Mac/AppDelegate.cs" Line="1" Column="1" />
+      <File FileName="MediaBrowser.Server.Mono/Networking/NetworkManager.cs" Line="1" Column="1" />
+      <File FileName="MediaBrowser.Server.Mono/Native/NativeApp.cs" Line="37" Column="37" />
     </Files>
     </Files>
     <Pads>
     <Pads>
       <Pad Id="ProjectPad">
       <Pad Id="ProjectPad">
-        <State expanded="True">
+        <State expanded="True" selected="True">
+          <Node name="MediaBrowser.Common.Implementations" expanded="True">
+            <Node name="Devices" expanded="True" />
+          </Node>
+          <Node name="MediaBrowser.Server.Implementations" expanded="True" />
           <Node name="MediaBrowser.Server.Mac" expanded="True">
           <Node name="MediaBrowser.Server.Mac" expanded="True">
-            <Node name="AppDelegate.cs" expanded="True" />
-            <Node name="MainMenu.xib" selected="True" />
+            <Node name="Native" expanded="True" />
+          </Node>
+          <Node name="MediaBrowser.Server.Mono" expanded="True">
+            <Node name="Networking" expanded="True" />
+          </Node>
+          <Node name="MediaBrowser.Server.Startup.Common" expanded="True" />
+          <Node name="MediaBrowser.WebDashboard" expanded="True">
+            <Node name="Api" expanded="True" />
           </Node>
           </Node>
+          <Node name="MediaBrowser.XbmcMetadata" expanded="True" />
+          <Node name="OpenSubtitlesHandler" expanded="True" />
         </State>
         </State>
       </Pad>
       </Pad>
     </Pads>
     </Pads>
   </MonoDevelop.Ide.Workbench>
   </MonoDevelop.Ide.Workbench>
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
-    <BreakpointStore />
+    <BreakpointStore>
+      <Breakpoint file="/Users/luke/MediaBrowser/MediaBrowser.Server.Mac/Main.cs" line="58" column="1" />
+      <Breakpoint file="/Users/luke/MediaBrowser/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs" line="233" column="1" />
+    </BreakpointStore>
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
   <MonoDevelop.Ide.DebuggingService.PinnedWatches />
   <MonoDevelop.Ide.DebuggingService.PinnedWatches />
 </Properties>
 </Properties>

+ 1 - 0
MediaBrowser.Server.Mac/AppController.cs

@@ -25,6 +25,7 @@ namespace MediaBrowser.Server.Mac
 		public AppController()
 		public AppController()
 		{
 		{
 			Instance = this;
 			Instance = this;
+			MainClass.AddDependencies (this);
 		}
 		}
 
 
 		public override void AwakeFromNib()
 		public override void AwakeFromNib()

+ 9 - 13
MediaBrowser.Server.Mac/Main.cs

@@ -15,7 +15,6 @@ using MediaBrowser.Common.Implementations.IO;
 using MediaBrowser.Common.Implementations.Logging;
 using MediaBrowser.Common.Implementations.Logging;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Server.Implementations;
 using MediaBrowser.Server.Implementations;
-using MediaBrowser.Server.Mono.Native;
 using MediaBrowser.Server.Startup.Common;
 using MediaBrowser.Server.Startup.Common;
 using MediaBrowser.Server.Startup.Common.Browser;
 using MediaBrowser.Server.Startup.Common.Browser;
 using Microsoft.Win32;
 using Microsoft.Win32;
@@ -54,26 +53,23 @@ namespace MediaBrowser.Server.Mac
 			AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
 			AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
 
 
 			StartApplication(appPaths, logManager, options);
 			StartApplication(appPaths, logManager, options);
-			RunNSApp (args);
-		}
-
-		private static void RunNSApp(string[] args) {
-		
 			NSApplication.Init ();
 			NSApplication.Init ();
-
-			AppController.Instance.AppHost = _appHost;
-			AppController.Instance.Logger = _logger;
-			AppController.Instance.ConfigurationManager = _appHost.ServerConfigurationManager;
-			AppController.Instance.Localization = _appHost.LocalizationManager;
-
 			NSApplication.Main (args);
 			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)
 		private static ServerApplicationPaths CreateApplicationPaths(string applicationPath, string programDataPath)
 		{
 		{
 			if (string.IsNullOrEmpty(programDataPath))
 			if (string.IsNullOrEmpty(programDataPath))
 			{
 			{
-				return new ServerApplicationPaths(applicationPath);
+				programDataPath = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "mediabrowser");
 			}
 			}
 
 
 			return new ServerApplicationPaths(programDataPath, applicationPath);
 			return new ServerApplicationPaths(programDataPath, applicationPath);

+ 3 - 1
MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj

@@ -72,9 +72,9 @@
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <Folder Include="Resources\" />
     <Folder Include="Resources\" />
+    <Folder Include="Native\" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <Compile Include="Main.cs" />
     <Compile Include="AppDelegate.cs" />
     <Compile Include="AppDelegate.cs" />
     <Compile Include="AppDelegate.designer.cs">
     <Compile Include="AppDelegate.designer.cs">
       <DependentUpon>AppDelegate.cs</DependentUpon>
       <DependentUpon>AppDelegate.cs</DependentUpon>
@@ -83,6 +83,8 @@
     <Compile Include="AppController.designer.cs">
     <Compile Include="AppController.designer.cs">
       <DependentUpon>AppController.cs</DependentUpon>
       <DependentUpon>AppController.cs</DependentUpon>
     </Compile>
     </Compile>
+    <Compile Include="Main.cs" />
+    <Compile Include="Native\NativeApp.cs" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <InterfaceDefinition Include="MainMenu.xib" />
     <InterfaceDefinition Include="MainMenu.xib" />

+ 20 - 0
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();
+		}
+	}
+}
+

+ 1 - 1
MediaBrowser.Server.Mono/Native/NativeApp.cs

@@ -4,7 +4,7 @@ namespace MediaBrowser.Server.Mono.Native
     /// <summary>
     /// <summary>
     /// Class NativeApp
     /// Class NativeApp
     /// </summary>
     /// </summary>
-    public class NativeApp : BaseMonoApp
+    internal class NativeApp : BaseMonoApp
     {
     {
         /// <summary>
         /// <summary>
         /// Shutdowns this instance.
         /// Shutdowns this instance.