Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Auto-apply file extension on export

  • Loading branch information...
commit a884ef504aef979ff53ffbae375aaff6f9d995bd 1 parent 3638c9d
@p2 authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  AppController.m
View
2  AppController.m
@@ -98,6 +98,7 @@ - (IBAction)exportDocument:(id)sender
// configure the panel
NSSavePanel *exportPanel = [NSSavePanel savePanel];
[exportPanel setDelegate:self];
+ [exportPanel setExtensionHidden:YES];
[exportPanel setAccessoryView:exportAccessoryView];
[self updateExportFormatSelector];
@@ -116,6 +117,7 @@ - (IBAction)exportDocument:(id)sender
frontDoc.exportHeaders = (NSOnState == [exportHeadersCheckbox state]);
// WRITE!
+ [exportPanel setAllowedFileTypes:@[frontDoc.exportFormat.type]];
[frontDoc writeToURL:[exportPanel URL] ofType:frontDoc.exportFormat.type error:&error];
}
Please sign in to comment.
Something went wrong with that request. Please try again.