Fixed a bug preventing reopening projects. Also added 2 methods which will

be used to make an editor embedded.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@12266 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Philippe C.D. Robert 2002-01-29 21:46:45 +00:00
parent e2a9d52ed5
commit d4bd4d3637
3 changed files with 37 additions and 3 deletions

View file

@ -22,6 +22,8 @@
NSMutableString *path;
id delegate;
BOOL isEmbedded;
}
- (id)initWithPath:(NSString*)file;
@ -30,6 +32,9 @@
- (void)setDelegate:(id)aDelegate;
- (id)delegate;
- (void)setEmbedded:(BOOL)yn;
- (BOOL)isEmbedded;
- (NSWindow *)editorWindow;
- (void)show;

View file

@ -76,6 +76,9 @@
{
NSString *text = [NSString stringWithContentsOfFile:file];
// Should take that from preferences!
isEmbedded = NO;
[self _initUI];
[window setTitle:file];
@ -110,9 +113,25 @@
return window;
}
- (void)setEmbedded:(BOOL)yn
{
isEmbedded = yn;
}
- (BOOL)isEmbedded
{
return isEmbedded;
}
- (void)show
{
[window makeKeyAndOrderFront:self];
if( isEmbedded == NO )
{
[window makeKeyAndOrderFront:self];
}
else
{
}
}
- (void)close

View file

@ -458,10 +458,20 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
- (void)closeProject:(PCProject *)aProject
{
PCProject *currentProject;
NSString *key = [[aProject projectPath] stringByAppendingPathComponent:@"PC.project"];
PCProject *currentProject = nil;
NSString *path = [aProject projectPath];
NSString *projectName = [path lastPathComponent];
NSString *key;
key = [path stringByAppendingPathComponent:projectName];
key = [key stringByAppendingPathExtension:@"pcproj"];
currentProject = [[loadedProjects objectForKey:key] retain];
if( !currentProject )
{
return;
}
// Remove it from the loaded projects!
[loadedProjects removeObjectForKey:key];