diff --git a/MediaBrowser.Server.Mac/AppController.cs b/MediaBrowser.Server.Mac/AppController.cs
index 9e8e49dd0c..d2ef0cd924 100644
--- a/MediaBrowser.Server.Mac/AppController.cs
+++ b/MediaBrowser.Server.Mac/AppController.cs
@@ -1,3 +1,8 @@
+using MediaBrowser.Controller;
+using MediaBrowser.Controller.Configuration;
+using MediaBrowser.Controller.Localization;
+using MediaBrowser.Model.Logging;
+using MediaBrowser.Server.Startup.Common.Browser;
using System;
using MonoMac.Foundation;
using MonoMac.AppKit;
@@ -7,6 +12,14 @@ namespace MediaBrowser.Server.Mac
[Register("AppController")]
public partial class AppController : NSObject
{
+ private NSMenuItem browseMenuItem;
+ private NSMenuItem configureMenuItem;
+ private NSMenuItem developerMenuItem;
+ private NSMenuItem quitMenuItem;
+ private NSMenuItem githubMenuItem;
+ private NSMenuItem apiMenuItem;
+ private NSMenuItem communityMenuItem;
+
public AppController()
{
@@ -18,36 +31,78 @@ namespace MediaBrowser.Server.Mac
statusItem.Menu = statusMenu;
statusItem.Image = NSImage.ImageNamed("touchicon");
statusItem.HighlightMode = true;
+
+ statusItem.Menu.RemoveAllItems ();
+
+ browseMenuItem = new NSMenuItem ("Browse Media Library", "b", delegate {
+ Browse (this);
+ });
+ statusItem.Menu.AddItem (browseMenuItem);
+
+ configureMenuItem = new NSMenuItem ("Configure Media Browser", "c", delegate {
+ Configure (this);
+ });
+ statusItem.Menu.AddItem (configureMenuItem);
+
+ developerMenuItem = new NSMenuItem ("Developer Resources");
+ statusItem.Menu.AddItem (developerMenuItem);
+
+ var developerMenu = new NSMenu ();
+ developerMenuItem.Submenu = developerMenu;
+
+ apiMenuItem = new NSMenuItem ("Api Documentation", "a", delegate {
+ ApiDocs (this);
+ });
+ developerMenu.AddItem (apiMenuItem);
+
+ githubMenuItem = new NSMenuItem ("Github", "g", delegate {
+ Github (this);
+ });
+ developerMenu.AddItem (githubMenuItem);
+
+ communityMenuItem = new NSMenuItem ("Visit Community", "v", delegate {
+ Community (this);
+ });
+ statusItem.Menu.AddItem (communityMenuItem);
+
+ quitMenuItem = new NSMenuItem ("Quit", "q", delegate {
+ Quit (this);
+ });
+ statusItem.Menu.AddItem (quitMenuItem);
}
- partial void HelloWorld(NSObject sender)
- {
+ private IServerApplicationHost AppHost{ get; set;}
+ private ILogger Logger{ get; set;}
+ private void Quit(NSObject sender)
+ {
+ NSApplication.SharedApplication.Terminate(this);
+ //AppHost.Shutdown();
}
- partial void Quit(NSObject sender)
+ private void Community(NSObject sender)
{
-
+ BrowserLauncher.OpenCommunity(Logger);
}
- partial void Configure(NSObject sender)
+ private void Configure(NSObject sender)
{
-
+ BrowserLauncher.OpenDashboard(AppHost, Logger);
}
- partial void Browse(NSObject sender)
+ private void Browse(NSObject sender)
{
-
+ BrowserLauncher.OpenWebClient(AppHost, Logger);
}
- partial void Github(NSObject sender)
+ private void Github(NSObject sender)
{
-
+ BrowserLauncher.OpenGithub(Logger);
}
- partial void ApiDocs(NSObject sender)
+ private void ApiDocs(NSObject sender)
{
-
+ BrowserLauncher.OpenSwagger(AppHost, Logger);
}
}
}
diff --git a/MediaBrowser.Server.Mac/AppDelegate.cs b/MediaBrowser.Server.Mac/AppDelegate.cs
index 93fbcde692..26e6d9614f 100644
--- a/MediaBrowser.Server.Mac/AppDelegate.cs
+++ b/MediaBrowser.Server.Mac/AppDelegate.cs
@@ -10,6 +10,7 @@ namespace MediaBrowser.Server.Mac
{
public AppDelegate ()
{
+
}
public override void FinishedLaunching (NSObject notification)
diff --git a/MediaBrowser.Server.Mac/MainMenu.xib b/MediaBrowser.Server.Mac/MainMenu.xib
index 97efd017a2..86810928d2 100755
--- a/MediaBrowser.Server.Mac/MainMenu.xib
+++ b/MediaBrowser.Server.Mac/MainMenu.xib
@@ -44,27 +44,19 @@
@@ -87,14 +79,6 @@
540
-
@@ -141,17 +125,11 @@
536
-
MediaBrowser.Server.Mac
-
- 537
-
-
-
538
@@ -167,7 +145,6 @@
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
diff --git a/MediaBrowser.Server.Mono/Native/NativeApp.cs b/MediaBrowser.Server.Mono/Native/NativeApp.cs
index 14132b5149..541b2bd7dd 100644
--- a/MediaBrowser.Server.Mono/Native/NativeApp.cs
+++ b/MediaBrowser.Server.Mono/Native/NativeApp.cs
@@ -29,7 +29,7 @@ namespace MediaBrowser.Server.Mono.Native
///
public void Restart()
{
- MainClass.Restart();
+
}
///
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs
index 96e2310607..8a34488c62 100644
--- a/MediaBrowser.Server.Mono/Program.cs
+++ b/MediaBrowser.Server.Mono/Program.cs
@@ -43,12 +43,6 @@ namespace MediaBrowser.Server.Mono
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
- if (PerformUpdateIfNeeded(appPaths, logger))
- {
- logger.Info("Exiting to perform application update.");
- return;
- }
-
try
{
RunApplication(appPaths, logManager, options);
@@ -71,8 +65,6 @@ namespace MediaBrowser.Server.Mono
return new ServerApplicationPaths(programDataPath, applicationPath);
}
- private static readonly RemoteCertificateValidationCallback IgnoreCertificates = new RemoteCertificateValidationCallback(delegate { return true; });
-
private static readonly TaskCompletionSource ApplicationTaskCompletionSource = new TaskCompletionSource();
private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options)
@@ -80,7 +72,7 @@ namespace MediaBrowser.Server.Mono
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
// Allow all https requests
- ServicePointManager.ServerCertificateValidationCallback = IgnoreCertificates;
+ ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
var fileSystem = new CommonFileSystem(logManager.GetLogger("FileSystem"), false, true);
@@ -156,30 +148,10 @@ namespace MediaBrowser.Server.Mono
File.WriteAllText(path, builder.ToString());
}
- ///
- /// Performs the update if needed.
- ///
- /// The app paths.
- /// The logger.
- /// true if XXXX, false otherwise
- private static bool PerformUpdateIfNeeded(ServerApplicationPaths appPaths, ILogger logger)
- {
- return false;
- }
-
public static void Shutdown()
{
ApplicationTaskCompletionSource.SetResult (true);
}
-
- public static void Restart()
- {
- // Second instance will start first, so dispose so that the http ports will be available to the new instance
- _appHost.Dispose();
-
- // Right now this method will just shutdown, but not restart
- Shutdown ();
- }
}
class NoCheckCertificatePolicy : ICertificatePolicy