Navigation Menu

Skip to content

Commit

Permalink
Auto-apply file extension on export
Browse files Browse the repository at this point in the history
  • Loading branch information
p2 committed Feb 4, 2014
1 parent 3638c9d commit a884ef5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions AppController.m
Expand Up @@ -98,6 +98,7 @@ - (IBAction)exportDocument:(id)sender
// configure the panel // configure the panel
NSSavePanel *exportPanel = [NSSavePanel savePanel]; NSSavePanel *exportPanel = [NSSavePanel savePanel];
[exportPanel setDelegate:self]; [exportPanel setDelegate:self];
[exportPanel setExtensionHidden:YES];
[exportPanel setAccessoryView:exportAccessoryView]; [exportPanel setAccessoryView:exportAccessoryView];


[self updateExportFormatSelector]; [self updateExportFormatSelector];
Expand All @@ -116,6 +117,7 @@ - (IBAction)exportDocument:(id)sender
frontDoc.exportHeaders = (NSOnState == [exportHeadersCheckbox state]); frontDoc.exportHeaders = (NSOnState == [exportHeadersCheckbox state]);


// WRITE! // WRITE!
[exportPanel setAllowedFileTypes:@[frontDoc.exportFormat.type]];
[frontDoc writeToURL:[exportPanel URL] ofType:frontDoc.exportFormat.type error:&error]; [frontDoc writeToURL:[exportPanel URL] ofType:frontDoc.exportFormat.type error:&error];
} }


Expand Down

0 comments on commit a884ef5

Please sign in to comment.