the bundle path is now depending on the GNUSTEP_LOCAL_ROOT env variable

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@8030 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Robert Slover 2000-11-04 16:48:24 +00:00
parent a8188943d4
commit 05dccc683e
2 changed files with 32 additions and 21 deletions

View file

@ -38,7 +38,16 @@
+ (void)initialize
{
NSMutableDictionary *defaults = [NSMutableDictionary dictionary];
NSString *_bundlePath = @"/usr/GNUstep/Local/Library/ProjectCenter";
NSDictionary *env = [[NSProcessInfo processInfo] environment];
NSString *prefix = [env objectForKey:@"GNUSTEP_LOCAL_ROOT"];
NSString *_bundlePath;
if (prefix && ![prefix isEqualToString:@""]) {
_bundlePath = [prefix stringByAppendingPathComponent:@"Library/ProjectCenter"];
}
else {
_bundlePath = [NSString stringWithString:@"/usr/GNUstep/Local/Library/ProjectCenter"];
}
[defaults setObject:_bundlePath forKey:BundlePaths];

View file

@ -374,26 +374,26 @@
- (void)setSuccessSound:(id)sender
{
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"snd",@"au",nil]];
if (path) {
[successField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:SuccessSound];
[preferencesDict setObject:path forKey:SuccessSound];
}
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"snd",@"au",nil]];
if (path) {
[successField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:SuccessSound];
[preferencesDict setObject:path forKey:SuccessSound];
}
}
- (void)setFailureSound:(id)sender
{
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"snd",@"au",nil]];
if (path) {
[failureField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:FailureSound];
[preferencesDict setObject:path forKey:FailureSound];
}
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"snd",@"au",nil]];
if (path) {
[failureField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:FailureSound];
[preferencesDict setObject:path forKey:FailureSound];
}
}
- (void)setPromptOnClean:(id)sender
@ -415,6 +415,7 @@
- (void)setUseExternalEditor:(id)sender
{
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
switch ([[sender selectedCell] state]) {
case 0:
[def setObject:@"NO" forKey:ExternalEditor];
@ -486,11 +487,12 @@
[openPanel setCanChooseDirectories:YES];
[openPanel setCanChooseFiles:YES];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types];
if (retval == NSOKButton) {
[[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"];
file = [[openPanel filenames] objectAtIndex:0];
[[NSUserDefaults standardUserDefaults] setObject:[openPanel directory]
forKey:@"LastOpenDirectory"];
file = [[openPanel filenames] objectAtIndex:0];
}
return file;