From e81cbc3a669f81db017a493a036efc6831d91f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 25 Jan 2017 13:08:16 +0100 Subject: [PATCH] [macos] enable printing --- platform/macos/app/AppDelegate.m | 11 +++++++++++ platform/macos/app/Base.lproj/MainMenu.xib | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/macos/app/AppDelegate.m b/platform/macos/app/AppDelegate.m index d3fe2d204..44f87092c 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 9faf1ba04..b6d2a5030 100644 --- a/platform/macos/app/Base.lproj/MainMenu.xib +++ b/platform/macos/app/Base.lproj/MainMenu.xib @@ -135,7 +135,7 @@ - +