Using saveFileIfNeeded instead of saveFile.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@12952 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Philippe C.D. Robert 2002-03-02 13:15:59 +00:00
parent 050cf77b3d
commit 50112a3cb8
3 changed files with 13 additions and 2 deletions

View file

@ -44,6 +44,7 @@
- (void)show;
- (void)close;
- (BOOL)saveFileIfNeeded;
- (BOOL)saveFile;
- (BOOL)revertFile;

View file

@ -243,6 +243,16 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
}
}
- (BOOL)saveFileIfNeeded
{
if( isEdited )
{
return [self saveFile];
}
return YES;
}
- (BOOL)saveFile
{
[self setIsEdited:NO];

View file

@ -176,7 +176,7 @@
{
editor = [editorDict objectForKey:key];
if( [editor saveFile] == NO )
if( [editor saveFileIfNeeded] == NO )
{
ret = NO;
}
@ -200,7 +200,7 @@
if( [window isKeyWindow] && [window isMainWindow] ||
[project isEditorActive] && [[project projectWindow] isKeyWindow])
{
return [editor saveFile];
return [editor saveFileIfNeeded];
}
}