diff --git a/ChangeLog b/ChangeLog index f5a54354..7ab0c170 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-11-22 Gregory John Casamento + + * GormDocument.m: -[GormDocument createClassFiles:] fixed problem + which was getting the classname from the currently selected row in + the classesView. It now calls -[GormOutlineView itemBeingEdited] to + get the class being edited. + 2002-11-22 Gregory John Casamento * GormDocument.[hm]: added -[GormDocument removeConnectionsWithLabel: diff --git a/GormDocument.m b/GormDocument.m index 91e22839..cf8b6a13 100644 --- a/GormDocument.m +++ b/GormDocument.m @@ -4,7 +4,9 @@ * * Author: Richard Frith-Macdonald * Date: 1999 - * + * Author: Gregory John Casamento + * Date: 2002 + * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify @@ -925,20 +927,12 @@ static NSImage *classesImage = nil; - (id) createClassFiles: (id)sender { NSSavePanel *sp; - NSString *className; - int row = [classesView selectedRow]; + NSString *className = [classesView itemBeingEdited]; int result; - - // if no selection, just return. - if(row == -1) - { - return self; - } - + sp = [NSSavePanel savePanel]; [sp setRequiredFileType: @"m"]; [sp setTitle: @"Save source file as..."]; - className = [classesView itemAtRow: row]; if (documentPath == nil) result = [sp runModalForDirectory: NSHomeDirectory() file: [className stringByAppendingPathExtension: @"m"]]; @@ -963,20 +957,17 @@ static NSImage *classesImage = nil; if (result == NSOKButton) { headerName = [sp filename]; - if (row >= 0) + NSLog(@"Saving %@",className); + if (![classManager makeSourceAndHeaderFilesForClass: className + withName: sourceName + and: headerName]) { - NSLog([classesView itemAtRow: row]); - if (![classManager makeSourceAndHeaderFilesForClass: className - withName: sourceName - and: headerName]) - { - NSRunAlertPanel(@"Alert", - @"Could not create the class's file", - nil, nil, nil); - } - - return self; + NSRunAlertPanel(@"Alert", + @"Could not create the class's file", + nil, nil, nil); } + + return self; } } return nil;