aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldEditorController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-02-19 16:25:19 +0000
committerstuconnolly <stuart02@gmail.com>2012-02-19 16:25:19 +0000
commit2483cd22f74239d2a06c83f1c5d9a25eaab44a7c (patch)
tree2a8a527b3f418c257e65156efb582f818324c812 /Source/SPFieldEditorController.m
parentb7bd2ae9a683652920a6c772eadeca2bac1e7b91 (diff)
downloadsequelpro-2483cd22f74239d2a06c83f1c5d9a25eaab44a7c.tar.gz
sequelpro-2483cd22f74239d2a06c83f1c5d9a25eaab44a7c.tar.bz2
sequelpro-2483cd22f74239d2a06c83f1c5d9a25eaab44a7c.zip
Bring outline view branch up to date with trunk (r3471:r3481).
Diffstat (limited to 'Source/SPFieldEditorController.m')
-rw-r--r--Source/SPFieldEditorController.m27
1 files changed, 13 insertions, 14 deletions
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index 7c8a960c..2df24c24 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -548,7 +548,7 @@
NSString *fileDefault = @"";
if([editSheetSegmentControl selectedSegment] == 1 && [sheetEditData isKindOfClass:[MCPGeometryData class]]) {
- [panel setRequiredFileType:@"pdf"];
+ [panel setAllowedFileTypes:[NSArray arrayWithObject:@"pdf"]];
[panel setAllowsOtherFileTypes:NO];
} else {
[panel setAllowsOtherFileTypes:YES];
@@ -642,7 +642,6 @@
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSOKButton) {
- NSString *fileName = [panel filename];
NSString *contents = nil;
editSheetWillBeInitialized = YES;
@@ -655,7 +654,7 @@
}
// load new data/images
- sheetEditData = [[NSData alloc] initWithContentsOfFile:fileName];
+ sheetEditData = [[NSData alloc] initWithContentsOfURL:[panel URL]];
NSImage *image = [[NSImage alloc] initWithData:sheetEditData];
contents = [[NSString alloc] initWithData:sheetEditData encoding:encoding];
@@ -710,37 +709,37 @@
[editSheetProgressBar startAnimation:self];
- NSString *fileName = [panel filename];
+ NSURL *fileURL = [panel URL];
// Write binary field types directly to the file
if ( [sheetEditData isKindOfClass:[NSData class]] ) {
- [sheetEditData writeToFile:fileName atomically:YES];
+ [sheetEditData writeToURL:fileURL atomically:YES];
}
else if ( [sheetEditData isKindOfClass:[MCPGeometryData class]] ) {
if ( [editSheetSegmentControl selectedSegment] == 0 || editImage == nil ) {
- [[editTextView string] writeToFile:fileName
- atomically:YES
- encoding:encoding
- error:NULL];
+ [[editTextView string] writeToURL:fileURL
+ atomically:YES
+ encoding:encoding
+ error:NULL];
} else if (editImage != nil){
SPGeometryDataView *v = [[[SPGeometryDataView alloc] initWithCoordinates:[sheetEditData coordinates] targetDimension:2000.0f] autorelease];
NSData *pdf = [v pdfData];
if(pdf)
- [pdf writeToFile:fileName atomically:YES];
+ [pdf writeToURL:fileURL atomically:YES];
}
}
// Write other field types' representations to the file via the current encoding
else {
- [[sheetEditData description] writeToFile:fileName
- atomically:YES
- encoding:encoding
- error:NULL];
+ [[sheetEditData description] writeToURL:fileURL
+ atomically:YES
+ encoding:encoding
+ error:NULL];
}
[editSheetProgressBar stopAnimation:self];