recent document menu support

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@35385 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2012-08-09 16:23:39 +00:00
parent f3ac6d9d8a
commit 8152e6b4ee
4 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2012-08-09 Riccardo Mottola <rm@gnu.org>
* English.lproj/ProjectCenter.gorm
* Framework/PCProjectManager.m
Recent Document menu support.
2012-07-30 Wolfgang Lux <wolfgang.lux@gmail.com>
* Framework/PCProjectBuilder.m (-line:startsWithString:,

View file

@ -553,6 +553,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
NSString *projectFileType = nil;
PCProject *project = nil;
NSDictionary *wap = nil;
NSString *projectPathToSave;
// Check project path for invalid characters
if ([aPath rangeOfString: @" "].location != NSNotFound ||
@ -591,7 +592,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
BOOL isDir = NO;
BOOL exists = NO;
NSArray *tempList;
exists = [[NSFileManager defaultManager] fileExistsAtPath:aPath
isDirectory:&isDir];
if (!exists)
@ -599,6 +600,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
return nil;
}
projectPathToSave = projectPath;
if (isDir)
{
if ([projectFileType isEqualToString:@"pcproj"] == NO)
@ -611,6 +613,10 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
aPath = [tempList objectAtIndex:0];
}
}
else
{
projectPathToSave = aPath;
}
aPath = [aPath stringByAppendingPathComponent:@"PC.project"];
projectFile = [NSMutableDictionary dictionaryWithContentsOfFile:aPath];
}
@ -697,7 +703,10 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
[[project projectWindow] makeKeyAndOrderFront:self];
[self setActiveProject: project];
}
PCLogStatus(self, @"Saved opened Document as %@", projectPathToSave);
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: [NSURL fileURLWithPath:projectPathToSave]];
}
return project;
}