mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 03:10:47 +00:00
Added missing Cocoa methods and a Cocoa header file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19269 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c35f6f8821
commit
6b78af5ade
4 changed files with 249 additions and 11 deletions
|
@ -308,8 +308,6 @@
|
|||
|
||||
if (delegate != nil && shouldCloseSelector != NULL)
|
||||
{
|
||||
// FIXME: This is the only way I know to call a callback with
|
||||
// irregular arguments
|
||||
void (*meth)(id, SEL, id, BOOL, void*);
|
||||
meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector:
|
||||
shouldCloseSelector];
|
||||
|
@ -342,8 +340,6 @@
|
|||
|
||||
if (delegate != nil && callback != NULL)
|
||||
{
|
||||
// FIXME: This is the only way I know to call a callback with
|
||||
// irregular argumetns
|
||||
void (*meth)(id, SEL, id, BOOL, void*);
|
||||
meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector:
|
||||
callback];
|
||||
|
@ -515,7 +511,6 @@
|
|||
}
|
||||
|
||||
[savePanel setTitle: title];
|
||||
|
||||
|
||||
if ([self fileName])
|
||||
directory = [[self fileName] stringByDeletingLastPathComponent];
|
||||
|
@ -523,6 +518,11 @@
|
|||
directory = [controller currentDirectory];
|
||||
[savePanel setDirectory: directory];
|
||||
|
||||
if (![self prepareSavePanel: savePanel])
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
if ([self runModalSavePanel: savePanel withAccessoryView: accessory])
|
||||
{
|
||||
return [savePanel filename];
|
||||
|
@ -662,7 +662,9 @@
|
|||
[self setFileType: fileType];
|
||||
[self updateChangeCount: NSChangeCleared];
|
||||
}
|
||||
|
||||
|
||||
// FIXME: Should set the file attributes
|
||||
|
||||
if (backupFilename && ![self keepBackupFile])
|
||||
{
|
||||
[fileManager removeFileAtPath: backupFilename handler: nil];
|
||||
|
@ -716,7 +718,10 @@
|
|||
didSaveSelector: (SEL)didSaveSelector
|
||||
contextInfo: (void *)contextInfo
|
||||
{
|
||||
// FIXME
|
||||
[self runModalSavePanelForSaveOperation: NSSaveOperation
|
||||
delegate: delegate
|
||||
didSaveSelector: didSaveSelector
|
||||
contextInfo: contextInfo];
|
||||
}
|
||||
|
||||
- (void)saveToFile: (NSString *)fileName
|
||||
|
@ -725,7 +730,23 @@
|
|||
didSaveSelector: (SEL)didSaveSelector
|
||||
contextInfo: (void *)contextInfo
|
||||
{
|
||||
// FIXME
|
||||
BOOL saved = NO;
|
||||
|
||||
if (fileName != nil)
|
||||
{
|
||||
saved = [self writeWithBackupToFile: fileName
|
||||
ofType: [self fileTypeFromLastRunSavePanel]
|
||||
saveOperation: saveOperation];
|
||||
}
|
||||
|
||||
if (delegate != nil && didSaveSelector != NULL)
|
||||
{
|
||||
void (*meth)(id, SEL, id, BOOL, void*);
|
||||
meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector:
|
||||
didSaveSelector];
|
||||
if (meth)
|
||||
meth(delegate, didSaveSelector, self, saved, contextInfo);
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)prepareSavePanel: (NSSavePanel *)savePanel
|
||||
|
@ -738,7 +759,15 @@
|
|||
didSaveSelector: (SEL)didSaveSelector
|
||||
contextInfo: (void *)contextInfo
|
||||
{
|
||||
// FIXME
|
||||
NSString *fileName;
|
||||
|
||||
// FIXME: Setting of the delegate of the save panel is missing
|
||||
fileName = [self fileNameFromRunningSavePanelForSaveOperation: saveOperation];
|
||||
[self saveToFile: fileName
|
||||
saveOperation: saveOperation
|
||||
delegate: delegate
|
||||
didSaveSelector: didSaveSelector
|
||||
contextInfo: contextInfo];
|
||||
}
|
||||
|
||||
- (IBAction)revertDocumentToSaved: (id)sender
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue