summaryrefslogtreecommitdiff
path: root/platform/macos/app/AppDelegate.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/app/AppDelegate.m')
-rw-r--r--platform/macos/app/AppDelegate.m28
1 files changed, 14 insertions, 14 deletions
diff --git a/platform/macos/app/AppDelegate.m b/platform/macos/app/AppDelegate.m
index 44f87092c9..5b848cc79b 100644
--- a/platform/macos/app/AppDelegate.m
+++ b/platform/macos/app/AppDelegate.m
@@ -20,10 +20,10 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
switch (self.state) {
case MGLOfflinePackStateComplete:
return [NSImage imageNamed:@"NSMenuOnStateTemplate"];
-
+
case MGLOfflinePackStateActive:
return [NSImage imageNamed:@"NSFollowLinkFreestandingTemplate"];
-
+
default:
return nil;
}
@@ -104,7 +104,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
-
+
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"NSQuitAlwaysKeepsWindows"]) {
NSData *cameraData = [[NSUserDefaults standardUserDefaults] objectForKey:MGLLastMapCameraDefaultsKey];
if (cameraData) {
@@ -130,7 +130,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
[alert runModal];
[self showPreferences:nil];
}
-
+
[self.offlinePacksArrayController bind:@"content" toObject:[MGLOfflineStorage sharedOfflineStorage] withKeyPath:@"packs" options:nil];
}
@@ -148,7 +148,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
[[NSUserDefaults standardUserDefaults] setInteger:mapView.debugMask forKey:MGLLastMapDebugMaskDefaultsKey];
}
}
-
+
[self.offlinePacksArrayController unbind:@"content"];
}
@@ -164,16 +164,16 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
params[parts[0]] = [parts[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}
}
-
+
MGLMapCamera *camera = [MGLMapCamera camera];
NSString *zoomLevelString = params[@"zoom"];
self.pendingZoomLevel = zoomLevelString.length ? zoomLevelString.doubleValue : -1;
-
+
NSString *directionString = params[@"bearing"];
if (directionString.length) {
camera.heading = directionString.doubleValue;
}
-
+
NSString *centerString = params[@"center"];
if (centerString) {
NSArray *coordinateValues = [centerString componentsSeparatedByString:@","];
@@ -182,12 +182,12 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
[coordinateValues[1] doubleValue]);
}
}
-
+
NSString *pitchString = params[@"pitch"];
if (pitchString.length) {
camera.pitch = pitchString.doubleValue;
}
-
+
self.pendingCamera = camera;
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:NULL];
}
@@ -196,7 +196,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
- (IBAction)showOfflinePacksPanel:(id)sender {
[self.offlinePacksPanel makeKeyAndOrderFront:sender];
-
+
for (MGLOfflinePack *pack in self.offlinePacksArrayController.arrangedObjects) {
[pack requestProgress];
}
@@ -226,15 +226,15 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
}
break;
}
-
+
case MGLOfflinePackStateInactive:
[pack resume];
break;
-
+
case MGLOfflinePackStateActive:
[pack suspend];
break;
-
+
default:
break;
}