From 5137d57150a28dc07458f2ba55b2bfe21e31f21b Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Sun, 20 Jun 2004 00:07:52 +0000 Subject: [PATCH] ProjectWindow, ProjectLauncher, ApplicationProject Inspector.gorm fixes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@19561 72102866-910b-0410-8b05-ffd578937521 --- Documentation/ChangeLog | 34 +++++++++++++++++- Documentation/README | 30 ++++++++-------- Library/PCProjectLauncher.m | 24 ++++++++----- Library/PCProjectWindow.m | 29 ++++++++------- .../PCAppProject+Inspector.m | 6 ++-- Modules/ApplicationProject/PCAppProject.h | 1 - Modules/ApplicationProject/PCAppProject.m | 25 +++++++------ .../Resources/Inspector.gorm/data.classes | 2 +- .../Resources/Inspector.gorm/objects.gorm | Bin 11570 -> 11570 bytes Modules/BundleProject/PCBundleProject.m | 22 +++++++++--- .../RenaissanceProject/PCRenaissanceProject.h | 1 - .../RenaissanceProject/PCRenaissanceProject.m | 29 ++++++++------- Modules/ToolProject/PCToolProject.m | 15 ++++++++ 13 files changed, 146 insertions(+), 72 deletions(-) diff --git a/Documentation/ChangeLog b/Documentation/ChangeLog index 346ad13..8cd06bf 100644 --- a/Documentation/ChangeLog +++ b/Documentation/ChangeLog @@ -1,5 +1,37 @@ 2004-06-20 Serg Stoyan + * Library/PCProjectWindow.m: + (activeProjectDidChange:): Take into account subprojects of + subprojects. + (showProjectLaunch:): Remove attention panel if project is not + executable. + + * Library/PCProjectBrowser.m: (activeProjectDidChange:): ditto. + Take into account subprojects of subprojects. + + * Library/PCProjectLauncher.m: + (debug:): Check if project is executable and order attention panel + if not. + + * Modules/ApplicationProject/Resources/Inspector.gorm: + Fix connection between "Add" button and addDocIcon: method. + + * Modules/ApplicationProject/PCAppProject.m: + (appendApplication:): Removed. + (appndHead:): Move appendApplication's code here. Write into + GNUmakefile _STANDARD_INSTALL = no if install dir + attribute was not set. + * Modules/BundleProject/PCBundleProject.m: + (appendHead:): Write into GNUmakefile + _STANDARD_INSTALL = no if install dir attribute was + not set. + * Modules/RenaissanceProject/PCRenaissanceProject.m: + (appendApplication:): ditto. + * Modules/ToolProject/PCToolProject.m: + (appendHead:): ditto + +2004-06-19 Serg Stoyan + * Library/PCProjectManager.m: (convertLegacyProject:atPath:): Get files list from .pcproj file not from directories. @@ -39,7 +71,7 @@ (filesForAdd): Fix setting panel attributes. * Modules/AggregateProject/PCAggregateProject.m: - (appendApplication:): (appendHead:) Added generating of VERSION var. + (appendHead:) Added generating of VERSION var. * Modules/ApplicationProject/PCAppProject.m: (appendApplication:): ditto. * Modules/BundleProject/PCBundleProject.m: diff --git a/Documentation/README b/Documentation/README index 76c334b..cbd7e54 100644 --- a/Documentation/README +++ b/Documentation/README @@ -1,22 +1,22 @@ - ProjectCenter - ============= +ProjectCenter +============= - This is ProjectCenter, the GNUstep IDE which is part of the GNUstep - project and is copyrighted by the Free Softare Foundation. ProjectCenter - is released under the GPL - see Documentation/COPYING for the details. +This is ProjectCenter, the GNUstep IDE which is part of the GNUstep +project and is copyrighted by the Free Softare Foundation. ProjectCenter +is released under the GPL - see Documentation/COPYING for the details. - Further information can be found on the GNUstep site at www.gnustep.org - on the ProjectCenter page +Further information can be found on the GNUstep site at www.gnustep.org +on the ProjectCenter page - http://www.gnustep.org/experience/ProjectCenter.html +http://www.gnustep.org/experience/ProjectCenter.html - For the installation instructions read the INSTALL file. - For a list of upcoming and/or planned features read the TODO file. - For a list of changes in released versions read the ANNOUNCE file. +For the installation instructions read the INSTALL file. +For a list of upcoming and/or planned features read the TODO file. +For a list of changes in released versions read the ANNOUNCE file. - The main author of ProjectCenter is Philippe C.D. Robert, current - maintainer is Serg Stoyan, but others have contributed a lot to the - current state of the project (see Documentatio/AUTHORS). Many of the - icons have been created by Andrew Lindsay. +The main author of ProjectCenter is Philippe C.D. Robert, current +maintainer is Serg Stoyan, but others have contributed a lot to the +current state of the project (see Documentatio/AUTHORS). Many of the +icons have been created by Andrew Lindsay. diff --git a/Library/PCProjectLauncher.m b/Library/PCProjectLauncher.m index f9bec60..c26f309 100644 --- a/Library/PCProjectLauncher.m +++ b/Library/PCProjectLauncher.m @@ -217,20 +217,29 @@ enum { NSDistantObject *terminal; NSFileManager *fm = [NSFileManager defaultManager]; - /* Get the Terminal application */ + // Check if project type is executable + if (![project isExecutable]) + { + NSRunAlertPanel(@"Debug", + @"The project is not executable", + @"Close", nil, nil, nil); + [debugButton setState:NSOffState]; + return; + } + + // Get the Terminal application terminal = (NSDistantObject *)[NSConnection rootProxyForConnectionWithRegisteredName:@"Terminal" host:nil]; if (terminal == nil) { - NSRunAlertPanel(@"Attention!", + NSRunAlertPanel(@"Debug", @"Run Terminal application first", @"Close",nil,nil); [debugButton setState:NSOffState]; return; } - // Executable pn = [dp stringByAppendingPathExtension:@"debug"]; fp = [project projectPath]; fp = [fp stringByAppendingPathComponent:pn]; @@ -240,7 +249,7 @@ enum { if ([fm isExecutableFileAtPath:fp] == NO) { - NSRunAlertPanel(@"Attention!", + NSRunAlertPanel(@"Debug", @"Can't execute %@!", @"Abort",nil,nil,pn); [debugButton setState:NSOffState]; @@ -273,9 +282,7 @@ enum { [debugButton setState:NSOffState]; -/* RELEASE(args); - [runButton setEnabled:NO]; - _isDebugging = YES;*/ + AUTORELEASE(args); } - (void)run:(id)sender @@ -293,9 +300,10 @@ enum { } else { - NSRunAlertPanel(@"Attention!", + NSRunAlertPanel(@"Run", @"The project is not executable", @"Close", nil, nil, nil); + [runButton setState:NSOffState]; return; } diff --git a/Library/PCProjectWindow.m b/Library/PCProjectWindow.m index 1bfc1de..c88a7a0 100644 --- a/Library/PCProjectWindow.m +++ b/Library/PCProjectWindow.m @@ -599,14 +599,6 @@ NSView *view = nil; NSPanel *launchPanel = nil; - if ([project isExecutable] == NO) - { - NSRunAlertPanel(@"Attention!", - @"This project is not executable!", - @"OK",nil,nil); - return; - } - view = [[project projectLauncher] componentView]; launchPanel = [[project projectManager] launchPanel]; @@ -727,8 +719,9 @@ NSDictionary *notifObject = [aNotif object]; PCProject *changedProject = [notifObject objectForKey:@"Project"]; - if (changedProject != project - && changedProject != [project activeSubproject]) + if (changedProject != project + && changedProject != [project activeSubproject] + && [changedProject superProject] != [project activeSubproject]) { return; } @@ -743,8 +736,11 @@ - (void)projectDictDidSave:(NSNotification *)aNotif { - if ([aNotif object] != project - && ![[project loadedSubprojects] containsObject:[aNotif object]]) + PCProject *savedProject = [aNotif object]; + + if (savedProject != project + && savedProject != [project activeSubproject] + && [savedProject superProject] != [project activeSubproject]) { return; } @@ -754,13 +750,16 @@ - (void)activeProjectDidChange:(NSNotification *)aNotif { - if ([aNotif object] != project - && ![[project loadedSubprojects] containsObject:[aNotif object]]) +/* PCProject *activeProject = [aNotif object]; + + if (activeProject != project + && activeProject != [project activeSubproject] + && [activeProject superProject] != [project activeSubproject]) { return; } - [self makeKeyWindow]; + [self makeKeyWindow];*/ } - (void)preferencesDidChange:(NSNotification *)aNotif diff --git a/Modules/ApplicationProject/PCAppProject+Inspector.m b/Modules/ApplicationProject/PCAppProject+Inspector.m index 3295d1d..d7f5a92 100644 --- a/Modules/ApplicationProject/PCAppProject+Inspector.m +++ b/Modules/ApplicationProject/PCAppProject+Inspector.m @@ -66,7 +66,7 @@ NSString *PCITextFieldGetFocus = @"PCITextFieldGetFocusNotification"; // docExtColumn = [(NSTableColumn *)[NSTableColumn alloc] initWithIdentifier: @"extension"]; - [[docExtColumn headerCell] setStringValue:@"Extenstion"]; + [[docExtColumn headerCell] setStringValue:@"Extension"]; [docExtColumn setWidth:75]; docIconColumn = [(NSTableColumn *)[NSTableColumn alloc] initWithIdentifier: @"icon"]; @@ -311,9 +311,9 @@ NSString *PCITextFieldGetFocus = @"PCITextFieldGetFocusNotification"; // Document Icons - (void)addDocIcon:(id)sender { - int row; + int row; NSMutableDictionary *entry = [NSMutableDictionary dictionaryWithCapacity:2]; - int selectedRow = [docIconsList selectedRow]; + int selectedRow = [docIconsList selectedRow]; [entry setObject:@"" forKey:@"Extension"]; [entry setObject:@"" forKey:@"Icon"]; diff --git a/Modules/ApplicationProject/PCAppProject.h b/Modules/ApplicationProject/PCAppProject.h index 785bd00..a0831b3 100644 --- a/Modules/ApplicationProject/PCAppProject.h +++ b/Modules/ApplicationProject/PCAppProject.h @@ -88,7 +88,6 @@ - (NSArray *)convertExtensions; - (BOOL)writeMakefile; - (void)appendHead:(PCMakefileFactory *)mff; -- (void)appendApplication:(PCMakefileFactory *)mff; - (void)appendTail:(PCMakefileFactory *)mff; @end diff --git a/Modules/ApplicationProject/PCAppProject.m b/Modules/ApplicationProject/PCAppProject.m index ada27bc..3baca30 100644 --- a/Modules/ApplicationProject/PCAppProject.m +++ b/Modules/ApplicationProject/PCAppProject.m @@ -412,12 +412,9 @@ // Create the new file [mf createMakefileForProject:projectName]; - // Head + // Head (Application) [self appendHead:mf]; - // Application part - [self appendApplication:mf]; - // Subprojects if ([[projectDict objectForKey:PCSubprojects] count] > 0) { @@ -472,13 +469,8 @@ - (void)appendHead:(PCMakefileFactory *)mff { - [mff appendString: - [NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR = %@\n", - [projectDict objectForKey:PCInstallDir]]]; -} + NSString *installDir = [projectDict objectForKey:PCInstallDir]; -- (void)appendApplication:(PCMakefileFactory *)mff -{ [mff appendString:@"\n#\n# Application\n#\n"]; [mff appendString:[NSString stringWithFormat:@"VERSION = %@\n", [projectDict objectForKey:PCRelease]]]; @@ -489,6 +481,19 @@ [mff appendString:[NSString stringWithFormat:@"%@_APPLICATION_ICON = %@\n", projectName, [projectDict objectForKey:PCAppIcon]]]; + + if ([installDir isEqualToString:@""]) + { + [mff appendString: + [NSString stringWithFormat:@"%@_STANDARD_INSTALL = no\n", + projectName]]; + } + else + { + [mff appendString: + [NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR = %@\n", + installDir]]; + } } - (void)appendTail:(PCMakefileFactory *)mff diff --git a/Modules/ApplicationProject/Resources/Inspector.gorm/data.classes b/Modules/ApplicationProject/Resources/Inspector.gorm/data.classes index eef309c..a4e85dd 100644 --- a/Modules/ApplicationProject/Resources/Inspector.gorm/data.classes +++ b/Modules/ApplicationProject/Resources/Inspector.gorm/data.classes @@ -150,7 +150,7 @@ "setAppClass:", "setFile:", "clearFile:", - "setDocIcon:", + "addDocIcon:", "removeDocIcon:", "setCurrentLanguage:" ); diff --git a/Modules/ApplicationProject/Resources/Inspector.gorm/objects.gorm b/Modules/ApplicationProject/Resources/Inspector.gorm/objects.gorm index 5e182eefee90aceaca086a3a5f06950f7b4ec1db..6e4e66ff462289f0b51da9473296412788540e63 100644 GIT binary patch delta 171 zcmdlKwJBAjG|Sx2TX9+mj7%0~l2&v+Ed$sBKi*puXYl zgaAhMjmjWa0HelaZygmbO(6H}2K4|&t;v--dcxX3bVJ8%1Trfq`2UNN|aQSS$?1 z45{W=`x&rOveHMvr9Ed diff --git a/Modules/BundleProject/PCBundleProject.m b/Modules/BundleProject/PCBundleProject.m index c7dcd8a..d221797 100644 --- a/Modules/BundleProject/PCBundleProject.m +++ b/Modules/BundleProject/PCBundleProject.m @@ -212,19 +212,31 @@ - (void)appendHead:(PCMakefileFactory *)mff { + NSString *installDir = [projectDict objectForKey:PCInstallDir]; + [mff appendString:@"\n#\n# Bundle\n#\n"]; [mff appendString:[NSString stringWithFormat:@"VERSION = %@\n", - [projectDict objectForKey:PCRelease]]]; + [projectDict objectForKey:PCRelease]]]; [mff appendString:[NSString stringWithFormat:@"PACKAGE_NAME = %@\n", projectName]]; [mff appendString:[NSString stringWithFormat:@"BUNDLE_NAME = %@\n", projectName]]; - [mff appendString:[NSString stringWithFormat:@"BUNDLE_EXTENSION = %@\n", - [projectDict objectForKey:PCBundleExtension]]]; - [mff appendString:[NSString stringWithFormat:@"BUNDLE_INSTALL_DIR = %@\n", - [projectDict objectForKey:PCInstallDir]]]; [mff appendString:[NSString stringWithFormat:@"%@_PRINCIPAL_CLASS = %@\n", projectName, [projectDict objectForKey:PCPrincipalClass]]]; + [mff appendString:[NSString stringWithFormat:@"BUNDLE_EXTENSION = %@\n", + [projectDict objectForKey:PCBundleExtension]]]; + + if ([installDir isEqualToString:@""]) + { + [mff appendString: + [NSString stringWithFormat:@"%@_STANDARD_INSTALL = no\n", + projectName]]; + } + else + { + [mff appendString:[NSString stringWithFormat:@"BUNDLE_INSTALL_DIR = %@\n", + installDir]]; + } } - (void)appendLibraries:(PCMakefileFactory *)mff diff --git a/Modules/RenaissanceProject/PCRenaissanceProject.h b/Modules/RenaissanceProject/PCRenaissanceProject.h index 336d96b..a41a418 100644 --- a/Modules/RenaissanceProject/PCRenaissanceProject.h +++ b/Modules/RenaissanceProject/PCRenaissanceProject.h @@ -88,7 +88,6 @@ - (NSArray *)convertExtensions; - (BOOL)writeMakefile; - (void)appendHead:(PCMakefileFactory *)mff; -- (void)appendApplication:(PCMakefileFactory *)mff; - (void)appendTail:(PCMakefileFactory *)mff; @end diff --git a/Modules/RenaissanceProject/PCRenaissanceProject.m b/Modules/RenaissanceProject/PCRenaissanceProject.m index 9ff2f56..b6de7a9 100644 --- a/Modules/RenaissanceProject/PCRenaissanceProject.m +++ b/Modules/RenaissanceProject/PCRenaissanceProject.m @@ -425,12 +425,9 @@ // Create the new file [mf createMakefileForProject:projectName]; - // Head + // Head (Application) [self appendHead:mf]; - // Application part - [self appendApplication:mf]; - // Subprojects if ([[projectDict objectForKey:PCSubprojects] count] > 0) { @@ -479,23 +476,31 @@ - (void)appendHead:(PCMakefileFactory *)mff { - [mff appendString: - [NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR = %@\n", - [projectDict objectForKey:PCInstallDir]]]; -} + NSString *installDir = [projectDict objectForKey:PCInstallDir]; -- (void)appendApplication:(PCMakefileFactory *)mff -{ [mff appendString:@"\n#\n# Application\n#\n"]; [mff appendString:[NSString stringWithFormat:@"VERSION = %@\n", [projectDict objectForKey:PCRelease]]]; [mff appendString: - [NSString stringWithFormat:@"PACKAGE_NAME = %@\n",projectName]]; + [NSString stringWithFormat:@"PACKAGE_NAME = %@\n", projectName]]; [mff appendString: - [NSString stringWithFormat:@"APP_NAME = %@\n",projectName]]; + [NSString stringWithFormat:@"APP_NAME = %@\n", projectName]]; [mff appendString:[NSString stringWithFormat:@"%@_APPLICATION_ICON = %@\n", projectName, [projectDict objectForKey:PCAppIcon]]]; + + if ([installDir isEqualToString:@""]) + { + [mff appendString: + [NSString stringWithFormat:@"%@_STANDARD_INSTALL = no\n", + projectName]]; + } + else + { + [mff appendString: + [NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR = %@\n", + installDir]]; + } } - (void)appendTail:(PCMakefileFactory *)mff diff --git a/Modules/ToolProject/PCToolProject.m b/Modules/ToolProject/PCToolProject.m index 86876f2..7e3332a 100644 --- a/Modules/ToolProject/PCToolProject.m +++ b/Modules/ToolProject/PCToolProject.m @@ -280,6 +280,8 @@ - (void)appendHead:(PCMakefileFactory *)mff { + NSString *installDir = [projectDict objectForKey:PCInstallDir]; + [mff appendString:@"\n#\n# Tool\n#\n"]; [mff appendString:[NSString stringWithFormat:@"VERSION = %@\n", [projectDict objectForKey:PCRelease]]]; @@ -289,6 +291,19 @@ projectName]]; [mff appendString:[NSString stringWithFormat:@"%@_TOOL_ICON = %@\n", projectName, [projectDict objectForKey:PCToolIcon]]]; + + if ([installDir isEqualToString:@""]) + { + [mff appendString: + [NSString stringWithFormat:@"%@_STANDARD_INSTALL = no\n", + projectName]]; + } + else + { + [mff appendString: + [NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR = %@\n", + installDir]]; + } } - (void)appendLibraries:(PCMakefileFactory *)mff