forked from I2P_Developers/i2p.i2p
Mac OS X Launcher: Misc changes in ObjC, forwarding sendUserNotification to Swift.
This commit is contained in:
@@ -63,8 +63,8 @@
|
||||
}
|
||||
|
||||
- (void) requestRestart
|
||||
{
|
||||
self.userRequestedRestart = YES;
|
||||
|
||||
{ self.userRequestedRestart = YES;
|
||||
kill([self.routerTask processIdentifier], SIGHUP);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,9 @@
|
||||
{
|
||||
NSLog(@"Expection occurred %@", [e reason]);
|
||||
self.isRouterRunning = NO;
|
||||
|
||||
[[[RouterProcessStatus alloc] init] triggerEventWithEn:@"router_exception" details:[e reason]];
|
||||
|
||||
[[SBridge sharedInstance] setCurrentRouterInstance:nil];
|
||||
sendUserNotification(@"An error occured, can't start the I2P Router", [e reason]);
|
||||
return 0;
|
||||
|
@@ -62,5 +62,6 @@ inline std::string buildClassPathForObjC(std::string basePath)
|
||||
- (void) startupI2PRouter:(NSString*)i2pRootPath;
|
||||
- (void) openUrl:(NSString*)url;
|
||||
+ (void) logProxy:(int)level formattedMsg:(NSString*)formattedMsg;
|
||||
+ (void) sendUserNotification:(NSString*)title formattedMsg:(NSString*)formattedMsg;
|
||||
+ (instancetype)sharedInstance; // this makes it a singleton
|
||||
@end
|
||||
|
@@ -119,6 +119,11 @@ std::future<int> startupRouter(NSString* javaBin, NSArray<NSString*>* arguments,
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
+ (void) sendUserNotification:(NSString*)title formattedMsg:(NSString*)formattedMsg
|
||||
{
|
||||
sendUserNotification(title, formattedMsg);
|
||||
}
|
||||
|
||||
- (void) openUrl:(NSString*)url
|
||||
{
|
||||
osx::openUrl(url);
|
||||
|
@@ -73,9 +73,10 @@ using namespace subprocess;
|
||||
[self.userPreferences registerDefaults:@{
|
||||
@"enableLogging": @YES,
|
||||
@"enableVerboseLogging": @YES,
|
||||
@"autoStartRouter": @YES,
|
||||
@"startRouterAtLogin": @NO,
|
||||
@"startRouterAtStartup": @NO,
|
||||
@"autoStartRouterAtBoot": @NO,
|
||||
@"startLauncherAtLogin": @NO,
|
||||
@"startRouterAtStartup": @YES,
|
||||
@"stopRouterAtShutdown": @YES,
|
||||
@"letRouterLiveEvenLauncherDied": @NO,
|
||||
@"consolePortCheckNum": @7657,
|
||||
@"i2pBaseDirectory": (NSString *)CFStringCreateWithCString(NULL, const_cast<const char *>(getDefaultBaseDir().c_str()), kCFStringEncodingUTF8)
|
||||
@@ -87,7 +88,7 @@ using namespace subprocess;
|
||||
CFPreferencesSetMultiple((CFDictionaryRef)dict, NULL, CFAPPDOMAIN, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost);
|
||||
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
|
||||
|
||||
if (self.enableVerboseLogging) NSLog(@"Default preferences stored!");
|
||||
NSLog(@"Default preferences stored!");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user