diff --git a/Documentation/ChangeLog b/Documentation/ChangeLog index 442da09..0d2f39a 100644 --- a/Documentation/ChangeLog +++ b/Documentation/ChangeLog @@ -1,3 +1,26 @@ +2007-08-22 Sergii Stoian + + * Framework/PCProjectBuilderOptions.m: Add missing file. + * Headers/ProjectCenter/PCProjectBuilderOptions.h: Add missing file. + * Framework/PCProject.m: + (-rootCategories): Call subproject's method if subproject is active. + (-rootEntries): Ditto. + (-keyForCategory:): Ditto. Fix bug #20854. + (-categoryForKey:): Ditto. + (-keyForRootCategoryInCategoryPath:): Since keyForCategory: was made + subproject's sensitive implement key searching here. + +2007-08-21 Sergii Stoian + + * Framework/PCProjectBuilderOptions.m: New file. + * Headers/ProjectCenter/PCProjectBuilderOptions.h: New file. + * ProjectBuilder options handling finished. + * Fixed compliance to GNUstep make v2. + * Framework/PCFileNameIcon.m: Start implementing drag/drop. + * Images/ProjectCenter.tiff: Use ProjectManager's app icon. + * Modules/Projects/*/Resources/Info.table: change default targets. + * Headers/ProjectCenter/PCDefines.h: Clean up. + 2007-07-19 Sergii Stoian * GNUmakefile.postamble: Cleanup old code. diff --git a/Documentation/TODO b/Documentation/TODO index 174650a..4ec4268 100644 --- a/Documentation/TODO +++ b/Documentation/TODO @@ -25,22 +25,21 @@ ProjectCenter 0.5 - Implement on demand loading of bundles [done!] - Localization support for projects [done!] - Finish save/restore size of split views in Project Window [done!] -- Save last used path separately for different file panels stoyan --- Project Editor: - Implement on demand loading (editor for file type) [done!] - Open some files read only (Supporting Files) [done!] - Implement code parser (get it from CodeEditor?) [done!] - Project Browser should show file structure. [done!] - Click on Browser item should move cursor to line in file [done!] - - Imlement pending adding/removal of files (history?) stoyan --- Project Builder: - Create panel and builder GORM files [done!] - Implement root build directory handling [done!] - - Finish options handling stoyan + - Finish options handling [done!] - Parse gcc output [95% done!] - Display warnings,errors,options etc. as clickable list [done!] -- GNUstep make version 2.0 compliance stoyan +- GNUstep make version 2.0 compliance [done!] - Finish FileNameIcon (draggable, files can be dragged to it) stoyan +- Save last used path separately for different file panels stoyan - Review all dialogs and situations when dialogs must be popped up stoyan @@ -53,9 +52,13 @@ ProjectCenter 0.6 - Add "Component" project type stoyan - Create new Info panel stoyan - More options for file creation stoyan ---- Project Editor - - Implement indentation stoyan - - Implement interaction with Builder (errors, warnings) stoyan +- Think about imlementing pending adding/removal of files stoyan +--- Project Editor --------------------------------------------- + - Implement indentation stoyan + - Implement interaction with Builder (errors, warnings) stoyan +--- Project Builder -------------------------------------------- + - Finish parsing gcc output (make errors, etc.) + - Implement interaction with Editor (errors, warnings) stoyan - New icons. Need volonteers!!! ??? ProjectCenter 0.7 diff --git a/Framework/PCProject.m b/Framework/PCProject.m index 7ab401a..2c28973 100644 --- a/Framework/PCProject.m +++ b/Framework/PCProject.m @@ -1203,10 +1203,10 @@ NSString NSEnumerator *enumerator = nil; NSString *filePath = nil; NSString *file = nil; - NSMutableArray *projectFiles = nil; + NSMutableArray *projectFiles = [[NSMutableArray alloc] initWithCapacity:1]; NSArray *localizedFiles = nil; - // Check if file localazable. If yes, make it not localizable so file moved + // Check if file localizable. If yes, make it not localizable so file moved // to Resources dir. localizedFiles = [[self localizedResources] copy]; enumerator = [files objectEnumerator]; @@ -1220,14 +1220,18 @@ NSString [localizedFiles release]; // Remove files from project - projectFiles = [NSMutableArray arrayWithArray:[projectDict objectForKey:key]]; +// projectFiles = [NSMutableArray arrayWithArray:[projectDict objectForKey:key]]; + [projectFiles setArray:[projectDict objectForKey:key]]; + NSLog(@"--- projectFiles: %@ forKey: %@", projectFiles, key); enumerator = [files objectEnumerator]; while ((file = [enumerator nextObject])) { if ([key isEqualToString:PCSubprojects]) { + NSLog(@"Removing subproject %@", file); [self removeSubprojectWithName:file]; } + NSLog(@"Project %@ remove file %@", projectName, file); [projectFiles removeObject:file]; // Close editor @@ -1235,8 +1239,12 @@ NSString [projectEditor closeEditorForFile:filePath]; } + NSLog(@"projectFiles: %@", projectFiles); + [self setProjectDictObject:projectFiles forKey:key notify:yn]; + [projectFiles release]; + return YES; } @@ -1528,20 +1536,35 @@ NSString @implementation PCProject (ProjectBrowser) +// e.g. CLASS_FILES - (NSArray *)rootKeys { - // e.g. CLASS_FILES + if (activeSubproject) + { + return [activeSubproject rootKeys]; + } + return rootKeys; } +// e.g. Classes - (NSArray *)rootCategories { - // e.g. Classes + if (activeSubproject) + { + return [activeSubproject rootCategories]; + } + return rootCategories; } - (NSDictionary *)rootEntries { + if (activeSubproject) + { + return [activeSubproject rootEntries]; + } + return rootEntries; } @@ -1551,6 +1574,11 @@ NSString { int index = -1; + if (activeSubproject) + { + return [activeSubproject keyForCategory:category]; + } + if (![rootCategories containsObject:category]) { return nil; @@ -1562,6 +1590,11 @@ NSString - (NSString *)categoryForKey:(NSString *)key { + if (activeSubproject) + { + return [activeSubproject categoryForKey:key]; + } + return [rootEntries objectForKey:key]; } @@ -1583,6 +1616,7 @@ NSString { NSString *category = nil; NSString *key = nil; + int index = -1; if (categoryPath == nil || [categoryPath isEqualToString:@""] @@ -1592,7 +1626,19 @@ NSString } category = [self rootCategoryForCategoryPath:categoryPath]; - key = [self keyForCategory:category]; + + // Since keyForCategory subproject sensitive implement + // key searching here + // TODO: revise all code in PCProject against subproject + // sensitiveness + // key = [self keyForCategory:category]; + if (![rootCategories containsObject:category]) + { + return nil; + } + + index = [rootCategories indexOfObject:category]; + key = [rootKeys objectAtIndex:index]; /* PCLogInfo(self, @"{%@}(keyForRootCategoryInCategoryPath): %@ key:%@", projectName, categoryPath, key);*/ diff --git a/Framework/PCProjectBuilderOptions.m b/Framework/PCProjectBuilderOptions.m new file mode 100644 index 0000000..8e9976e --- /dev/null +++ b/Framework/PCProjectBuilderOptions.m @@ -0,0 +1,174 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html + + Copyright (C) 2000-2007 Free Software Foundation + + Authors: Philippe C.D. Robert + Sergii Stoian + + This file is part of GNUstep. + + This application is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + 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. +*/ + +#import + +#import +#import +#import + +@implementation PCProjectBuilderOptions + +- (void)_setStateForButton:(id)button + key:(NSString *)key + defaultState:(int)dState +{ + NSString *value = [[project projectDict] objectForKey:key]; + int state; + + if (value == nil) + { + state = dState; + } + else + { + if ([value isEqualToString:@"YES"]) + state = NSOnState; + else + state = NSOffState; + } + [button setState:state]; +} + +- (id)initWithProject:(PCProject *)aProject delegate:(id)aDelegate +{ + if ((self = [super init])) + { + project = aProject; + delegate = aDelegate; + } + + return self; +} + +- (void)awakeFromNib +{ + NSArray *args; + + // Setup target popup + [targetPopup removeAllItems]; + [targetPopup addItemsWithTitles:[project buildTargets]]; + [targetPopup selectItemAtIndex:0]; + + // Setup build arguments field + args = [[project projectDict] objectForKey:PCBuilderArguments]; + [buildArgsField setStringValue:[args componentsJoinedByString:@" "]]; + [optionsPanel makeFirstResponder:buildArgsField]; + + // Setup option buttons + [verboseButton setRefusesFirstResponder:YES]; + [debugButton setRefusesFirstResponder:YES]; + [stripButton setRefusesFirstResponder:YES]; + [sharedLibsButton setRefusesFirstResponder:YES]; + + [self _setStateForButton:verboseButton + key:PCBuilderVerbose + defaultState:NSOffState]; + [self _setStateForButton:debugButton + key:PCBuilderDebug + defaultState:NSOnState]; + [self _setStateForButton:stripButton + key:PCBuilderStrip + defaultState:NSOffState]; + [self _setStateForButton:sharedLibsButton + key:PCBuilderSharedLibs + defaultState:NSOnState]; +} + +- (void)show:(NSRect)builderRect +{ + NSRect opRect; + + if (!optionsPanel) + { + if ([NSBundle loadNibNamed:@"BuilderOptions" owner:self] == NO) + { + PCLogError(self, @"error loading BuilderOptions NIB file!"); + return; + } + + } + + opRect = [optionsPanel frame]; + opRect.origin.x = builderRect.origin.x + + (builderRect.size.width - opRect.size.width)/2; + opRect.origin.y = builderRect.origin.y + + (builderRect.size.height - opRect.size.height)/2; + [optionsPanel setFrame:opRect display:NO]; + + [optionsPanel makeKeyAndOrderFront:nil]; +} + +- (NSString *)buildTarget +{ + if (targetPopup) + { + return [targetPopup titleOfSelectedItem]; + } + + return nil; +} + +- (void)optionsPopupChanged:(id)sender +{ + [delegate targetDidSet:[targetPopup titleOfSelectedItem]]; +} + +- (void)controlTextDidEndEditing:(NSNotification *)aNotif +{ + id object = [aNotif object]; + NSMutableArray *args; + + if (object != buildArgsField) + return; + + args = [[[buildArgsField stringValue] componentsSeparatedByString:@" "] + mutableCopy]; + [args removeObject:@""]; + [args removeObject:@" "]; + + [project setProjectDictObject:args forKey:PCBuilderArguments notify:YES]; + + [delegate targetDidSet:[targetPopup titleOfSelectedItem]]; +} + +- (void)optionsButtonClicked:(id)sender +{ + NSString *value = [sender state] == NSOnState ? @"YES" : @"NO"; + NSString *key; + + if (sender == verboseButton) + key = PCBuilderVerbose; + if (sender == debugButton) + key = PCBuilderDebug; + if (sender == stripButton) + key = PCBuilderStrip; + if (sender == sharedLibsButton) + key = PCBuilderSharedLibs; + + [project setProjectDictObject:value forKey:key notify:YES]; +} + +@end diff --git a/Headers/ProjectCenter/PCDefines.h b/Headers/ProjectCenter/PCDefines.h index 95d8f6d..6d73cab 100644 --- a/Headers/ProjectCenter/PCDefines.h +++ b/Headers/ProjectCenter/PCDefines.h @@ -115,20 +115,6 @@ if (__value != __object) \ #define IMAGE(X) [NSImage imageNamed:(X)] #endif -//============================================================================= -// ==== DEFINES -//============================================================================= - -#define BUILD_ARGS_KEY @"BuildArgsKey" -#define BUILD_HOST_KEY @"BuildHostKey" - -#define TARGET_MAKE @"Make" -#define TARGET_MAKE_DEBUG @"MakeDebug" -#define TARGET_MAKE_PROFILE @"MakeProfile" -#define TARGET_MAKE_INSTALL @"MakeInstall" -#define TARGET_MAKE_CLEAN @"MakeClean" -#define TARGET_MAKE_RPM @"MakeRPM" - //============================================================================= // ==== Not used yet //============================================================================= @@ -202,11 +188,10 @@ static NSString * const PCSearchLibs = @"SEARCH_LIB_DIRS"; // Project Builder options static NSString * const PCBuilderOptions = @"BUILDER_OPTIONS"; -static NSString * const PCBuilderTarget = @"BUILDER_TARGET"; static NSString * const PCBuilderArguments = @"BUILDER_ARGS"; static NSString * const PCBuilderDebug = @"BUILDER_DEBUG"; -static NSString * const PCBuilderProfile = @"BUILDER_PROFILE"; -static NSString * const PCBuilderVerboseMake = @"BUILDER_VERBOSE_MAKE"; +static NSString * const PCBuilderStrip = @"BUILDER_STRIP"; +static NSString * const PCBuilderVerbose = @"BUILDER_VERBOSE"; static NSString * const PCBuilderSharedLibs = @"BUILDER_SHARED_LIBS"; // Application specific diff --git a/Headers/ProjectCenter/PCFileNameIcon.h b/Headers/ProjectCenter/PCFileNameIcon.h index c7b59b0..39ed92b 100644 --- a/Headers/ProjectCenter/PCFileNameIcon.h +++ b/Headers/ProjectCenter/PCFileNameIcon.h @@ -31,15 +31,12 @@ { NSString *filePath; NSTextField *fileNameField; - NSString *msfText; id delegate; } - (void)setFileNameField:(NSTextField *)field; - - (void)setDelegate:(id)object; - - (void)updateIcon; @end @@ -48,6 +45,7 @@ - (NSImage *)fileNameIconImage; - (NSString *)fileNameIconTitle; +- (BOOL)canPerformDraggingOf:(NSArray *)paths; @end diff --git a/Headers/ProjectCenter/PCProjectBuilder.h b/Headers/ProjectCenter/PCProjectBuilder.h index 0198819..e40e9ac 100644 --- a/Headers/ProjectCenter/PCProjectBuilder.h +++ b/Headers/ProjectCenter/PCProjectBuilder.h @@ -30,6 +30,7 @@ @class PCProject; @class PCButton; +@class PCProjectBuilderOptions; typedef enum _ErrorLevel { ELFile, @@ -43,10 +44,11 @@ typedef enum _ErrorLevel { @interface PCProjectBuilder : NSObject { PCProject *project; - NSDictionary *currentOptions; + PCProjectBuilderOptions *buildOptions; NSString *makePath; - NSString *statusString; + NSString *buildStatus; + NSMutableString *buildStatusTarget; NSMutableString *buildTarget; NSMutableArray *buildArgs; SEL postProcess; @@ -65,11 +67,10 @@ typedef enum _ErrorLevel { NSBox *componentView; PCButton *buildButton; PCButton *cleanButton; - PCButton *installButton; PCButton *optionsButton; NSTextField *errorsCountField; NSSplitView *split; - NSTextField *buildStatusField; + NSTextField *statusField; NSTextField *targetField; // Error logging @@ -91,14 +92,6 @@ typedef enum _ErrorLevel { NSMutableString *currentBuildFile; NSMutableArray *currentBuildPath; - // Options panel - NSPanel *optionsPanel; - NSPopUpButton *targetPopup; - NSTextField *buildArgsField; - NSButton *debugButton; - NSButton *profileButton; - NSButton *sharedLibsButton; - NSButton *verboseButton; } - (id)initWithProject:(PCProject *)aProject; @@ -106,6 +99,7 @@ typedef enum _ErrorLevel { - (NSView *)componentView; - (BOOL)setMakePath; +- (void)updateTargetField; // --- Accessory - (BOOL)isBuilding; @@ -113,12 +107,13 @@ typedef enum _ErrorLevel { - (void)performStartBuild; - (void)performStartClean; - (void)performStopBuild; +- (NSArray *)buildArguments; // --- Actions - (void)startBuild:(id)sender; - (void)startClean:(id)sender; -- (void)startInstall:(id)sender; - (BOOL)stopMake:(id)sender; +- (void)showOptionsPanel:(id)sender; - (void)cleanupAfterMake; - (BOOL)prebuildCheck; @@ -150,8 +145,4 @@ typedef enum _ErrorLevel { @end -@interface PCProjectBuilder (Options) - -@end - #endif diff --git a/Headers/ProjectCenter/PCProjectBuilderOptions.h b/Headers/ProjectCenter/PCProjectBuilderOptions.h new file mode 100644 index 0000000..237611a --- /dev/null +++ b/Headers/ProjectCenter/PCProjectBuilderOptions.h @@ -0,0 +1,55 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html + + Copyright (C) 2000-2007 Free Software Foundation + + Authors: Philippe C.D. Robert + Sergii Stoian + + This file is part of GNUstep. + + This application is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + 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. +*/ + +#import + +@class PCProject; + +@interface PCProjectBuilderOptions : NSObject +{ + PCProject *project; + id delegate; // Usually PCProjectBuilder + + NSPanel *optionsPanel; + NSPopUpButton *targetPopup; + NSTextField *buildArgsField; + NSButton *verboseButton; // messages=yes + NSButton *debugButton; // debug=no + NSButton *stripButton; // strip=yes + NSButton *sharedLibsButton; // shared=no +} + +- (id)initWithProject:(PCProject *)aProject delegate:(id)aDelegate; +- (void)show:(NSRect)builderRect; +- (NSString *)buildTarget; + +@end + +@interface PCProjectBuilderOptions (Delegate) + +- (void)targetDidSet:(NSString *)aTarget; + +@end + diff --git a/Images/ProjectCenter.tiff b/Images/ProjectCenter.tiff index cdec5d7..9389617 100644 Binary files a/Images/ProjectCenter.tiff and b/Images/ProjectCenter.tiff differ diff --git a/Modules/Projects/Application/Resources/Info.table b/Modules/Projects/Application/Resources/Info.table index 339cd67..3207e11 100644 --- a/Modules/Projects/Application/Resources/Info.table +++ b/Modules/Projects/Application/Resources/Info.table @@ -5,7 +5,7 @@ PrincipalClassName = "PCAppProject"; Executable = YES; ExecToolName = "openapp"; - BuildTargets = ("app","debug","profile","dist"); + BuildTargets = ("all","install","uninstall","clean","distclean","dist"); CanHavePublicHeaders = NO; BrowserRootEntries = { CLASS_FILES = "Classes"; diff --git a/Modules/Projects/Bundle/Resources/Info.table b/Modules/Projects/Bundle/Resources/Info.table index 05a1e8b..8497b9c 100644 --- a/Modules/Projects/Bundle/Resources/Info.table +++ b/Modules/Projects/Bundle/Resources/Info.table @@ -4,7 +4,7 @@ Description = "Project that handles GNUstep bundles."; PrincipalClassName = "PCBundleProject"; ExecToolName = ""; - BuildTargets = ("bundle","debug","profile","dist"); + BuildTargets = ("all","install","uninstall","clean","distclean","dist"); CanHavePublicHeaders = NO; BrowserRootEntries = { CLASS_FILES = "Classes"; diff --git a/Modules/Projects/Framework/Resources/Info.table b/Modules/Projects/Framework/Resources/Info.table index 4b1f8b1..3a600e2 100644 --- a/Modules/Projects/Framework/Resources/Info.table +++ b/Modules/Projects/Framework/Resources/Info.table @@ -4,7 +4,7 @@ Description = "Project that handles GNUstep frameworks."; PrincipalClassName = "PCFrameworkProject"; ExecToolName = ""; - BuildTargets = ("framework","debug","profile","dist"); + BuildTargets = ("all","install","uninstall","clean","distclean","dist"); CanHavePublicHeaders = YES; BrowserRootEntries = { CLASS_FILES = "Classes"; diff --git a/Modules/Projects/Library/Resources/Info.table b/Modules/Projects/Library/Resources/Info.table index 65ff53f..bf58c0d 100644 --- a/Modules/Projects/Library/Resources/Info.table +++ b/Modules/Projects/Library/Resources/Info.table @@ -4,7 +4,7 @@ Description = "Project that handles GNUstep libraries."; PrincipalClassName = "PCLibProject"; ExecToolName = ""; - BuildTargets = ("library","debug","profile","dist"); + BuildTargets = ("all","install","uninstall","clean","distclean","dist"); CanHavePublicHeaders = YES; BrowserRootEntries = { CLASS_FILES = "Classes"; diff --git a/Modules/Projects/Tool/Resources/Info.table b/Modules/Projects/Tool/Resources/Info.table index 53653e4..29ee6d4 100644 --- a/Modules/Projects/Tool/Resources/Info.table +++ b/Modules/Projects/Tool/Resources/Info.table @@ -5,7 +5,7 @@ PrincipalClassName = "PCToolProject"; ExecToolName = "opentool"; Executable = YES; - BuildTargets = ("tool","debug","profile","dist"); + BuildTargets = ("all","install","uninstall","clean","distclean","dist"); CanHavePublicHeaders = NO; BrowserRootEntries = { CLASS_FILES = "Classes";