[macos] enable printing

This commit is contained in:
Konstantin Käfer
2017-01-25 13:08:16 +01:00
parent c68e327e86
commit e81cbc3a66
2 changed files with 12 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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>