diff --git a/English.lproj/Preferences.gorm/data.info b/English.lproj/Preferences.gorm/data.info index 3bc8f05..da98e43 100644 Binary files a/English.lproj/Preferences.gorm/data.info and b/English.lproj/Preferences.gorm/data.info differ diff --git a/English.lproj/Preferences.gorm/objects.gorm b/English.lproj/Preferences.gorm/objects.gorm index 921273a..b9d4e12 100644 Binary files a/English.lproj/Preferences.gorm/objects.gorm and b/English.lproj/Preferences.gorm/objects.gorm differ diff --git a/GNUmakefile b/GNUmakefile index a34a2f0..c9ab5e8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -90,7 +90,8 @@ Modules/Projects/ResourceSet/ResourceSet.project \ Modules/Projects/Tool/Tool.project \ Modules/Editors/ProjectCenter/ProjectCenter.editor \ Modules/Parsers/ProjectCenter/ProjectCenter.parser \ -Modules/Debuggers/ProjectCenter/ProjectCenter.debugger +Modules/Debuggers/ProjectCenter/ProjectCenter.debugger \ +Modules/Preferences/Build/Build.preferences # # Localization diff --git a/Headers/PCPrefController.h b/Headers/PCPrefController.h index b224ba6..47a2892 100644 --- a/Headers/PCPrefController.h +++ b/Headers/PCPrefController.h @@ -27,28 +27,19 @@ #import -#ifndef PCDefaultBuildTool -#define PCDefaultBuildTool @"/usr/bin/make" -#endif - #ifndef PCDefaultDebugger #define PCDefaultDebugger @"/usr/bin/gdb" #endif @interface PCPrefController : NSObject { + NSUserDefaults *userDefaults; + IBOutlet NSPanel *panel; IBOutlet NSPopUpButton *popupButton; IBOutlet NSBox *sectionsView; - IBOutlet NSBox *buildingView; - IBOutlet NSTextField *successField; - IBOutlet NSButton *setSuccessButton; - IBOutlet NSTextField *failureField; - IBOutlet NSButton *setFailureButton; - IBOutlet NSTextField *rootBuildDirField; - IBOutlet NSButton *rootBuildDirButton; - IBOutlet NSButton *promptOnClean; + NSMutableDictionary *sectionsDict; IBOutlet NSBox *savingView; IBOutlet NSButton *saveOnQuit; @@ -64,8 +55,6 @@ IBOutlet NSButton *promptWhenQuit; IBOutlet NSButton *deleteCache; IBOutlet NSButton *fullPathInFilePanels; - IBOutlet NSTextField *buildToolField; - IBOutlet NSButton *buildToolButton; IBOutlet NSTextField *debuggerField; IBOutlet NSButton *debuggerButton; IBOutlet NSTextField *editorField; @@ -100,11 +89,6 @@ - (void)popupChanged:(id)sender; -- (void)setSuccessSound:(id)sender; -- (void)setFailureSound:(id)sender; -- (void)setRootBuildDir:(id)sender; -- (void)setPromptOnClean:(id)sender; - - (void)setSaveOnQuit:(id)sender; - (void)setKeepBackup:(id)sender; - (void)setSavePeriod:(id)sender; diff --git a/Headers/Protocols/Preferences.h b/Headers/Protocols/Preferences.h index feb502b..977fac7 100644 --- a/Headers/Protocols/Preferences.h +++ b/Headers/Protocols/Preferences.h @@ -34,11 +34,15 @@ - (NSDictionary *)preferencesDict; - (id)objectForKey:(NSString *)key; +- (void)setObject:(id)anObject forKey:(NSString *)aKey; @end -@protocol PCPrefSection +@protocol PCPrefsSection +- (void)setPrefController:(id )prefs; +- (void)loadDefaults; +- (NSView *)view; @end diff --git a/Modules/GNUmakefile b/Modules/GNUmakefile index c5df6a6..8cf4dcc 100644 --- a/Modules/GNUmakefile +++ b/Modules/GNUmakefile @@ -32,7 +32,8 @@ SUBPROJECTS = \ Projects/ResourceSet \ Projects/Tool \ Editors/ProjectCenter \ - Parsers/ProjectCenter + Parsers/ProjectCenter \ + Preferences/Build # Do not compile the Debuggers/ProjectCenter module on MinGW since I'm # told at the moment it doesn't even compile there. diff --git a/Modules/Preferences/Build/GNUmakefile b/Modules/Preferences/Build/GNUmakefile new file mode 100644 index 0000000..3da9481 --- /dev/null +++ b/Modules/Preferences/Build/GNUmakefile @@ -0,0 +1,41 @@ +# +# GNUmakefile - Build preferences +# +PACKAGE_NAME = Build +include $(GNUSTEP_MAKEFILES)/common.make + +# +# Bundle +# +BUNDLE_NAME = Build +BUNDLE_EXTENSION = .preferences +Build_PRINCIPAL_CLASS = PCBuildPrefs + + +# +# Additional libraries +# +Build_LIBRARIES_DEPEND_UPON += + +# +# Resource files +# +Build_RESOURCE_FILES= \ + Resources/BuildPrefs.gorm \ + Resources/Info.table + +# +# Header files +# +Build_HEADERS= \ + PCBuildPrefs.h + +# +# Class files +# +Build_OBJC_FILES= \ + PCBuildPrefs.m + +include ../../GNUmakefile.bundles +include $(GNUSTEP_MAKEFILES)/bundle.make + diff --git a/Modules/Preferences/Build/PCBuildPrefs.h b/Modules/Preferences/Build/PCBuildPrefs.h new file mode 100644 index 0000000..18b09f9 --- /dev/null +++ b/Modules/Preferences/Build/PCBuildPrefs.h @@ -0,0 +1,61 @@ +// +// GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html +// +// Copyright (C) 2001-2009 Free Software Foundation +// +// Authors: Sergii Stoian +// +// Description: +// +// 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 + +#ifndef PCDefaultBuildTool +#define PCDefaultBuildTool @"/usr/bin/make" +#endif + +@interface PCBuildPrefs : NSObject +{ + id prefs; + NSDictionary *prefsDict; + + IBOutlet NSBox *buildingView; + + IBOutlet NSTextField *successField; + IBOutlet NSButton *setSuccessButton; + IBOutlet NSTextField *failureField; + IBOutlet NSButton *setFailureButton; + + IBOutlet NSTextField *rootBuildDirField; + IBOutlet NSButton *setRootBuildDirButton; + IBOutlet NSTextField *buildToolField; + IBOutlet NSButton *setBuildToolButton; + + IBOutlet NSButton *promptOnClean; +} + +// ---------------------------------------------------------------------------- +// --- Init and free +// ---------------------------------------------------------------------------- + +- (id)init; +- (void)dealloc; + +@end + diff --git a/Modules/Preferences/Build/PCBuildPrefs.m b/Modules/Preferences/Build/PCBuildPrefs.m new file mode 100644 index 0000000..14bc602 --- /dev/null +++ b/Modules/Preferences/Build/PCBuildPrefs.m @@ -0,0 +1,206 @@ +// +// GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html +// +// Copyright (C) 2001-2009 Free Software Foundation +// +// Authors: Sergii Stoian +// +// Description: +// +// 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 "PCBuildPrefs.h" + +@implementation PCBuildPrefs + +// ---------------------------------------------------------------------------- +// --- Init and free +// ---------------------------------------------------------------------------- + +- (id)init +{ + self = [super init]; + + if ([NSBundle loadNibNamed:@"BuildPrefs" owner:self] == NO) + { + NSLog(@"PCBuildPrefs: error loading NIB file!"); + } + RETAIN(buildingView); + + return self; +} + +- (void)awakeFromNib +{ + [setSuccessButton setRefusesFirstResponder:YES]; + [setFailureButton setRefusesFirstResponder:YES]; + + [setRootBuildDirButton setRefusesFirstResponder:YES]; + [setBuildToolButton setRefusesFirstResponder:YES]; + + [promptOnClean setRefusesFirstResponder:YES]; +} + +- (void)setPrefController:(id )aPrefs +{ + NSString *val; + int state; + + prefs = aPrefs; + + // Building + if (!(val = [prefs objectForKey:SuccessSound])) + val = @""; + [successField setStringValue:val]; + if (!(val = [prefs objectForKey:FailureSound])) + val = @""; + [failureField setStringValue:val]; + + if (!(val = [prefs objectForKey:RootBuildDirectory])) + val = @""; + [rootBuildDirField setStringValue:val]; + + if (!(val = [prefs objectForKey:BuildTool])) + val = PCDefaultBuildTool; + [buildToolField setStringValue:val]; + + val = [prefs objectForKey:PromptOnClean]; + state = [val isEqualToString:@"YES"] ? NSOnState : NSOffState; + [promptOnClean setState:state]; +} + +- (void)loadDefaults +{ + [prefs setObject:@"" forKey:SuccessSound]; + [prefs setObject:@"" forKey:FailureSound]; + [prefs setObject:@"" forKey:RootBuildDirectory]; + [prefs setObject:PCDefaultBuildTool forKey:BuildTool]; + [prefs setObject:@"YES" forKey:PromptOnClean]; +} + +- (void)dealloc +{ +#ifdef DEBUG + NSLog (@"PCBuildPrefs: dealloc"); +#endif + + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + RELEASE(buildingView); + + [super dealloc]; +} + +// Protocol +- (NSView *)view +{ + return buildingView; +} + +// Actions +- (void)setSuccessSound:(id)sender +{ + NSArray *types = [NSArray arrayWithObjects:@"snd",@"au",@"wav",nil]; + NSArray *files; + NSString *path; + + files = [[PCFileManager defaultManager] filesOfTypes:types + operation:PCOpenFileOperation + multiple:NO + title:@"Set Success Sound" + accView:nil]; + if ((path = [files objectAtIndex:0])) + { + [successField setStringValue:path]; + [prefs setObject:path forKey:SuccessSound]; + } +} + +- (void)setFailureSound:(id)sender +{ + NSArray *types = [NSArray arrayWithObjects:@"snd",@"au",@"wav",nil]; + NSArray *files; + NSString *path; + + files = [[PCFileManager defaultManager] filesOfTypes:types + operation:PCOpenFileOperation + multiple:NO + title:@"Set Failure Sound" + accView:nil]; + + if ((path = [files objectAtIndex:0])) + { + [failureField setStringValue:path]; + [prefs setObject:path forKey:FailureSound]; + } +} + +- (void)setRootBuildDir:(id)sender +{ + NSArray *files; + NSString *path; + + files = [[PCFileManager defaultManager] filesOfTypes:nil + operation:PCOpenProjectOperation + multiple:NO + title:@"Set Build Directory" + accView:nil]; + + if ((path = [files objectAtIndex:0])) + { + [rootBuildDirField setStringValue:path]; + [prefs setObject:path forKey:RootBuildDirectory]; + } +} + +- (void)setBuildTool:(id)sender +{ + NSArray *files; + NSString *path; + + files = [[PCFileManager defaultManager] filesOfTypes:nil + operation:PCOpenFileOperation + multiple:NO + title:@"Set Build Tool" + accView:nil]; + + if ((path = [files objectAtIndex:0])) + { + [buildToolField setStringValue:path]; + [prefs setObject:path forKey:BuildTool]; + } +} + +- (void)setPromptOnClean:(id)sender +{ + NSString *state; + + if (promptOnClean == nil) + {// HACK!!! need to be fixed in GNUstep + promptOnClean = sender; + return; + } + + state = ([sender state] == NSOffState) ? @"NO" : @"YES"; + [prefs setObject:state forKey:PromptOnClean]; +} + +@end + diff --git a/Modules/Preferences/Build/Resources/BuildPrefs.gorm/data.classes b/Modules/Preferences/Build/Resources/BuildPrefs.gorm/data.classes new file mode 100644 index 0000000..dd7f6bf --- /dev/null +++ b/Modules/Preferences/Build/Resources/BuildPrefs.gorm/data.classes @@ -0,0 +1,35 @@ +{ + "## Comment" = "Do NOT change this file, Gorm maintains it"; + FirstResponder = { + Actions = ( + "setBuildTool:", + "setFailureSound:", + "setPromptOnClean:", + "setRootBuildDir:", + "setSuccessSound:" + ); + Super = NSObject; + }; + PCBuildPrefs = { + Actions = ( + "setPromptOnClean:", + "setFailureSound:", + "setRootBuildDir:", + "setSuccessSound:", + "setBuildTool:" + ); + Outlets = ( + buildingView, + failureField, + promptOnClean, + rootBuildDirField, + setRootBuildDirButton, + setFailureButton, + setSuccessButton, + successField, + buildToolField, + setBuildToolButton + ); + Super = NSObject; + }; +} \ No newline at end of file diff --git a/Modules/Preferences/Build/Resources/BuildPrefs.gorm/data.info b/Modules/Preferences/Build/Resources/BuildPrefs.gorm/data.info new file mode 100644 index 0000000..da98e43 Binary files /dev/null and b/Modules/Preferences/Build/Resources/BuildPrefs.gorm/data.info differ diff --git a/Modules/Preferences/Build/Resources/BuildPrefs.gorm/objects.gorm b/Modules/Preferences/Build/Resources/BuildPrefs.gorm/objects.gorm new file mode 100644 index 0000000..f0f464c Binary files /dev/null and b/Modules/Preferences/Build/Resources/BuildPrefs.gorm/objects.gorm differ diff --git a/Modules/Preferences/Build/Resources/Info.table b/Modules/Preferences/Build/Resources/Info.table new file mode 100644 index 0000000..d9c7da5 --- /dev/null +++ b/Modules/Preferences/Build/Resources/Info.table @@ -0,0 +1,6 @@ +{ + Type = "Preferences"; + Name = "Build"; + Description = "Preferences for Project Build."; + PrincipalClassName = "PCBuildPrefs"; +} diff --git a/PCPrefController.m b/PCPrefController.m index 04b1849..e00d285 100644 --- a/PCPrefController.m +++ b/PCPrefController.m @@ -22,6 +22,7 @@ #import #import +#import #import "PCPrefController.h" #import @@ -58,8 +59,14 @@ static PCPrefController *_prefCtrllr = nil; } // The prefs from the defaults - prefs = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; - preferencesDict = [[NSMutableDictionary alloc] initWithDictionary:prefs]; + + userDefaults = [NSUserDefaults standardUserDefaults]; + RETAIN(userDefaults); + + preferencesDict = [[NSMutableDictionary alloc] + initWithDictionary:[userDefaults dictionaryRepresentation]]; + + [userDefaults setPersistentDomain:preferencesDict forName:@"ProjectCenter"]; if ([preferencesDict objectForKey:@"Version"] == nil) { @@ -79,7 +86,6 @@ static PCPrefController *_prefCtrllr = nil; RELEASE(panel); - RELEASE(buildingView); RELEASE(savingView); RELEASE(keyBindingsView); RELEASE(miscView); @@ -100,12 +106,6 @@ static PCPrefController *_prefCtrllr = nil; [preferencesDict setObject:@"0.4" forKey:@"Version"]; - // Building - [preferencesDict setObject:@"" forKey:SuccessSound]; - [preferencesDict setObject:@"" forKey:FailureSound]; - [preferencesDict setObject:@"YES" forKey:PromptOnClean]; - [preferencesDict setObject:@"" forKey:RootBuildDirectory]; - // Saving [preferencesDict setObject:@"YES" forKey:SaveOnQuit]; [preferencesDict setObject:@"YES" forKey:KeepBackup]; @@ -118,7 +118,6 @@ static PCPrefController *_prefCtrllr = nil; [preferencesDict setObject:@"YES" forKey:PromptOnQuit]; [preferencesDict setObject:@"YES" forKey:DeleteCacheWhenQuitting]; [preferencesDict setObject:@"YES" forKey:FullPathInFilePanels]; - [preferencesDict setObject:@"/usr/bin/make" forKey:BuildTool]; [preferencesDict setObject:@"/usr/bin/gdb" forKey:Debugger]; [preferencesDict setObject:@"ProjectCenter" forKey:Editor]; @@ -140,28 +139,11 @@ static PCPrefController *_prefCtrllr = nil; - (void)loadPreferences { - NSDictionary *prefs; NSString *val; NSString *defValue = @""; - prefs = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; - [preferencesDict addEntriesFromDictionary: prefs]; - // Fill in the defaults - // Building - [successField setStringValue: - (val = [preferencesDict objectForKey:SuccessSound]) ? val : defValue]; - [failureField setStringValue: - (val = [preferencesDict objectForKey:FailureSound]) ? val : defValue]; - - [promptOnClean setState: - ([[preferencesDict objectForKey:PromptOnClean] - isEqualToString: @"YES"]) ? NSOnState : NSOffState]; - - [rootBuildDirField setStringValue: - (val = [preferencesDict objectForKey:RootBuildDirectory]) ? val : defValue]; - // Saving [saveOnQuit setState: ([[preferencesDict objectForKey: SaveOnQuit] @@ -207,8 +189,6 @@ static PCPrefController *_prefCtrllr = nil; ([[preferencesDict objectForKey: FullPathInFilePanels] isEqualToString:@"YES"]) ? NSOnState : NSOffState]; - [buildToolField setStringValue: - (val = [preferencesDict objectForKey:BuildTool]) ? val : PCDefaultBuildTool]; [debuggerField setStringValue: (val = [preferencesDict objectForKey: Debugger]) ? val : PCDefaultDebugger]; [editorField setStringValue: @@ -251,8 +231,6 @@ static PCPrefController *_prefCtrllr = nil; NSArray *tabMatrixCells; unsigned i; - [promptOnClean setRefusesFirstResponder:YES]; - [saveOnQuit setRefusesFirstResponder:YES]; [keepBackup setRefusesFirstResponder:YES]; @@ -279,12 +257,22 @@ static PCPrefController *_prefCtrllr = nil; // Accessory - (NSDictionary *)preferencesDict { - return preferencesDict; + return [userDefaults dictionaryRepresentation]; } - (id)objectForKey:(NSString *)key { - return [preferencesDict objectForKey:key]; + return [userDefaults objectForKey:key]; +} + +- (void)setObject:(id)anObject forKey:(NSString *)aKey +{ + [userDefaults setObject:anObject forKey:aKey]; + [userDefaults synchronize]; + + [[NSNotificationCenter defaultCenter] + postNotificationName:PCPreferencesDidChangeNotification + object:self]; } - (NSString *)selectFileWithTypes:(NSArray *)types @@ -314,6 +302,32 @@ static PCPrefController *_prefCtrllr = nil; return file; } +- (void)loadPrefsSections +{ + PCBundleManager *bundleManager = [[PCBundleManager alloc] init]; + NSDictionary *bundlesInfo; + NSEnumerator *enumerator; + NSString *bundlePath; + NSString *sectionName; + id section; + + sectionsDict = [[NSMutableDictionary alloc] init]; + + bundlesInfo = [bundleManager infoForBundlesType:@"preferences"]; + enumerator = [[bundlesInfo allKeys] objectEnumerator]; + while ((bundlePath = [enumerator nextObject])) + { + sectionName = [[bundlesInfo objectForKey:bundlePath] + objectForKey:@"Name"]; + section = [bundleManager + objectForBundleWithName:sectionName + type:@"preferences" + protocol:@protocol(PCPrefsSection)]; + [section setPrefController:self]; + [sectionsDict setObject:section forKey:sectionName]; + } +} + - (void)showPanel:(id)sender { if (panel == nil @@ -328,135 +342,29 @@ static PCPrefController *_prefCtrllr = nil; { [panel center]; } - RETAIN(buildingView); - RETAIN(savingView); - RETAIN(keyBindingsView); - RETAIN(miscView); - RETAIN(interfaceView); + + [self loadPrefsSections]; // The popup and selected view [popupButton removeAllItems]; - [popupButton addItemWithTitle:@"Building"]; - [popupButton addItemWithTitle:@"Saving"]; - [popupButton addItemWithTitle:@"Key Bindings"]; - [popupButton addItemWithTitle:@"Miscellaneous"]; - [popupButton addItemWithTitle:@"Interface"]; - - [popupButton selectItemWithTitle:@"Building"]; + [popupButton addItemsWithTitles:[sectionsDict allKeys]]; + [popupButton selectItemAtIndex:0]; [self popupChanged:popupButton]; - // Load saved prefs - [self loadPreferences]; - [panel makeKeyAndOrderFront:self]; } // - (void)popupChanged:(id)sender { - NSView *view = nil; + id section; + NSView *view; - switch ([sender indexOfSelectedItem]) - { - case 0: - view = buildingView; - break; - case 1: - view = savingView; - break; - case 2: - view = keyBindingsView; - break; - case 3: - view = miscView; - break; - case 4: - view = interfaceView; - break; - } + section = [sectionsDict objectForKey:[sender titleOfSelectedItem]]; + view = [section view]; [sectionsView setContentView:view]; - [sectionsView display]; -} - -// Building -- (void)setSuccessSound:(id)sender -{ - NSArray *types = [NSArray arrayWithObjects:@"snd",@"au",@"wav",nil]; - NSString *path = [self selectFileWithTypes:types]; - - if (path) - { - [successField setStringValue: path]; - - [[NSUserDefaults standardUserDefaults] setObject:path - forKey:SuccessSound]; - [preferencesDict setObject:path forKey:SuccessSound]; - } -} - -- (void)setFailureSound:(id)sender -{ - NSArray *types = [NSArray arrayWithObjects:@"snd",@"au",@"wav",nil]; - NSString *path = [self selectFileWithTypes:types]; - - if (path) - { - [failureField setStringValue:path]; - - [[NSUserDefaults standardUserDefaults] setObject:path - forKey:FailureSound]; - [preferencesDict setObject:path forKey:FailureSound]; - } -} - -- (void)setRootBuildDir:(id)sender -{ - NSString *path; - - if (sender == rootBuildDirButton) - { - path = [self selectFileWithTypes:nil]; - [rootBuildDirField setStringValue:path]; - } - else - { - path = [rootBuildDirField stringValue]; - } - - if (path) - { - [[NSUserDefaults standardUserDefaults] setObject:path - forKey:RootBuildDirectory]; - [preferencesDict setObject:path - forKey:RootBuildDirectory]; - } -} - -- (void)setPromptOnClean:(id)sender -{ - NSUserDefaults *def = nil; - - if (promptOnClean == nil) - {// HACK!!! need to be fixed in GNUstep - promptOnClean = sender; - return; - } - - def = [NSUserDefaults standardUserDefaults]; - switch ([sender state]) - { - case NSOffState: - [def setObject:@"NO" forKey:PromptOnClean]; - break; - case NSOnState: - [def setObject:@"YES" forKey:PromptOnClean]; - break; - } - [def synchronize]; - - [preferencesDict setObject:[def objectForKey:PromptOnClean] - forKey:PromptOnClean]; +// [sectionsView display]; } // Saving @@ -663,38 +571,6 @@ static PCPrefController *_prefCtrllr = nil; forKey:FullPathInFilePanels]; } -- (void)setBuildTool:(id)sender -{ - NSString *path; - - if (sender == buildToolButton) - { - path = [self selectFileWithTypes:nil]; - [buildToolField setStringValue:path]; - } - else - { - path = [buildToolField stringValue]; - } - - - if ([path isEqualToString:@""] || !path) - { - [buildToolField setStringValue:PCDefaultBuildTool]; - path = [buildToolField stringValue]; - } - else if (!path || ![[NSFileManager defaultManager] fileExistsAtPath:path]) - { - [buildToolField selectText:self]; - NSRunAlertPanel(@"Build Tool not found!", - @"File %@ doesn't exist!", - @"OK", nil, nil, path); - } - - [[NSUserDefaults standardUserDefaults] setObject:path forKey:BuildTool]; - [preferencesDict setObject:path forKey:BuildTool]; -} - - (void)setDebugger:(id)sender { NSString *path;