summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-01-25 13:08:16 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-01-26 11:41:35 +0100
commite81cbc3a669f81db017a493a036efc6831d91f79 (patch)
treef00c15dfa70e318751282473f6c841589f3cb63b
parentc68e327e86e70cffb30f117cccb044e4a86e7473 (diff)
downloadqtlocation-mapboxgl-e81cbc3a669f81db017a493a036efc6831d91f79.tar.gz
[macos] enable printing
-rw-r--r--platform/macos/app/AppDelegate.m11
-rw-r--r--platform/macos/app/Base.lproj/MainMenu.xib2
2 files changed, 12 insertions, 1 deletions
diff --git a/platform/macos/app/AppDelegate.m b/platform/macos/app/AppDelegate.m
index d3fe2d204e..44f87092c9 100644
--- a/platform/macos/app/AppDelegate.m
+++ b/platform/macos/app/AppDelegate.m
@@ -261,6 +261,14 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
[self.preferencesWindow makeKeyAndOrderFront:sender];
}
+- (IBAction)print:(id)sender {
+ NSDocument *currentDocument = [NSDocumentController sharedDocumentController].currentDocument;
+ if ([currentDocument isKindOfClass:[MapDocument class]]) {
+ MGLMapView *mapView = [(MapDocument *)currentDocument mapView];
+ [mapView print:sender];
+ }
+}
+
- (IBAction)openAccessTokenManager:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://www.mapbox.com/studio/account/tokens/"]];
}
@@ -277,6 +285,9 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
if (menuItem.action == @selector(showOfflinePacksPanel:)) {
return YES;
}
+ if (menuItem.action == @selector(print:)) {
+ return YES;
+ }
if (menuItem.action == @selector(delete:)) {
return self.offlinePacksArrayController.selectedObjects.count;
}
diff --git a/platform/macos/app/Base.lproj/MainMenu.xib b/platform/macos/app/Base.lproj/MainMenu.xib
index 9faf1ba04b..b6d2a50309 100644
--- a/platform/macos/app/Base.lproj/MainMenu.xib
+++ b/platform/macos/app/Base.lproj/MainMenu.xib
@@ -135,7 +135,7 @@
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
<connections>
- <action selector="print:" target="-1" id="qaZ-4w-aoO"/>
+ <action selector="print:" target="Voe-Tx-rLC" id="rXg-Pd-AG8"/>
</connections>
</menuItem>
</items>