mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-19 01:51:09 +00:00
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:
parent
e2a9d52ed5
commit
d4bd4d3637
3 changed files with 37 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue