mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-18 16:41:35 +00:00
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:
parent
050cf77b3d
commit
50112a3cb8
3 changed files with 13 additions and 2 deletions
|
@ -44,6 +44,7 @@
|
|||
- (void)show;
|
||||
- (void)close;
|
||||
|
||||
- (BOOL)saveFileIfNeeded;
|
||||
- (BOOL)saveFile;
|
||||
- (BOOL)revertFile;
|
||||
|
||||
|
|
|
@ -243,6 +243,16 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL)saveFileIfNeeded
|
||||
{
|
||||
if( isEdited )
|
||||
{
|
||||
return [self saveFile];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)saveFile
|
||||
{
|
||||
[self setIsEdited:NO];
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue