From 281c5f579f7ff8de41cfd3e34505254eeec52d70 Mon Sep 17 00:00:00 2001 From: meeh Date: Wed, 19 Sep 2018 00:37:16 +0000 Subject: [PATCH] Bugfixes, improvements, more error handling and stability to the osx launcher. --- launchers/macosx/AppDelegate.h | 5 +- .../I2PLauncher/I2PLauncher-Bridging-Header.h | 3 + launchers/macosx/I2PLauncher/Info.plist | 4 +- .../macosx/I2PLauncher/Storyboard.storyboard | 15 +- .../I2PLauncher/SwiftMainDelegate.swift | 21 +- .../I2PLauncher/routermgmt/DetectJava.swift | 45 ++-- .../routermgmt/RouterProcessStatus.swift | 26 ++- .../I2PLauncher/routermgmt/RouterRunner.swift | 2 +- .../userinterface/PopoverViewController.swift | 7 +- .../userinterface/StatusBarController.swift | 2 +- launchers/macosx/JavaHelper.h | 18 +- launchers/macosx/include/fn.h | 4 +- launchers/macosx/main.mm | 203 ++++++++++++------ 13 files changed, 225 insertions(+), 130 deletions(-) diff --git a/launchers/macosx/AppDelegate.h b/launchers/macosx/AppDelegate.h index 431ed3b2a..cfb89bd66 100644 --- a/launchers/macosx/AppDelegate.h +++ b/launchers/macosx/AppDelegate.h @@ -39,7 +39,7 @@ #include "JavaHelper.h" inline void sendUserNotification(NSString* title, NSString* informativeText, NSImage* contentImage = NULL, bool makeSound = false) { - NSUserNotification *userNotification = [[[NSUserNotification alloc] init] autorelease]; + NSUserNotification *userNotification = [[NSUserNotification alloc] init]; userNotification.title = title; userNotification.informativeText = informativeText; @@ -83,19 +83,20 @@ void setGlobalRouterIsRunning(bool running); } @property BOOL enableLogging; @property BOOL enableVerboseLogging; +@property (assign) SwiftMainDelegate *swiftRuntime; @property (assign) NSUserDefaults *userPreferences; @property (assign) ExtractMetaInfo *metaInfo; @property (copy) NSImage *contentImage NS_AVAILABLE(10_9, NA); - (void) extractI2PBaseDir:(void(^)(BOOL success, NSError *error))completion; - (void) awakeFromNib; -- (void) startupI2PRouter; - (void) applicationDidFinishLaunching:(NSNotification *)aNotification; - (void) applicationWillTerminate:(NSNotification *)aNotification; - (void) setApplicationDefaultPreferences; - (void) userChooseJavaHome; - (AppDelegate *) initWithArgc:(int)argc argv:(const char **)argv; #ifdef __cplusplus +- (void) startupI2PRouter; - (NSString *) userSelectJavaHome:(JvmListPtr)rawJvmList; #endif - (BOOL) userNotificationCenter:(NSUserNotificationCenter *)center diff --git a/launchers/macosx/I2PLauncher/I2PLauncher-Bridging-Header.h b/launchers/macosx/I2PLauncher/I2PLauncher-Bridging-Header.h index a83635db3..9b963b18c 100644 --- a/launchers/macosx/I2PLauncher/I2PLauncher-Bridging-Header.h +++ b/launchers/macosx/I2PLauncher/I2PLauncher-Bridging-Header.h @@ -3,3 +3,6 @@ // #import "SBridge.h" #import "AppleStuffExceptionHandler.h" +#import "AppDelegate.h" +#import "RouterTask.h" + diff --git a/launchers/macosx/I2PLauncher/Info.plist b/launchers/macosx/I2PLauncher/Info.plist index 6ba8490e6..82121b3ab 100644 --- a/launchers/macosx/I2PLauncher/Info.plist +++ b/launchers/macosx/I2PLauncher/Info.plist @@ -34,7 +34,9 @@ CFBundleVersion - 1 + 3 + LSApplicationCategoryType + public.app-category.utilities LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) LSUIElement diff --git a/launchers/macosx/I2PLauncher/Storyboard.storyboard b/launchers/macosx/I2PLauncher/Storyboard.storyboard index 11e2e37bd..3399d4683 100644 --- a/launchers/macosx/I2PLauncher/Storyboard.storyboard +++ b/launchers/macosx/I2PLauncher/Storyboard.storyboard @@ -1,9 +1,8 @@ - + - - + @@ -120,20 +119,20 @@ - + - + - + + - + -