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
This commit is contained in:
Sergii Stoian 2004-06-20 00:07:52 +00:00
parent 319aa22eea
commit 5137d57150
13 changed files with 146 additions and 72 deletions

View file

@ -1,5 +1,37 @@
2004-06-20 Serg Stoyan <stoyan255@ukr.net> 2004-06-20 Serg Stoyan <stoyan255@ukr.net>
* 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 <projectName>_STANDARD_INSTALL = no if install dir
attribute was not set.
* Modules/BundleProject/PCBundleProject.m:
(appendHead:): Write into GNUmakefile
<projectName>_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 <stoyan255@ukr.net>
* Library/PCProjectManager.m: * Library/PCProjectManager.m:
(convertLegacyProject:atPath:): Get files list from .pcproj file not (convertLegacyProject:atPath:): Get files list from .pcproj file not
from directories. from directories.
@ -39,7 +71,7 @@
(filesForAdd): Fix setting panel attributes. (filesForAdd): Fix setting panel attributes.
* Modules/AggregateProject/PCAggregateProject.m: * Modules/AggregateProject/PCAggregateProject.m:
(appendApplication:): (appendHead:) Added generating of VERSION var. (appendHead:) Added generating of VERSION var.
* Modules/ApplicationProject/PCAppProject.m: * Modules/ApplicationProject/PCAppProject.m:
(appendApplication:): ditto. (appendApplication:): ditto.
* Modules/BundleProject/PCBundleProject.m: * Modules/BundleProject/PCBundleProject.m:

View file

@ -217,20 +217,29 @@ enum {
NSDistantObject <Terminal> *terminal; NSDistantObject <Terminal> *terminal;
NSFileManager *fm = [NSFileManager defaultManager]; 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<Terminal> *)[NSConnection terminal = (NSDistantObject<Terminal> *)[NSConnection
rootProxyForConnectionWithRegisteredName:@"Terminal" host:nil]; rootProxyForConnectionWithRegisteredName:@"Terminal" host:nil];
if (terminal == nil) if (terminal == nil)
{ {
NSRunAlertPanel(@"Attention!", NSRunAlertPanel(@"Debug",
@"Run Terminal application first", @"Run Terminal application first",
@"Close",nil,nil); @"Close",nil,nil);
[debugButton setState:NSOffState]; [debugButton setState:NSOffState];
return; return;
} }
// Executable
pn = [dp stringByAppendingPathExtension:@"debug"]; pn = [dp stringByAppendingPathExtension:@"debug"];
fp = [project projectPath]; fp = [project projectPath];
fp = [fp stringByAppendingPathComponent:pn]; fp = [fp stringByAppendingPathComponent:pn];
@ -240,7 +249,7 @@ enum {
if ([fm isExecutableFileAtPath:fp] == NO) if ([fm isExecutableFileAtPath:fp] == NO)
{ {
NSRunAlertPanel(@"Attention!", NSRunAlertPanel(@"Debug",
@"Can't execute %@!", @"Can't execute %@!",
@"Abort",nil,nil,pn); @"Abort",nil,nil,pn);
[debugButton setState:NSOffState]; [debugButton setState:NSOffState];
@ -273,9 +282,7 @@ enum {
[debugButton setState:NSOffState]; [debugButton setState:NSOffState];
/* RELEASE(args); AUTORELEASE(args);
[runButton setEnabled:NO];
_isDebugging = YES;*/
} }
- (void)run:(id)sender - (void)run:(id)sender
@ -293,9 +300,10 @@ enum {
} }
else else
{ {
NSRunAlertPanel(@"Attention!", NSRunAlertPanel(@"Run",
@"The project is not executable", @"The project is not executable",
@"Close", nil, nil, nil); @"Close", nil, nil, nil);
[runButton setState:NSOffState];
return; return;
} }

View file

@ -599,14 +599,6 @@
NSView *view = nil; NSView *view = nil;
NSPanel *launchPanel = nil; NSPanel *launchPanel = nil;
if ([project isExecutable] == NO)
{
NSRunAlertPanel(@"Attention!",
@"This project is not executable!",
@"OK",nil,nil);
return;
}
view = [[project projectLauncher] componentView]; view = [[project projectLauncher] componentView];
launchPanel = [[project projectManager] launchPanel]; launchPanel = [[project projectManager] launchPanel];
@ -728,7 +720,8 @@
PCProject *changedProject = [notifObject objectForKey:@"Project"]; PCProject *changedProject = [notifObject objectForKey:@"Project"];
if (changedProject != project if (changedProject != project
&& changedProject != [project activeSubproject]) && changedProject != [project activeSubproject]
&& [changedProject superProject] != [project activeSubproject])
{ {
return; return;
} }
@ -743,8 +736,11 @@
- (void)projectDictDidSave:(NSNotification *)aNotif - (void)projectDictDidSave:(NSNotification *)aNotif
{ {
if ([aNotif object] != project PCProject *savedProject = [aNotif object];
&& ![[project loadedSubprojects] containsObject:[aNotif object]])
if (savedProject != project
&& savedProject != [project activeSubproject]
&& [savedProject superProject] != [project activeSubproject])
{ {
return; return;
} }
@ -754,13 +750,16 @@
- (void)activeProjectDidChange:(NSNotification *)aNotif - (void)activeProjectDidChange:(NSNotification *)aNotif
{ {
if ([aNotif object] != project /* PCProject *activeProject = [aNotif object];
&& ![[project loadedSubprojects] containsObject:[aNotif object]])
if (activeProject != project
&& activeProject != [project activeSubproject]
&& [activeProject superProject] != [project activeSubproject])
{ {
return; return;
} }
[self makeKeyWindow]; [self makeKeyWindow];*/
} }
- (void)preferencesDidChange:(NSNotification *)aNotif - (void)preferencesDidChange:(NSNotification *)aNotif

View file

@ -66,7 +66,7 @@ NSString *PCITextFieldGetFocus = @"PCITextFieldGetFocusNotification";
// //
docExtColumn = [(NSTableColumn *)[NSTableColumn alloc] docExtColumn = [(NSTableColumn *)[NSTableColumn alloc]
initWithIdentifier: @"extension"]; initWithIdentifier: @"extension"];
[[docExtColumn headerCell] setStringValue:@"Extenstion"]; [[docExtColumn headerCell] setStringValue:@"Extension"];
[docExtColumn setWidth:75]; [docExtColumn setWidth:75];
docIconColumn = [(NSTableColumn *)[NSTableColumn alloc] docIconColumn = [(NSTableColumn *)[NSTableColumn alloc]
initWithIdentifier: @"icon"]; initWithIdentifier: @"icon"];

View file

@ -88,7 +88,6 @@
- (NSArray *)convertExtensions; - (NSArray *)convertExtensions;
- (BOOL)writeMakefile; - (BOOL)writeMakefile;
- (void)appendHead:(PCMakefileFactory *)mff; - (void)appendHead:(PCMakefileFactory *)mff;
- (void)appendApplication:(PCMakefileFactory *)mff;
- (void)appendTail:(PCMakefileFactory *)mff; - (void)appendTail:(PCMakefileFactory *)mff;
@end @end

View file

@ -412,12 +412,9 @@
// Create the new file // Create the new file
[mf createMakefileForProject:projectName]; [mf createMakefileForProject:projectName];
// Head // Head (Application)
[self appendHead:mf]; [self appendHead:mf];
// Application part
[self appendApplication:mf];
// Subprojects // Subprojects
if ([[projectDict objectForKey:PCSubprojects] count] > 0) if ([[projectDict objectForKey:PCSubprojects] count] > 0)
{ {
@ -472,13 +469,8 @@
- (void)appendHead:(PCMakefileFactory *)mff - (void)appendHead:(PCMakefileFactory *)mff
{ {
[mff appendString: NSString *installDir = [projectDict objectForKey:PCInstallDir];
[NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR = %@\n",
[projectDict objectForKey:PCInstallDir]]];
}
- (void)appendApplication:(PCMakefileFactory *)mff
{
[mff appendString:@"\n#\n# Application\n#\n"]; [mff appendString:@"\n#\n# Application\n#\n"];
[mff appendString:[NSString stringWithFormat:@"VERSION = %@\n", [mff appendString:[NSString stringWithFormat:@"VERSION = %@\n",
[projectDict objectForKey:PCRelease]]]; [projectDict objectForKey:PCRelease]]];
@ -489,6 +481,19 @@
[mff appendString:[NSString stringWithFormat:@"%@_APPLICATION_ICON = %@\n", [mff appendString:[NSString stringWithFormat:@"%@_APPLICATION_ICON = %@\n",
projectName, [projectDict objectForKey:PCAppIcon]]]; 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 - (void)appendTail:(PCMakefileFactory *)mff

View file

@ -150,7 +150,7 @@
"setAppClass:", "setAppClass:",
"setFile:", "setFile:",
"clearFile:", "clearFile:",
"setDocIcon:", "addDocIcon:",
"removeDocIcon:", "removeDocIcon:",
"setCurrentLanguage:" "setCurrentLanguage:"
); );

View file

@ -212,6 +212,8 @@
- (void)appendHead:(PCMakefileFactory *)mff - (void)appendHead:(PCMakefileFactory *)mff
{ {
NSString *installDir = [projectDict objectForKey:PCInstallDir];
[mff appendString:@"\n#\n# Bundle\n#\n"]; [mff appendString:@"\n#\n# Bundle\n#\n"];
[mff appendString:[NSString stringWithFormat:@"VERSION = %@\n", [mff appendString:[NSString stringWithFormat:@"VERSION = %@\n",
[projectDict objectForKey:PCRelease]]]; [projectDict objectForKey:PCRelease]]];
@ -219,12 +221,22 @@
projectName]]; projectName]];
[mff appendString:[NSString stringWithFormat:@"BUNDLE_NAME = %@\n", [mff appendString:[NSString stringWithFormat:@"BUNDLE_NAME = %@\n",
projectName]]; 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", [mff appendString:[NSString stringWithFormat:@"%@_PRINCIPAL_CLASS = %@\n",
projectName, [projectDict objectForKey:PCPrincipalClass]]]; 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 - (void)appendLibraries:(PCMakefileFactory *)mff

View file

@ -88,7 +88,6 @@
- (NSArray *)convertExtensions; - (NSArray *)convertExtensions;
- (BOOL)writeMakefile; - (BOOL)writeMakefile;
- (void)appendHead:(PCMakefileFactory *)mff; - (void)appendHead:(PCMakefileFactory *)mff;
- (void)appendApplication:(PCMakefileFactory *)mff;
- (void)appendTail:(PCMakefileFactory *)mff; - (void)appendTail:(PCMakefileFactory *)mff;
@end @end

View file

@ -425,12 +425,9 @@
// Create the new file // Create the new file
[mf createMakefileForProject:projectName]; [mf createMakefileForProject:projectName];
// Head // Head (Application)
[self appendHead:mf]; [self appendHead:mf];
// Application part
[self appendApplication:mf];
// Subprojects // Subprojects
if ([[projectDict objectForKey:PCSubprojects] count] > 0) if ([[projectDict objectForKey:PCSubprojects] count] > 0)
{ {
@ -479,13 +476,8 @@
- (void)appendHead:(PCMakefileFactory *)mff - (void)appendHead:(PCMakefileFactory *)mff
{ {
[mff appendString: NSString *installDir = [projectDict objectForKey:PCInstallDir];
[NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR = %@\n",
[projectDict objectForKey:PCInstallDir]]];
}
- (void)appendApplication:(PCMakefileFactory *)mff
{
[mff appendString:@"\n#\n# Application\n#\n"]; [mff appendString:@"\n#\n# Application\n#\n"];
[mff appendString:[NSString stringWithFormat:@"VERSION = %@\n", [mff appendString:[NSString stringWithFormat:@"VERSION = %@\n",
[projectDict objectForKey:PCRelease]]]; [projectDict objectForKey:PCRelease]]];
@ -496,6 +488,19 @@
[mff appendString:[NSString stringWithFormat:@"%@_APPLICATION_ICON = %@\n", [mff appendString:[NSString stringWithFormat:@"%@_APPLICATION_ICON = %@\n",
projectName, [projectDict objectForKey:PCAppIcon]]]; 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 - (void)appendTail:(PCMakefileFactory *)mff

View file

@ -280,6 +280,8 @@
- (void)appendHead:(PCMakefileFactory *)mff - (void)appendHead:(PCMakefileFactory *)mff
{ {
NSString *installDir = [projectDict objectForKey:PCInstallDir];
[mff appendString:@"\n#\n# Tool\n#\n"]; [mff appendString:@"\n#\n# Tool\n#\n"];
[mff appendString:[NSString stringWithFormat:@"VERSION = %@\n", [mff appendString:[NSString stringWithFormat:@"VERSION = %@\n",
[projectDict objectForKey:PCRelease]]]; [projectDict objectForKey:PCRelease]]];
@ -289,6 +291,19 @@
projectName]]; projectName]];
[mff appendString:[NSString stringWithFormat:@"%@_TOOL_ICON = %@\n", [mff appendString:[NSString stringWithFormat:@"%@_TOOL_ICON = %@\n",
projectName, [projectDict objectForKey:PCToolIcon]]]; 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 - (void)appendLibraries:(PCMakefileFactory *)mff