From 926cb09f0598e804bbb46d7e7150506f314cad1b Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Mon, 29 Mar 2004 15:05:06 +0000 Subject: [PATCH] bugfixes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/branches/UNSTABLE_0_4@18954 72102866-910b-0410-8b05-ffd578937521 --- Library/GNUmakefile | 1 + Library/PCBuildPanel.m | 2 +- Library/PCHistoryPanel.m | 2 +- Library/PCLaunchPanel.m | 2 +- Library/PCMakefileFactory.h | 13 - Library/PCMakefileFactory.m | 89 ----- Library/PCProject.h | 2 + Library/PCProject.m | 28 ++ Library/PCProjectBrowser.h | 3 +- Library/PCProjectBrowser.m | 63 ++- Library/PCProjectHistory.m | 10 + Library/PCProjectInspector.m | 7 +- Library/PCProjectManager.h | 2 +- Library/PCProjectManager.m | 36 +- Library/PCProjectWindow.m | 2 +- Modules/ApplicationProject/GNUmakefile | 2 - .../PCAppProject+Inspector.m | 24 -- Modules/ApplicationProject/PCAppProject.m | 4 + Modules/BundleProject/PCBundleProj.m | 18 +- Modules/BundleProject/PCBundleProject.m | 50 +-- Modules/BundleProject/Resources/PC.project | 1 - Modules/LibraryProject/GNUmakefile | 12 +- Modules/LibraryProject/PCLibProj.h | 4 - Modules/LibraryProject/PCLibProj.m | 145 +++---- Modules/LibraryProject/PCLibProject.h | 41 +- Modules/LibraryProject/PCLibProject.m | 360 +++++++++++++----- 26 files changed, 520 insertions(+), 403 deletions(-) diff --git a/Library/GNUmakefile b/Library/GNUmakefile index d6c6fff..20e5154 100644 --- a/Library/GNUmakefile +++ b/Library/GNUmakefile @@ -119,6 +119,7 @@ ProjectCenter_RESOURCE_FILES = \ Resources/class.template \ Resources/gsmarkup.template \ Resources/header.template \ + Resources/postamble.template \ Resources/protocol.template -include GNUmakefile.preamble diff --git a/Library/PCBuildPanel.m b/Library/PCBuildPanel.m index 986029c..bfc33c6 100644 --- a/Library/PCBuildPanel.m +++ b/Library/PCBuildPanel.m @@ -60,7 +60,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(activeProjectDidChange:) - name:ActiveProjectDidChangeNotification + name:PCActiveProjectDidChangeNotification object:nil]; if (![self setFrameUsingName: @"ProjectBuilder"]) diff --git a/Library/PCHistoryPanel.m b/Library/PCHistoryPanel.m index 974d638..e943b94 100644 --- a/Library/PCHistoryPanel.m +++ b/Library/PCHistoryPanel.m @@ -62,7 +62,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(activeProjectDidChange:) - name:ActiveProjectDidChangeNotification + name:PCActiveProjectDidChangeNotification object:nil]; if (![self setFrameUsingName: @"LoadedFiles"]) diff --git a/Library/PCLaunchPanel.m b/Library/PCLaunchPanel.m index a0a0814..69a088a 100644 --- a/Library/PCLaunchPanel.m +++ b/Library/PCLaunchPanel.m @@ -62,7 +62,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(activeProjectDidChange:) - name:ActiveProjectDidChangeNotification + name:PCActiveProjectDidChangeNotification object:nil]; if (![self setFrameUsingName: @"ProjectLauncher"]) diff --git a/Library/PCMakefileFactory.h b/Library/PCMakefileFactory.h index 64041b1..dfcdc20 100644 --- a/Library/PCMakefileFactory.h +++ b/Library/PCMakefileFactory.h @@ -36,27 +36,14 @@ - (void)appendOtherSources:(NSArray *)array forTarget: (NSString *)target; - (void)appendResources; - (void)appendResourceItems:(NSArray *)array; - - (void)appendSubprojects:(NSArray*)array; - (NSData *)encodedMakefile; -- (void)appendTailForLibrary; - (void)appendTailForTool; @end -@interface PCMakefileFactory (LibraryProject) - -- (void)appendLibrary; -- (void)appendLibraryInstallDir:(NSString*)dir; -- (void)appendLibraryLibraries:(NSArray*)array; -- (void)appendLibraryHeaders:(NSArray*)array; -- (void)appendLibraryClasses:(NSArray *)array; -- (void)appendLibraryOtherSources:(NSArray *)array; - -@end - @interface PCMakefileFactory (ToolProject) - (void)appendTool; diff --git a/Library/PCMakefileFactory.m b/Library/PCMakefileFactory.m index dc8feaf..34a4c3c 100644 --- a/Library/PCMakefileFactory.m +++ b/Library/PCMakefileFactory.m @@ -4,8 +4,6 @@ * Project ProjectCenter * * Created with ProjectCenter - http://www.gnustep.org - * - * $Id$ */ #include "PCDefines.h" @@ -281,22 +279,6 @@ static PCMakefileFactory *_factory = nil; } // Should be removed -- (void)appendTailForLibrary -{ - NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme]; - NSString *hinst; - - [self appendString:@"\n\n"]; - - hinst = [NSString stringWithFormat:@"HEADERS_INSTALL = $(%@_HEADER_FILES)\n\n",libnme]; - [self appendString:hinst]; - - [self appendString:@"-include GNUmakefile.preamble\n"]; - [self appendString:@"-include GNUmakefile.local\n"]; - [self appendString:@"include $(GNUSTEP_MAKEFILES)/library.make\n"]; - [self appendString:@"-include GNUmakefile.postamble\n"]; -} - - (void)appendTailForTool { [self appendString:@"\n\n"]; @@ -310,77 +292,6 @@ static PCMakefileFactory *_factory = nil; @end -@implementation PCMakefileFactory (LibraryProject) - -- (void)appendLibrary -{ - NSString *libnme; - - [self appendString:COMMENT_LIBRARY]; - - [self appendString:[NSString stringWithFormat:@"PACKAGE_NAME=%@\n",pnme]]; - [self appendString:[NSString stringWithFormat:@"LIBRARY_VAR=%@\n",[pnme uppercaseString]]]; - - libnme = [NSString stringWithFormat:@"lib%@",pnme]; - [self appendString:[NSString stringWithFormat:@"LIBRARY_NAME=%@\n",libnme]]; - - [self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_DIR=.\n",libnme]]; - [self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_INSTALL_DIR=/%@\n",libnme,pnme]]; - - [self appendString:@"ADDITIONAL_INCLUDE_DIRS = -I..\n"]; - [self appendString:@"srcdir = .\n"]; -} - -- (void)appendLibraryInstallDir:(NSString*)dir -{ - [self appendString:[NSString stringWithFormat:@"%@_INSTALLATION_DIR=$(GNUSTEP_INSTALLATION_DIR)\n",[pnme uppercaseString]]]; - [self appendString:[NSString stringWithFormat:@"%@_INSTALL_PREFIX=$(GNUSTEP_INSTALLATION_DIR)\n",[pnme uppercaseString]]]; -} - -- (void)appendLibraryLibraries:(NSArray*)array -{ - NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme]; - - [self appendString:COMMENT_LIBRARIES]; - - [self appendString: - [NSString stringWithFormat:@"%@_LIBRARIES_DEPEND_UPON += ",libnme]]; - - if( array && [array count] ) - { - NSString *tmp; - NSEnumerator *enumerator = [array objectEnumerator]; - - while ((tmp = [enumerator nextObject])) - { - if (![tmp isEqualToString:@"gnustep-base"]) - { - [self appendString:[NSString stringWithFormat:@"-l%@ ",tmp]]; - } - } - } -} - -- (void)appendLibraryHeaders:(NSArray*)array -{ - NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme]; - [self appendHeaders: array forTarget: libnme]; -} - -- (void)appendLibraryClasses:(NSArray *)array -{ - NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme]; - [self appendClasses: array forTarget: libnme]; -} - -- (void)appendLibraryOtherSources:(NSArray *)array -{ - NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme]; - [self appendOtherSources: array forTarget: libnme]; -} - -@end - @implementation PCMakefileFactory (ToolProject) - (void)appendTool diff --git a/Library/PCProject.h b/Library/PCProject.h index 2374e33..c7cf031 100644 --- a/Library/PCProject.h +++ b/Library/PCProject.h @@ -115,6 +115,8 @@ extern NSString *PCProjectDictDidSaveNotification; // ==== To be overriden! // =========================================================================== +- (BOOL)isEditableCategory:(NSString *)category; + // TEMP! For compatibility with old PC*Project subclasses - (void)updateValuesFromProjectDict; diff --git a/Library/PCProject.m b/Library/PCProject.m index f2e9f1d..7993d4f 100644 --- a/Library/PCProject.m +++ b/Library/PCProject.m @@ -311,6 +311,14 @@ NSString - (void)setProjectDictObject:(id)object forKey:(NSString *)key { + id currentObject = [projectDict objectForKey:key]; + + if ([object isKindOfClass:[NSString class]] + && [currentObject isEqualToString:object]) + { + return; + } + [projectDict setObject:object forKey:key]; [[NSNotificationCenter defaultCenter] @@ -349,6 +357,25 @@ NSString // ==== To be overriden // ============================================================================ +- (BOOL)isEditableCategory:(NSString *)category +{ + NSString *key = [self keyForCategory:category]; + + if ([key isEqualToString:PCClasses] + || [key isEqualToString:PCHeaders] + || [key isEqualToString:PCSupportingFiles] + || [key isEqualToString:PCDocuFiles] + || [key isEqualToString:PCOtherSources] + || [key isEqualToString:PCOtherResources] + || [key isEqualToString:PCNonProject] + || [key isEqualToString:PCGSMarkupFiles]) + { + return YES; + } + + return NO; +} + // TEMP! For compatibility with old PC*Project subclasses - (void)updateValuesFromProjectDict { @@ -585,6 +612,7 @@ NSString [self addFiles:[NSArray arrayWithObjects:toFile,nil] forKey:selectedCategoryKey]; + NSLog(@"PCproject: move %@ to %@", fromPath, toPath); [fm movePath:fromPath toPath:toPath handler:nil]; [projectBrowser setPathForFile:toFile category:selectedCategory]; diff --git a/Library/PCProjectBrowser.h b/Library/PCProjectBrowser.h index 0f19d6c..7a6184c 100644 --- a/Library/PCProjectBrowser.h +++ b/Library/PCProjectBrowser.h @@ -45,11 +45,10 @@ extern NSString *PCBrowserDidSetPathNotification; - (void)dealloc; // ============================================================================ -// ==== Accessor methods +// ==== Accessory methods // ============================================================================ - (NSView *)view; -- (BOOL)isEditableCategory:(NSString *)category file: (NSString *)title; - (NSString *)nameOfSelectedFile; - (NSString *)pathOfSelectedFile; - (NSArray *)selectedFiles; diff --git a/Library/PCProjectBrowser.m b/Library/PCProjectBrowser.m index 19f5896..80c5b02 100644 --- a/Library/PCProjectBrowser.m +++ b/Library/PCProjectBrowser.m @@ -78,7 +78,7 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; } // ============================================================================ -// ==== Accessor methods +// ==== Accessory methods // ============================================================================ - (NSView *)view @@ -86,31 +86,6 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; return browser; } -// This is responsibility of PC*Project classes -- (BOOL)isEditableCategory:(NSString *)category file:(NSString *)title -{ - NSString *key = [project keyForCategory:category]; - - if ([key isEqualToString:PCClasses] - || [key isEqualToString:PCHeaders] - || [key isEqualToString:PCSupportingFiles] - || [key isEqualToString:PCDocuFiles] - || [key isEqualToString:PCOtherSources] - || [key isEqualToString:PCOtherResources] - || [key isEqualToString:PCNonProject]) - { - return YES; - } - - if ([key isEqualToString:PCGSMarkupFiles] - && [[title pathExtension] isEqual: @"gorm"] == NO) - { - return YES; - } - - return NO; -} - - (NSString *)nameOfSelectedFile { NSString *name = nil; @@ -183,13 +158,18 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; - (void)click:(id)sender { + if (sender != browser) + { + return; + } + if ([[sender selectedCell] isLeaf] && [[self selectedFiles] count] == 1) { NSString *category = [[sender selectedCellInColumn:0] stringValue]; NSString *fn = [[sender selectedCell] stringValue]; NSString *fp = [[project projectPath] stringByAppendingPathComponent:fn]; - if ([self isEditableCategory:category file:fn]) + if ([project isEditableCategory:category]) { [[project projectEditor] editorForFile:fp category:category @@ -204,13 +184,18 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; - (void)doubleClick:(id)sender { + if (sender != browser) + { + return; + } + if ([[sender selectedCell] isLeaf]) { NSString *category = [[sender selectedCellInColumn:0] stringValue]; NSString *fn = [[sender selectedCell] stringValue]; NSString *fp = [[project projectPath] stringByAppendingPathComponent:fn]; - if ([self isEditableCategory:category file: fn]) + if ([project isEditableCategory:category]) { [[project projectEditor] editorForFile:fp category:category @@ -235,21 +220,17 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; - (void)projectDictDidChange:(NSNotification *)aNotif { - if (browser) + if (browser && ([aNotif object] == project)) { NSString *browserPath = [browser path]; - NSString *path = nil; NSString *slctdCategory = [project selectedRootCategory]; if (slctdCategory && browserPath && ![browserPath isEqualToString:@"/"]) { - path = [[browserPath componentsSeparatedByString:@"/"] - objectAtIndex:1]; - if ([[[project projectEditor] allEditors] count] == 0 - && [self isEditableCategory:slctdCategory file:nil]) + && [project isEditableCategory:slctdCategory]) { - [self setPathForFile:nil category:path]; + [self setPathForFile:nil category:slctdCategory]; } } @@ -263,16 +244,20 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; - (void)browser:(NSBrowser *)sender createRowsForColumn:(int)column inMatrix:(NSMatrix *)matrix { - NSString *pathToCol = [sender pathToColumn:column]; - NSArray *files = [project contentAtCategoryPath:pathToCol]; - int i; - int count = [files count]; + NSString *pathToCol = nil; + NSArray *files = nil; + int i = 0; + int count = 0; if (sender != browser) { return; } + pathToCol = [sender pathToColumn:column]; + files = [project contentAtCategoryPath:pathToCol]; + count = [files count]; + for (i = 0; i < count; ++i) { NSMutableString *categoryPath = nil; diff --git a/Library/PCProjectHistory.m b/Library/PCProjectHistory.m index 09b596c..162ca5d 100644 --- a/Library/PCProjectHistory.m +++ b/Library/PCProjectHistory.m @@ -192,6 +192,11 @@ - (int)numberOfRowsInTableView: (NSTableView *)aTableView { + if (aTableView != filesList) + { + return 0; + } + return [editedFiles count]; } @@ -199,6 +204,11 @@ objectValueForTableColumn: (NSTableColumn *)aTableColumn row: (int)rowIndex { + if (aTableView != filesList) + { + return nil; + } + return [editedFiles objectAtIndex: rowIndex]; } diff --git a/Library/PCProjectInspector.m b/Library/PCProjectInspector.m index 8f035da..94e6013 100644 --- a/Library/PCProjectInspector.m +++ b/Library/PCProjectInspector.m @@ -69,7 +69,7 @@ - (void)mouseDown:(NSEvent *)theEvent { [self setEditableField:YES]; -// [super mouseDown:theEvent]; + [super mouseDown:theEvent]; } - (BOOL)textShouldSetEditable @@ -109,7 +109,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(activeProjectDidChange:) - name:ActiveProjectDidChangeNotification + name:PCActiveProjectDidChangeNotification object:nil]; [self inspectorPopupDidChange:inspectorPopup]; @@ -226,7 +226,8 @@ NSString *newEntry = [sender stringValue]; // Build Atributes - if (sender == installPathField) + if (sender == installPathField + && ![[[project projectDict] objectForKey:PCInstallDir] isEqualToString:newEntry]) { [project setProjectDictObject:newEntry forKey:PCInstallDir]; } diff --git a/Library/PCProjectManager.h b/Library/PCProjectManager.h index 2939017..552ea82 100644 --- a/Library/PCProjectManager.h +++ b/Library/PCProjectManager.h @@ -47,7 +47,7 @@ #include #endif -extern NSString *ActiveProjectDidChangeNotification; +extern NSString *PCActiveProjectDidChangeNotification; @interface PCProjectManager : NSObject { diff --git a/Library/PCProjectManager.m b/Library/PCProjectManager.m index a989cc2..676bca4 100644 --- a/Library/PCProjectManager.m +++ b/Library/PCProjectManager.m @@ -48,7 +48,7 @@ #define SavePeriodDCN @"SavePeriodDidChangeNotification" -NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange"; +NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; @implementation PCProjectManager @@ -308,7 +308,7 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange"; [activeProject projectName]); [[NSNotificationCenter defaultCenter] - postNotificationName:ActiveProjectDidChangeNotification + postNotificationName:PCActiveProjectDidChangeNotification object:activeProject]; } } @@ -355,22 +355,42 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange"; - (PCProject *)loadProjectAt:(NSString *)aPath { - NSDictionary *projectFile = nil; - NSString *projectTypeName = nil; - NSString *projectClassName = nil; - id projectCreator; - PCProject *project = nil; + NSMutableDictionary *projectFile = nil; + NSString *projectTypeName = nil; + NSString *projectClassName = nil; + id projectCreator; + PCProject *project = nil; - projectFile = [NSDictionary dictionaryWithContentsOfFile:aPath]; + projectFile = [NSMutableDictionary dictionaryWithContentsOfFile:aPath]; + // For compatibility with 0.3.x projects projectClassName = [projectFile objectForKey:PCProjectBuilderClass]; + if (projectClassName == nil) { projectTypeName = [projectFile objectForKey:PCProjectType]; projectClassName = [[delegate projectTypes]objectForKey:projectTypeName]; } + projectCreator = [NSClassFromString(projectClassName) sharedCreator]; + if (projectTypeName == nil) + { + NSString *pPath = nil; + + pPath = [[aPath stringByDeletingLastPathComponent] + stringByAppendingPathComponent:@"PC.project"]; + + [[NSFileManager defaultManager] removeFileAtPath:aPath handler:nil]; + + [projectFile removeObjectForKey:PCProjectBuilderClass]; + projectTypeName = [projectCreator projectTypeName]; + [projectFile setObject:projectTypeName forKey:PCProjectType]; + [projectFile writeToFile:pPath atomically:YES]; + + aPath = pPath; + } + if ((project = [projectCreator openProjectAt:aPath])) { NSLog (@"Project loaded as %@", [projectCreator projectTypeName]); diff --git a/Library/PCProjectWindow.m b/Library/PCProjectWindow.m index 0882a83..ee62d56 100644 --- a/Library/PCProjectWindow.m +++ b/Library/PCProjectWindow.m @@ -255,7 +255,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(activeProjectDidChange:) - name:ActiveProjectDidChangeNotification + name:PCActiveProjectDidChangeNotification object:project]; } diff --git a/Modules/ApplicationProject/GNUmakefile b/Modules/ApplicationProject/GNUmakefile index 0f51442..7261c95 100644 --- a/Modules/ApplicationProject/GNUmakefile +++ b/Modules/ApplicationProject/GNUmakefile @@ -27,8 +27,6 @@ Resources/AppController.h \ Resources/AppController.m \ Resources/main.m \ Resources/PC.project \ -Resources/GNUmakefile.preamble \ -Resources/GNUmakefile.postamble \ Resources/Main.gorm \ Resources/Inspector.gorm diff --git a/Modules/ApplicationProject/PCAppProject+Inspector.m b/Modules/ApplicationProject/PCAppProject+Inspector.m index 5a900da..5caeac5 100644 --- a/Modules/ApplicationProject/PCAppProject+Inspector.m +++ b/Modules/ApplicationProject/PCAppProject+Inspector.m @@ -51,30 +51,6 @@ NSString *PCITextFieldGetFocus = @"PCITextFieldGetFocusNotification"; - (void)createProjectAttributes { -/* if (projectAttributesView) - { - return; - }*/ - - // Icons, Main NIB file, Help file -/* _iconsBox = [[NSBox alloc] init]; - [_iconsBox setFrame:NSMakeRect(6,6,290,259)]; - [_iconsBox setContentViewMargins:NSMakeSize(4.0, 4.0)]; - [_iconsBox setTitlePosition:NSNoTitle]; - [projectAttributesView addSubview:_iconsBox];*/ - - // Icon view -/* _iconViewBox = [[NSBox alloc] initWithFrame:NSMakeRect(220,189,56,56)]; - [_iconViewBox setTitlePosition:NSNoTitle]; - [_iconViewBox setBorderType:NSBezelBorder]; - [_iconViewBox setContentViewMargins:NSMakeSize(2.0, 2.0)]; - [_iconsBox addSubview:_iconViewBox]; - RELEASE(_iconViewBox); - - iconView = [[NSImageView alloc] initWithFrame:NSMakeRect(220,0,56,56)]; - [_iconViewBox addSubview:iconView]; - RELEASE(iconView);*/ - // TFs Buttons [setFieldButton setRefusesFirstResponder:YES]; [clearFieldButton setRefusesFirstResponder:YES]; diff --git a/Modules/ApplicationProject/PCAppProject.m b/Modules/ApplicationProject/PCAppProject.m index 5b46cfa..c96c142 100644 --- a/Modules/ApplicationProject/PCAppProject.m +++ b/Modules/ApplicationProject/PCAppProject.m @@ -316,6 +316,10 @@ success = YES; } } + else if ([super renameFile:ff toFile:tf] == YES) + { + success = YES; + } [projectBrowser setPathForFile:toFile category:[self categoryForKey:key]]; diff --git a/Modules/BundleProject/PCBundleProj.m b/Modules/BundleProject/PCBundleProj.m index af91bce..1ad3529 100644 --- a/Modules/BundleProject/PCBundleProj.m +++ b/Modules/BundleProject/PCBundleProj.m @@ -26,7 +26,6 @@ $Id$ */ -#include #include #include "PCBundleProj.h" @@ -70,10 +69,10 @@ static PCBundleProj *_creator = nil; if ([fm createDirectoryAtPath:path attributes:nil]) { NSBundle *projectBundle; + NSMutableDictionary *projectDict; NSString *_file; NSString *_2file; // NSString *_resourcePath; - NSMutableDictionary *projectDict; PCFileCreator *pcfc = [PCFileCreator sharedCreator]; project = [[[PCBundleProject alloc] init] autorelease]; @@ -90,14 +89,6 @@ static PCBundleProj *_creator = nil; [projectDict setObject:[path lastPathComponent] forKey:PCPrincipalClass]; // Copy the project files to the provided path - _file = [projectBundle pathForResource:@"GNUmakefile" - ofType:@"postamble"]; - _2file = [path stringByAppendingPathComponent:@"GNUmakefile.postamble"]; - [fm copyPath:_file toPath:_2file handler:nil]; - - _file = [projectBundle pathForResource:@"GNUmakefile" ofType:@"preamble"]; - _2file = [path stringByAppendingPathComponent:@"GNUmakefile.preamble"]; - [fm copyPath:_file toPath:_2file handler:nil]; // $PROJECTNAME$.m _file = [NSString stringWithFormat:@"%@", [path lastPathComponent]]; @@ -140,15 +131,18 @@ static PCBundleProj *_creator = nil; writeToFile:[path stringByAppendingPathComponent:@"PC.project"] atomically:YES]; } + return project; } - (PCProject *)openProjectAt:(NSString *)path { NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; + NSString *pPath = [path stringByDeletingLastPathComponent]; - return [[[PCBundleProject alloc] initWithProjectDictionary:dict - path:[path stringByDeletingLastPathComponent]] autorelease]; + return [[[PCBundleProject alloc] + initWithProjectDictionary:dict + path:pPath] autorelease]; } @end diff --git a/Modules/BundleProject/PCBundleProject.m b/Modules/BundleProject/PCBundleProject.m index aa8e70f..0f51e78 100644 --- a/Modules/BundleProject/PCBundleProject.m +++ b/Modules/BundleProject/PCBundleProject.m @@ -40,31 +40,33 @@ { if ((self = [super init])) { - rootKeys = [[NSArray arrayWithObjects: PCClasses, - PCHeaders, - PCOtherSources, - PCInterfaces, - PCImages, - PCOtherResources, - PCSubprojects, - PCDocuFiles, - PCSupportingFiles, - PCLibraries, - PCNonProject, - nil] retain]; + rootKeys = [[NSArray arrayWithObjects: + PCClasses, + PCHeaders, + PCOtherSources, + PCInterfaces, + PCImages, + PCOtherResources, + PCSubprojects, + PCDocuFiles, + PCSupportingFiles, + PCLibraries, + PCNonProject, + nil] retain]; - rootCategories = [[NSArray arrayWithObjects: @"Classes", - @"Headers", - @"Other Sources", - @"Interfaces", - @"Images", - @"Other Resources", - @"Subprojects", - @"Documentation", - @"Supporting Files", - @"Libraries", - @"Non Project Files", - nil] retain]; + rootCategories = [[NSArray arrayWithObjects: + @"Classes", + @"Headers", + @"Other Sources", + @"Interfaces", + @"Images", + @"Other Resources", + @"Subprojects", + @"Documentation", + @"Supporting Files", + @"Libraries", + @"Non Project Files", + nil] retain]; rootEntries = [[NSDictionary dictionaryWithObjects:rootCategories forKeys:rootKeys] retain]; diff --git a/Modules/BundleProject/Resources/PC.project b/Modules/BundleProject/Resources/PC.project index 35c6535..523308c 100644 --- a/Modules/BundleProject/Resources/PC.project +++ b/Modules/BundleProject/Resources/PC.project @@ -17,7 +17,6 @@ LANGUAGE = "English"; LAST_EDITING = ""; LIBRARIES = ("gnustep-base","gnustep-gui"); - MAININTERFACE = ""; MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; INSTALLDIR = "$(HOME)/GNUstep/Library/Bundles"; OBJC_COMPILEROPTIONS = ""; diff --git a/Modules/LibraryProject/GNUmakefile b/Modules/LibraryProject/GNUmakefile index b8f9367..30ffbf7 100644 --- a/Modules/LibraryProject/GNUmakefile +++ b/Modules/LibraryProject/GNUmakefile @@ -11,12 +11,6 @@ include $(GNUSTEP_MAKEFILES)/common.make -# -# Subprojects -# - - - # # Bundle # @@ -37,8 +31,9 @@ LibraryProject_LIBRARIES_DEPEND_UPON += -lProjectCenter # LibraryProject_RESOURCE_FILES= \ -PC.proj \ -Version +Resources/PC.project \ +Resources/Version \ +Resources/Inspector.gorm # # Header files @@ -64,3 +59,4 @@ LibraryProject_C_FILES= include ../GNUmakefile.bundles include $(GNUSTEP_MAKEFILES)/bundle.make + diff --git a/Modules/LibraryProject/PCLibProj.h b/Modules/LibraryProject/PCLibProj.h index c8afdb2..35771f5 100644 --- a/Modules/LibraryProject/PCLibProj.h +++ b/Modules/LibraryProject/PCLibProj.h @@ -20,8 +20,6 @@ You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. - - $Id$ */ #ifndef _PCLIBPROJ_H @@ -41,9 +39,7 @@ + (id)sharedCreator; - (Class)projectClass; - - (NSString *)projectTypeName; -- (NSDictionary *)typeTable; - (PCProject *)createProjectAt:(NSString *)path; - (PCProject *)openProjectAt:(NSString *)path; diff --git a/Modules/LibraryProject/PCLibProj.m b/Modules/LibraryProject/PCLibProj.m index edcf139..b392fdc 100644 --- a/Modules/LibraryProject/PCLibProj.m +++ b/Modules/LibraryProject/PCLibProj.m @@ -20,8 +20,6 @@ You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. - - $Id$ */ /* @@ -31,12 +29,13 @@ */ +#include + #include "PCLibProj.h" #include "PCLibProject.h" @implementation PCLibProj -static NSString *_projTypeName = @"Library"; static PCLibProj *_creator = nil; //---------------------------------------------------------------------------- @@ -45,97 +44,113 @@ static PCLibProj *_creator = nil; + (id)sharedCreator { - if (!_creator) { - _creator = [[[self class] alloc] init]; + if (!_creator) + { + _creator = [[[self class] alloc] init]; } - return _creator; + + return _creator; } - (Class)projectClass { - return [PCLibProject class]; + return [PCLibProject class]; } - (NSString *)projectTypeName { - return _projTypeName; -} - -- (NSDictionary *)typeTable -{ - NSString *_path = [[NSBundle bundleForClass:[self class]] pathForResource:@"Info" ofType:@"table"]; - - return [NSDictionary dictionaryWithContentsOfFile:_path]; + return @"Library"; } - (PCProject *)createProjectAt:(NSString *)path { - PCLibProject *project = nil; - NSFileManager *fm = [NSFileManager defaultManager]; + PCLibProject *project = nil; + NSFileManager *fm = [NSFileManager defaultManager]; - NSAssert(path,@"No valid project path provided!"); + NSAssert(path,@"No valid project path provided!"); - if ([fm createDirectoryAtPath:path attributes:nil]) { - NSString *_file; - //NSString *_resourcePath; - NSMutableDictionary *dict; - NSString *projectFile; + if ([fm createDirectoryAtPath:path attributes:nil]) + { + NSBundle *projectBundle = nil; + NSMutableDictionary *projectDict; + NSString *_file = nil; + NSString *_2file = nil; +// NSString *_resourcePath; + PCFileCreator *pcfc = [PCFileCreator sharedCreator]; - project = [[[PCLibProject alloc] init] autorelease]; + project = [[[PCLibProject alloc] init] autorelease]; + projectBundle = [NSBundle bundleForClass:[self class]]; - _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"PC" ofType:@"proj"]; - dict = [NSMutableDictionary dictionaryWithContentsOfFile:_file]; - - // Customise the project - [dict setObject:[path lastPathComponent] forKey:PCProjectName]; - [dict setObject:[self projectTypeName] forKey:PCProjectType]; + _file = [projectBundle pathForResource:@"PC" ofType:@"project"]; + projectDict = [NSMutableDictionary dictionaryWithContentsOfFile:_file]; - // Save the project to disc - projectFile = [NSString stringWithString:[path lastPathComponent]]; - projectFile = [projectFile stringByAppendingPathExtension:@"pcproj"]; - [dict writeToFile:[path stringByAppendingPathComponent:projectFile] - atomically:YES]; + // Customise the project + [project setProjectName:[path lastPathComponent]]; + [projectDict setObject:[path lastPathComponent] forKey:PCProjectName]; + [projectDict setObject:[self projectTypeName] forKey:PCProjectType]; - // Copy the project files to the provided path - _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"postamble"]; - [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.postamble"] handler:nil]; - - _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"preamble"]; - [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.preamble"] handler:nil]; + // Copy the project files to the provided path - _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"main" ofType:@"m"]; - [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"main.m"] handler:nil]; + // $PROJECTNAME$.m + _file = [NSString stringWithFormat:@"%@", [path lastPathComponent]]; + _2file = [NSString stringWithFormat:@"%@.m", [path lastPathComponent]]; + [pcfc createFileOfType:ObjCClass + path:[path stringByAppendingPathComponent:_file] + project:project]; + [projectDict setObject:[NSArray arrayWithObjects:_2file,nil] + forKey:PCClasses]; - // Resources - /* - _resourcePath = [path stringByAppendingPathComponent:@"English.lproj"]; - [fm createDirectoryAtPath:_resourcePath attributes:nil]; - */ + // $PROJECTNAME$.h already created by creating $PROJECTNAME$.m + _file = [NSString stringWithFormat:@"%@.h", [path lastPathComponent]]; + [projectDict setObject:[NSArray arrayWithObjects:_file,nil] + forKey:PCHeaders]; - [fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Documentation"] attributes:nil]; - _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"Version" ofType:@""]; - [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"Version"] handler:nil]; + // Resources + /* + _resourcePath = [path stringByAppendingPathComponent:@"English.lproj"]; + [fm createDirectoryAtPath:_resourcePath attributes:nil]; + */ + _file = [path stringByAppendingPathComponent:@"Images"]; + [fm createDirectoryAtPath:_file attributes:nil]; + _file = [path stringByAppendingPathComponent:@"Documentation"]; + [fm createDirectoryAtPath:_file attributes:nil]; - // The path cannot be in the PC.project file! - [project setProjectPath:path]; + _file = [projectBundle pathForResource:@"Version" ofType:@""]; + _2file = [path stringByAppendingPathComponent:@"Version"]; + [fm copyPath:_file toPath:_2file handler:nil]; + + // The path cannot be in the PC.project file! + [project setProjectPath:path]; + + // Set the new dictionary - this causes the GNUmakefile + // to be written to disc + if (![project assignProjectDict:projectDict]) + { + NSRunAlertPanel(@"Attention!", + @"Could not load %@!", + @"OK",nil,nil,path); + return nil; + } + + // Save the project to disc + [projectDict + writeToFile:[path stringByAppendingPathComponent:@"PC.project"] + atomically:YES]; - // Set the new dictionary - this causes the GNUmakefile to be written to disc - if(![project assignProjectDict:dict]) { - NSRunAlertPanel(@"Attention!",@"Could not load %@!",@"OK",nil,nil,path); - return nil; - } } - return project; + + return project; } - (PCProject *)openProjectAt:(NSString *)path { - NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; - - if ([[dict objectForKey:PCProjectBuilderClass] isEqualToString:@"PCLibProj"]) { - return [[[PCLibProject alloc] initWithProjectDictionary:dict path:[path stringByDeletingLastPathComponent]] autorelease]; - } - return nil; + NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; + NSString *pPath = [path stringByDeletingLastPathComponent]; + + return [[[PCLibProject alloc] initWithProjectDictionary:dict + path:pPath] autorelease]; + + return nil; } @end diff --git a/Modules/LibraryProject/PCLibProject.h b/Modules/LibraryProject/PCLibProject.h index 7c8f721..400964d 100644 --- a/Modules/LibraryProject/PCLibProject.h +++ b/Modules/LibraryProject/PCLibProject.h @@ -20,16 +20,14 @@ You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. - - $Id$ */ /* - Description: - - This is the project type 'Application' for GNUstep. You never should create it yourself but - use PCLibProj for doing this. Otherwise needed files don't get copied to the right place. + Description: + This is the project type 'Library' for GNUstep. You never should create it + yourself but use PCLibProj for doing this. Otherwise needed files don't get + copied to the right place. */ #ifndef _PCLIBPROJECT_H @@ -38,8 +36,14 @@ #include #include +@class PCMakefileFactory; + @interface PCLibProject : PCProject { + IBOutlet NSBox *projectAttributesView; + IBOutlet NSTextField *projectTypeField; + IBOutlet NSTextField *projectNameField; + IBOutlet NSTextField *projectLanguageField; } //---------------------------------------------------------------------------- @@ -49,22 +53,23 @@ - (id)init; - (void)dealloc; -//---------------------------------------------------------------------------- -// Project -//---------------------------------------------------------------------------- +@end -- (Class)builderClass; +@interface PCLibProject (GeneratedFiles) - (BOOL)writeMakefile; - -- (NSArray *)sourceFileKeys; -- (NSArray *)resourceFileKeys; -- (NSArray *)otherKeys; -- (NSArray *)buildTargets; -- (NSString *)projectDescription; - -- (void)updateValuesFromProjectDict; +- (void)appendHead:(PCMakefileFactory *)mff; +- (void)appendLibraries:(PCMakefileFactory*)mff; +- (void)appendTail:(PCMakefileFactory *)mff; @end +@interface PCLibProject (Inspector) + +- (NSView *)projectAttributesView; +- (void)updateInspectorValues:(NSNotification *)aNotif; + +@end + + #endif diff --git a/Modules/LibraryProject/PCLibProject.m b/Modules/LibraryProject/PCLibProject.m index 9efcb2d..fe496fe 100644 --- a/Modules/LibraryProject/PCLibProject.m +++ b/Modules/LibraryProject/PCLibProject.m @@ -51,33 +51,36 @@ - (id)init { - if ((self = [super init])) { - rootKeys = [[NSArray arrayWithObjects: PCClasses, - PCHeaders, - PCOtherSources, - PCOtherResources, - PCSubprojects, - PCDocuFiles, - PCSupportingFiles, - PCLibraries, - PCNonProject, - nil] retain]; + if ((self = [super init])) + { + rootKeys = [[NSArray arrayWithObjects: + PCClasses, + PCHeaders, + PCOtherSources, + PCOtherResources, + PCSubprojects, + PCDocuFiles, + PCSupportingFiles, + PCLibraries, + PCNonProject, + nil] retain]; - rootCategories = [[NSArray arrayWithObjects: @"Classes", - @"Headers", - @"Other Sources", - @"Other Resources", - @"Subprojects", - @"Documentation", - @"Supporting Files", - @"Libraries", - @"Non Project Files", - nil] retain]; + rootCategories = [[NSArray arrayWithObjects: + @"Classes", + @"Headers", + @"Other Sources", + @"Other Resources", + @"Subprojects", + @"Documentation", + @"Supporting Files", + @"Libraries", + @"Non Project Files", + nil] retain]; rootEntries = [[NSDictionary dictionaryWithObjects:rootCategories forKeys:rootKeys] retain]; - - } + } + return self; } @@ -86,7 +89,7 @@ [rootCategories release]; [rootKeys release]; [rootEntries release]; - + [super dealloc]; } @@ -96,76 +99,261 @@ - (Class)builderClass { - return [PCLibProj class]; -} - -- (BOOL)writeMakefile -{ - NSData *mfd; - NSString *mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile"]; - PCMakefileFactory *mf = [PCMakefileFactory sharedFactory]; - NSDictionary *dict = [self projectDict]; - - // Save the project file - [super writeMakefile]; - - [mf createMakefileForProject:[self projectName]]; - [mf appendString:@"include $(GNUSTEP_MAKEFILES)/common.make\n"]; - [mf appendString:@"include Version\n"]; - [mf appendSubprojects:[dict objectForKey:PCSubprojects]]; - - [mf appendLibrary]; - [mf appendLibraryInstallDir:[dict objectForKey:PCInstallDir]]; - [mf appendLibraryLibraries:[dict objectForKey:PCLibraries]]; - - [mf appendLibraryHeaders:[dict objectForKey:PCHeaders]]; - [mf appendLibraryClasses:[dict objectForKey:PCClasses]]; - [mf appendLibraryOtherSources:[dict objectForKey:PCOtherSources]]; - - [mf appendTailForLibrary]; - - // Write the new file to disc! - if ((mfd = [mf encodedMakefile])) - { - if ([mfd writeToFile:mfl atomically:YES]) - { - return YES; - } - } - - return NO; -} - -- (NSArray *)sourceFileKeys -{ - return [NSArray arrayWithObjects:PCClasses,PCOtherSources,nil]; -} - -- (NSArray *)resourceFileKeys -{ - return [NSArray array]; -} - -- (NSArray *)otherKeys -{ - return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,nil]; -} - -- (NSArray *)buildTargets -{ - return nil; + return [PCLibProj class]; } - (NSString *)projectDescription { - return @"Project that handles GNUstep/ObjC based libraries."; + return @"GNUstep Objective-C library project"; } -- (void)updateValuesFromProjectDict +- (BOOL)isExecutable { - [super updateValuesFromProjectDict]; + return NO; +} - //[appClassField setStringValue:[projectDict objectForKey:PCAppClass]]; +- (NSString *)execToolName +{ + return nil; +} + +- (NSArray *)fileTypesForCategory:(NSString *)category +{ + if ([category isEqualToString:PCClasses]) + { + return [NSArray arrayWithObjects:@"m",nil]; + } + else if ([category isEqualToString:PCHeaders]) + { + return [NSArray arrayWithObjects:@"h",nil]; + } + else if ([category isEqualToString:PCOtherSources]) + { + return [NSArray arrayWithObjects:@"c",@"C",nil]; + } + else if ([category isEqualToString:PCInterfaces]) + { + return [NSArray arrayWithObjects:@"gmodel",@"gorm",nil]; + } + else if ([category isEqualToString:PCImages]) + { + return [NSImage imageFileTypes]; + } + else if ([category isEqualToString:PCSubprojects]) + { + return [NSArray arrayWithObjects:@"subproj",nil]; + } + else if ([category isEqualToString:PCLibraries]) + { + return [NSArray arrayWithObjects:@"so",@"a",@"lib",nil]; + } + + return nil; +} + +- (NSString *)dirForCategory:(NSString *)category +{ + if ([category isEqualToString:PCImages]) + { + return [projectPath stringByAppendingPathComponent:@"Images"]; + } + else if ([category isEqualToString:PCDocuFiles]) + { + return [projectPath stringByAppendingPathComponent:@"Documentation"]; + } + + return projectPath; +} + +- (NSArray *)buildTargets +{ + return [NSArray arrayWithObjects: + @"library", @"debug", @"profile", @"dist", nil]; +} + +- (NSArray *)sourceFileKeys +{ + return [NSArray arrayWithObjects:PCClasses,PCOtherSources,nil]; +} + +- (NSArray *)resourceFileKeys +{ + return [NSArray arrayWithObjects:PCInterfaces,PCOtherResources,PCImages,nil]; +} + +- (NSArray *)otherKeys +{ + return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,nil]; +} + +- (NSArray *)allowableSubprojectTypes +{ + return [NSArray arrayWithObjects: + @"Bundle", @"Tool", @"Palette", nil]; +} + +- (NSArray *)defaultLocalizableKeys +{ + return [NSArray arrayWithObjects:PCInterfaces, nil]; +} + +- (NSArray *)localizableKeys +{ + return [NSArray arrayWithObjects: + PCInterfaces, PCImages, PCOtherResources, PCDocuFiles, nil]; } @end + +@implementation PCLibProject (GeneratedFiles) + +- (BOOL)writeMakefile +{ + PCMakefileFactory *mf = [PCMakefileFactory sharedFactory]; + int i,j; + NSString *mfl = nil; + NSData *mfd = nil; + + // Save the GNUmakefile backup + [super writeMakefile]; + + // Save GNUmakefile.preamble + [mf createPreambleForProject:self]; + + // Create the new file + [mf createMakefileForProject:projectName]; + + // Head + [self appendHead:mf]; + + // Libraries + [self appendLibraries:mf]; + + // Subprojects + if ([[projectDict objectForKey:PCSubprojects] count] > 0) + { + [mf appendSubprojects:[projectDict objectForKey:PCSubprojects]]; + } + + // Resources + [mf appendResources]; + for (i = 0; i < [[self resourceFileKeys] count]; i++) + { + NSString *k = [[self resourceFileKeys] objectAtIndex:i]; + NSMutableArray *resources = [[projectDict objectForKey:k] mutableCopy]; + + if ([k isEqualToString:PCImages]) + { + for (j=0; j<[resources count]; j++) + { + [resources replaceObjectAtIndex:j + withObject:[NSString stringWithFormat:@"Images/%@", + [resources objectAtIndex:j]]]; + } + } + + [mf appendResourceItems:resources]; + [resources release]; + } + + [mf appendHeaders:[projectDict objectForKey:PCHeaders] + forTarget:[NSString stringWithFormat:@"lib%@",projectName]]; + [mf appendClasses:[projectDict objectForKey:PCClasses] + forTarget:[NSString stringWithFormat:@"lib%@",projectName]]; + [mf appendOtherSources:[projectDict objectForKey:PCOtherSources] + forTarget:[NSString stringWithFormat:@"lib%@",projectName]]; + + // Tail + [self appendTail:mf]; + + // Write the new file to disc! + mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile"]; + if ((mfd = [mf encodedMakefile])) + { + if ([mfd writeToFile:mfl atomically:YES]) + { + return YES; + } + } + + return NO; +} + +- (void)appendHead:(PCMakefileFactory *)mff +{ + [mff appendString:@"\n#\n# Bundle\n#\n"]; + [mff appendString:[NSString stringWithFormat:@"PACKAGE_NAME = %@\n", + projectName]]; + [mff appendString:[NSString stringWithFormat:@"LIBRARY_VAR = %@\n", + [projectName uppercaseString]]]; + [mff appendString:[NSString stringWithFormat:@"LIBRARY_NAME = lib%@\n", + projectName]]; + [mff appendString:[NSString stringWithFormat:@"lib%@_HEADER_FILES_DIR = %@\n", + projectName,@"."]]; + [mff appendString:[NSString stringWithFormat: + @"lib%@_HEADER_FILES_INSTALL_DIR = /%@\n", projectName, projectName]]; +} + +- (void)appendLibraries:(PCMakefileFactory *)mff +{ + NSArray *libs = [projectDict objectForKey:PCLibraries]; + + [mff appendString:@"\n#\n# Libraries\n#\n"]; + + [mff appendString: + [NSString stringWithFormat:@"%@_LIBRARIES_DEPEND_UPON += ",projectName]]; + + if (libs && [libs count]) + { + NSString *tmp; + NSEnumerator *enumerator = [libs objectEnumerator]; + + while ((tmp = [enumerator nextObject])) + { + if (![tmp isEqualToString:@"gnustep-base"] && + ![tmp isEqualToString:@"gnustep-gui"]) + { + [mff appendString:[NSString stringWithFormat:@"-l%@ ",tmp]]; + } + } + } +} + +- (void)appendTail:(PCMakefileFactory *)mff +{ + [mff appendString:@"\n\n#\n# Makefiles\n#\n"]; + [mff appendString:@"-include GNUmakefile.preamble\n"]; + [mff appendString:@"include $(GNUSTEP_MAKEFILES)/aggregate.make\n"]; + [mff appendString:@"include $(GNUSTEP_MAKEFILES)/library.make\n"]; + [mff appendString:@"-include GNUmakefile.postamble\n"]; +} + +@end + +@implementation PCLibProject (Inspector) + +- (NSView *)projectAttributesView +{ + if (projectAttributesView == nil) + { + if ([NSBundle loadNibNamed:@"Inspector" owner:self] == NO) + { + NSLog(@"PCLibraryProject: error loading Inspector NIB!"); + return nil; + } + [projectAttributesView retain]; + [self updateInspectorValues:nil]; + } + + return projectAttributesView; +} + +- (void)updateInspectorValues:(NSNotification *)aNotif +{ + [projectTypeField setStringValue:@"Library"]; + [projectNameField setStringValue:projectName]; + [projectLanguageField setStringValue:[projectDict objectForKey:@"LANGUAGE"]]; +} + +@end +