update mac project

This commit is contained in:
Luke 2014-11-26 20:56:14 -05:00
parent 4535368327
commit 89c0085e28
8 changed files with 3003 additions and 2943 deletions

View File

@ -1,18 +1,19 @@
<Properties> <Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="MediaBrowser.Server.Mac/Main.cs"> <MonoDevelop.Ide.Workbench ActiveDocument="MediaBrowser.Server.Mac/AppController.cs">
<Files> <Files>
<File FileName="MediaBrowser.Server.Mac/Main.cs" Line="120" Column="120" /> <File FileName="MediaBrowser.Server.Mac/AppController.cs" Line="28" Column="28" />
</Files> </Files>
<Pads> <Pads>
<Pad Id="ProjectPad"> <Pad Id="ProjectPad">
<State expanded="True"> <State expanded="True">
<Node name="MediaBrowser.Server.Mac" expanded="True" /> <Node name="MediaBrowser.Server.Mac" expanded="True">
<Node name="MediaBrowser.Server.Mono" expanded="True" /> <Node name="Resources" expanded="True">
<Node name="MediaBrowser.Server.Startup.Common" expanded="True" selected="True" /> <Node name="appicon.icns" selected="True" />
<Node name="MediaBrowser.WebDashboard" expanded="True"> </Node>
<Node name="Api" expanded="True" />
</Node> </Node>
<Node name="MediaBrowser.Server.Startup.Common" expanded="True" />
<Node name="MediaBrowser.WebDashboard" expanded="True" />
<Node name="MediaBrowser.XbmcMetadata" expanded="True" /> <Node name="MediaBrowser.XbmcMetadata" expanded="True" />
<Node name="OpenSubtitlesHandler" expanded="True" /> <Node name="OpenSubtitlesHandler" expanded="True" />
</State> </State>

View File

@ -26,29 +26,30 @@ namespace MediaBrowser.Server.Mac
{ {
Instance = this; Instance = this;
MainClass.AddDependencies (this); MainClass.AddDependencies (this);
ConfigurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated;
} }
public override void AwakeFromNib() public override void AwakeFromNib()
{ {
var statusItem = NSStatusBar.SystemStatusBar.CreateStatusItem(30); var statusItem = NSStatusBar.SystemStatusBar.CreateStatusItem(30);
statusItem.Menu = statusMenu; statusItem.Menu = statusMenu;
statusItem.Image = NSImage.ImageNamed("touchicon"); statusItem.Image = NSImage.ImageNamed("statusicon");
statusItem.HighlightMode = true; statusItem.HighlightMode = true;
statusItem.Menu.RemoveAllItems (); statusMenu.RemoveAllItems ();
browseMenuItem = new NSMenuItem ("Browse Media Library", "b", delegate { browseMenuItem = new NSMenuItem ("Browse Media Library", "b", delegate {
Browse (this); Browse (this);
}); });
statusItem.Menu.AddItem (browseMenuItem); statusMenu.AddItem (browseMenuItem);
configureMenuItem = new NSMenuItem ("Configure Media Browser", "c", delegate { configureMenuItem = new NSMenuItem ("Configure Media Browser", "c", delegate {
Configure (this); Configure (this);
}); });
statusItem.Menu.AddItem (configureMenuItem); statusMenu.AddItem (configureMenuItem);
developerMenuItem = new NSMenuItem ("Developer Resources"); developerMenuItem = new NSMenuItem ("Developer Resources");
statusItem.Menu.AddItem (developerMenuItem); statusMenu.AddItem (developerMenuItem);
var developerMenu = new NSMenu (); var developerMenu = new NSMenu ();
developerMenuItem.Submenu = developerMenu; developerMenuItem.Submenu = developerMenu;
@ -66,12 +67,14 @@ namespace MediaBrowser.Server.Mac
communityMenuItem = new NSMenuItem ("Visit Community", "v", delegate { communityMenuItem = new NSMenuItem ("Visit Community", "v", delegate {
Community (this); Community (this);
}); });
statusItem.Menu.AddItem (communityMenuItem); statusMenu.AddItem (communityMenuItem);
quitMenuItem = new NSMenuItem ("Quit", "q", delegate { quitMenuItem = new NSMenuItem ("Quit", "q", delegate {
Quit (this); Quit (this);
}); });
statusItem.Menu.AddItem (quitMenuItem); statusMenu.AddItem (quitMenuItem);
LocalizeText ();
} }
public IServerApplicationHost AppHost{ get; set;} public IServerApplicationHost AppHost{ get; set;}

View File

@ -5,13 +5,15 @@
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.MediaBrowser.MediaBrowser.Server.Mac</string> <string>com.MediaBrowser.MediaBrowser.Server.Mac</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>MediaBrowser.Server.Mac</string> <string>Media Browser</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>10.6</string> <string>10.6</string>
<key>LSUIElement</key> <key>LSUIElement</key>
<string>1</string> <string>1</string>
<key>LSMultipleInstancesProhibited</key>
<string>1</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
@ -20,5 +22,7 @@
<string>public.app-category.video</string> <string>public.app-category.video</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Media Browser</string> <string>Media Browser</string>
<key>CFBundleIconFile</key>
<string>appicon</string>
</dict> </dict>
</plist> </plist>

View File

@ -72,8 +72,9 @@ namespace MediaBrowser.Server.Mac
// TODO: Use CommonApplicationData? Will we always have write access? // TODO: Use CommonApplicationData? Will we always have write access?
programDataPath = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "mediabrowser-server"); programDataPath = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "mediabrowser-server");
} }
// p5437mav0ABB83l
var resourcesPath = Path.Combine(Path.GetDirectoryName (applicationPath), "Resources"); // Within the mac bundle, go uo two levels then down into Resources folder
var resourcesPath = Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName (applicationPath)), "Resources");
return new ServerApplicationPaths(programDataPath, applicationPath, resourcesPath); return new ServerApplicationPaths(programDataPath, applicationPath, resourcesPath);
} }
@ -109,9 +110,10 @@ namespace MediaBrowser.Server.Mac
var initProgress = new Progress<double>(); var initProgress = new Progress<double>();
var task = _appHost.Init(initProgress); var task = _appHost.Init(initProgress);
task = task.ContinueWith(new Action<Task>(a => _appHost.RunStartupTasks()));
Task.WaitAll(task); Task.WaitAll(task);
Task.Run (() => _appHost.RunStartupTasks());
} }
/// <summary> /// <summary>

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets async="true"></targets>
</nlog>
</configuration>

View File

Before

Width:  |  Height:  |  Size: 937 B

After

Width:  |  Height:  |  Size: 937 B