diff --git a/ChangeLog b/ChangeLog index 464da25..a262990 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,35 @@ +2009-02-15 Sergii Stoian + + * Framework/PCProjectBrowser.m: + (click:): Do not call editor if subproject name selected. + (fileNameIconImage): Set "FileProject" icon if subproject name selected. + * Framework/PCProjectManager.m: Remove unused methods projectPath and + selectedFileName. + * Framework/PCFileManager.m: Add alert panels if operation ends with + error. + * Framework/PCMakefileFactory.m: Add alert panels on error of creating + files. + * Framework/PCProjectBuilder.m: Review all situations when alert panels + should be opened. Panels text corrected according to OpenStep UIG. + +2009-02-14 Sergii Stoian + + * PCMenuController.m: + (showInfoPanel:): Use appController intead of [NSApp delegate]. + * GNUmakefile: Change version to 0.5.1. + * Resources/Info-gnustep.plist: ditto. + * Framework/PCProjectManager.m: + (open): Move ordering front project window for here... + (openProjectAt:): to here. + * Framework/PCProjectBrowser.m: + (nameOfSelectedCategory): Edit comment text. + * Framework/PCLogController.m: + (showPanel): Call makeKeyAndOrderFront instead of orderFront. + * Headers/PCInfoController.[hm]: + (showInfoWindow:): Get version info from Info-gnustep.plist. + * PCPrefController.m: + (showPanel:): Call makeKeyAndOrderFront instead of orderFront. + 2009-02-14 Nicola Pero * Modules/GNUmakefile (SUBPROJECTS): Removed diff --git a/Documentation/TODO b/Documentation/TODO index fd7400a..ac1e4e5 100644 --- a/Documentation/TODO +++ b/Documentation/TODO @@ -48,26 +48,28 @@ ProjectCenter 0.6 - change project type from file to bundle casamento/mottola - Finish FileNameIcon (draggable, files can be dragged to it) [done!] - More options for file creation [done!] -- Review all situations when dialogs must be popped up [50% done] +- Review all situations when dialogs must be popped up [75% done] - Rewrite Preferences (3rd party sections etc.) stoyan --- Project Editor --------------------------------------------- - - Implement indentation stoyan - - Implement interaction with Builder (errors, warnings) stoyan - - undo inside editor ??? - go to line ??? + - Implement interaction with Builder (errors, warnings) stoyan + - Implement indentation stoyan + - undo inside editor ??? --- Project Builder -------------------------------------------- - - Finish parsing gcc output (make errors, etc.) - Implement interaction with Editor (errors, warnings) stoyan + - Finish parsing gcc output (make errors, etc.) - Think about imlementing pending adding/removal of files ??? -- New icons. Need volonteers!!! ??? - Split "Application GORM" and "Application Renaissance" project types ??? - Add "Palette" project type ??? - Add "Component" project type ??? +- New icons. Need volonteers!!! ??? ProjectCenter 0.7 ----------------- +- Add support for browsing 'Library' category entries ??? +- Add support for non-project files ??? - An initial project wide find feature ??? - Better integration with other tools (GORM) ??? - CVS/SVN integration ??? diff --git a/Framework/English.lproj/BuilderOptions.gorm/data.info b/Framework/English.lproj/BuilderOptions.gorm/data.info index 3bc8f05..da98e43 100644 Binary files a/Framework/English.lproj/BuilderOptions.gorm/data.info and b/Framework/English.lproj/BuilderOptions.gorm/data.info differ diff --git a/Framework/English.lproj/BuilderOptions.gorm/objects.gorm b/Framework/English.lproj/BuilderOptions.gorm/objects.gorm index 7cf4fa4..c43e1fd 100644 Binary files a/Framework/English.lproj/BuilderOptions.gorm/objects.gorm and b/Framework/English.lproj/BuilderOptions.gorm/objects.gorm differ diff --git a/Framework/PCFileManager.m b/Framework/PCFileManager.m index 7251838..e3675cb 100644 --- a/Framework/PCFileManager.m +++ b/Framework/PCFileManager.m @@ -150,13 +150,17 @@ static PCFileManager *_mgr = nil; directoryPath = [toFile stringByDeletingLastPathComponent]; if ([self createDirectoriesIfNeededAtPath:directoryPath] == NO) { - NSLog(@"PCFileManager: createDirectoriesIfNeededAtPath: == NO"); + NSRunAlertPanel(@"Copy File", + @"Couldn't create directories at path %@", + @"Ok",nil,nil, directoryPath); return NO; } if ([fm copyPath:file toPath:toFile handler:self] == NO) { - NSLog(@"PCFileManager: copyPath:toPath: == NO"); + NSRunAlertPanel(@"Copy File", + @"Couldn't copy file %@ to %@", + @"Ok",nil,nil, file, toFile); return NO; } } @@ -176,7 +180,7 @@ static PCFileManager *_mgr = nil; path = [directory stringByAppendingPathComponent:[file lastPathComponent]]; if (![self copyFile:file toFile:path]) - { + { // No need to open aler panel here return NO; } @@ -234,6 +238,9 @@ static PCFileManager *_mgr = nil; { if ([fm removeFileAtPath:path handler:nil] == NO) { + NSRunAlertPanel(@"Remove Directory", + @"Couldn't remove empty directory at path %@", + @"Ok",nil,nil, path); return NO; } path = [path stringByDeletingLastPathComponent]; @@ -257,7 +264,9 @@ static PCFileManager *_mgr = nil; path = [directory stringByAppendingPathComponent:file]; if (![fm removeFileAtPath:path handler:nil]) { - NSLog(@"PCFileManager: removeFileAtPath: == NO"); + NSRunAlertPanel(@"Remove File", + @"Couldn't remove file at path %@", + @"Ok",nil,nil, path); return NO; } @@ -310,6 +319,9 @@ static PCFileManager *_mgr = nil; } else { + NSRunAlertPanel(@"Move File", + @"Couldn't move file %@ to %@", + @"Ok",nil,nil, file, directory); return NO; } diff --git a/Framework/PCMakefileFactory.m b/Framework/PCMakefileFactory.m index 1edb0cd..e07d286 100644 --- a/Framework/PCMakefileFactory.m +++ b/Framework/PCMakefileFactory.m @@ -226,12 +226,15 @@ static PCMakefileFactory *_factory = nil; // Write the new file to disc! mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile.preamble"]; - if ([mfp writeToFile:mfl atomically:YES]) + if (![mfp writeToFile:mfl atomically:YES]) { - return YES; + NSRunAlertPanel(@"Create Makefile", + @"Couldn't create %@", + @"Ok",nil,nil, mfl); + return NO; } - return NO; + return YES; } - (BOOL)createPostambleForProject:(PCProject *)project @@ -246,7 +249,15 @@ static PCMakefileFactory *_factory = nil; postamble = [[project projectPath] stringByAppendingPathComponent:@"GNUmakefile.postamble"]; - return [fm copyPath:template toPath:postamble handler:nil]; + if (![fm copyPath:template toPath:postamble handler:nil]) + { + NSRunAlertPanel(@"Create Makefile", + @"Couldn't create %@", + @"Ok",nil,nil, postamble); + return NO; + } + + return YES; } - (void)appendString:(NSString *)aString diff --git a/Framework/PCProject.m b/Framework/PCProject.m index 6cf86f0..3c2b6bf 100644 --- a/Framework/PCProject.m +++ b/Framework/PCProject.m @@ -188,8 +188,10 @@ NSString { [self updateProjectDict]; - NSRunAlertPanel(@"Project updated!", - @"The project file was converted from previous version!\nPlease make sure that every project attribute contain valid values!", + NSRunAlertPanel(@"Open Project!", + @"The project file was converted from previous version!\n" + "Please make sure that every project attribute contain" + " valid values!", @"OK",nil,nil); } } diff --git a/Framework/PCProjectBrowser.m b/Framework/PCProjectBrowser.m index 3714c7a..36dfdf7 100644 --- a/Framework/PCProjectBrowser.m +++ b/Framework/PCProjectBrowser.m @@ -368,6 +368,7 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; PCProject *activeProject; NSString *browserPath; NSString *filePath; + NSString *fileName; if (sender != browser) { @@ -379,13 +380,14 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; activeProject = [[project projectManager] activeProject]; browserPath = [self path]; filePath = [self pathToSelectedFile]; + fileName = [self nameOfSelectedFile]; NSLog(@"category: %@ forProject: %@", category, [activeProject projectName]); if (filePath && [filePath isEqualToString:browserPath] && - ![category isEqualToString:[activeProject projectName]] && + ![fileName isEqualToString:[activeProject projectName]] && ![[ud objectForKey:SeparateEditor] isEqualToString:@"YES"]) { // NSLog(@"[click] category: %@ filePath: %@", category, filePath); @@ -565,11 +567,12 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; - (NSImage *)fileNameIconImage { - NSString *categoryName = nil; - NSString *fileName = nil; - NSString *fileExtension = nil; - NSString *iconName = nil; - NSImage *icon = nil; + NSString *categoryName = nil; + NSString *fileName = nil; + NSString *fileExtension = nil; + NSString *iconName = nil; + NSImage *icon = nil; + PCProject *activeProject = [[project projectManager] activeProject]; fileName = [self nameOfSelectedFile]; if (fileName) @@ -592,7 +595,9 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification"; { iconName = [[NSString alloc] initWithString:@"MultiFiles"]; } - else if (!categoryName && !fileName) // Nothing selected + // Nothing or subproject name selected + else if ((!categoryName && !fileName) || + [fileName isEqualToString:[activeProject projectName]]) { iconName = [[NSString alloc] initWithString:@"FileProject"]; } diff --git a/Framework/PCProjectBuilder.m b/Framework/PCProjectBuilder.m index 54ca715..653db28 100644 --- a/Framework/PCProjectBuilder.m +++ b/Framework/PCProjectBuilder.m @@ -231,8 +231,9 @@ if (!makePath || ![[NSFileManager defaultManager] fileExistsAtPath:makePath]) { - NSRunAlertPanel(@"Build terminated", - @"Build tool not found.\nFile \"%@\" doesn't exist!", + NSRunAlertPanel(@"Project Build", + @"Build tool '%@' not found.\n" + "Build process terminated.", @"OK", nil, nil, makePath); return NO; } @@ -373,9 +374,9 @@ if ([[[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] objectForKey:PromptOnClean] isEqualToString:@"YES"]) { - if (NSRunAlertPanel(@"Clean Project?", + if (NSRunAlertPanel(@"Project Clean", @"Do you really want to clean project '%@'?", - @"Yes", @"No", nil, [project projectName]) + @"Clean", @"Stop", nil, [project projectName]) == NSAlertAlternateReturn) { [cleanButton setState:NSOffState]; @@ -454,7 +455,6 @@ // --- Actions - (BOOL)prebuildCheck { -// PCPrefController *prefs = [PCPrefController sharedPCPreferences]; id prefs = [[project projectManager] prefController]; NSString *buildDir = [prefs objectForKey:RootBuildDirectory]; PCFileManager *pcfm = [PCFileManager defaultManager]; @@ -466,16 +466,23 @@ // Checking prerequisites if ([project isProjectChanged]) { - if (NSRunAlertPanel(@"Project Changed!", - @"Should it be saved first?", - @"Yes", @"No", nil) == NSAlertDefaultReturn) + int ret; + ret = NSRunAlertPanel(@"Project Build", + @"Project was changed and not saved.\n" + "Do you want to save project before building it?", + @"Save Project", @"Stop Build", nil); + if (ret == NSAlertDefaultReturn) { [project save]; } + else + { + return NO; + } } else { - // Synchronize PC.project and generated files just for case + // Synchronize PC.project and generate files [project save]; } @@ -503,9 +510,6 @@ NSPipe *logPipe; NSPipe *errorPipe; - // TODO: Support build options!!! - // NSDictionary *optionDict = [project buildOptions]; - // Checking build conditions if ([self prebuildCheck] == NO) { diff --git a/Framework/PCProjectManager.m b/Framework/PCProjectManager.m index a243ee6..da54675 100644 --- a/Framework/PCProjectManager.m +++ b/Framework/PCProjectManager.m @@ -74,7 +74,6 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; object:nil]; fileManager = [[PCFileManager alloc] initWithProjectManager:self]; - } return self; @@ -335,16 +334,6 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; return findPanel; } -- (NSString *)projectPath -{ - return [activeProject projectPath]; -} - -- (NSString *)selectedFileName -{ - return [[activeProject projectBrowser] nameOfSelectedFile]; -} - // ============================================================================ // ==== Project management // ============================================================================ @@ -771,7 +760,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; { NSRunAlertPanel(@"Save Project", @"Couldn't save project %@!", - @"OK", nil, nil, [activeProject projectName]); + @"OK", nil, nil, [rootProject projectName]); return NO; } diff --git a/Headers/ProjectCenter/PCProjectManager.h b/Headers/ProjectCenter/PCProjectManager.h index 2b88cc9..6748cb6 100644 --- a/Headers/ProjectCenter/PCProjectManager.h +++ b/Headers/ProjectCenter/PCProjectManager.h @@ -119,15 +119,13 @@ extern NSString *PCActiveProjectDidChangeNotification; - (NSPanel *)buildPanel; - (NSPanel *)launchPanel; - (NSPanel *)projectFinderPanel; -- (NSString *)projectPath; -- (NSString *)selectedFileName; // ============================================================================ // ==== Project management // ============================================================================ -// Returns all currently loaded projects. They are stored with their absolut -// paths as the keys. +// Returns all currently loaded projects. They are stored with their absolute +// paths as keys. - (NSMutableDictionary *)loadedProjects; - (PCProject *)activeProject; - (PCProject *)rootActiveProject;