Adjustments to save panel.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-10-16 17:08:25 -07:00
1 parent 95274f618c
commit e6ea4c267a
2 files changed
+8 -17

No files matched your search

+1 -1
View File
@@ -791,7 +791,7 @@ var CPDocumentUntitledCount = 0;
if (!response)
return;
var saveURL = [savePanel filename];
var saveURL = [savePanel URL];
[[CPNotificationCenter defaultCenter]
postNotificationName:CPDocumentWillSaveNotification
+7 -16
View File
@@ -4,7 +4,7 @@
@implementation CPSavePanel : CPPanel
{
JSObject _savePanel;
Object result;
}
+ (id)savePanel
@@ -12,20 +12,9 @@
return [[CPSavePanel alloc] init];
}
- (id)init
{
if (self = [super init])
_savePanel = window.application.createSavePanel();
return self;
}
- (CPInteger)runModal
{
// FIXME: Is this correct???
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
return _savePanel.runModal();
return [self runModalForDirectory:nil];
}
- (CPInteger)runModalForDirectory:(CPString)anAbsoluteDirectoryPath
@@ -33,12 +22,14 @@
// FIXME: Is this correct???
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
return _savePanel.runModal(anAbsoluteDirectoryPath);
var result = window.cpSavePanel(anAbsoluteDirectoryPath);
return result.button;
}
- (CPString)filename
- (CPURL)URL
{
return _savePanel.filename;
return [CPURL URLWithString:result.URL];
}
@end