diff --git a/ChangeLog b/ChangeLog index ebaa50b..5d120d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,13 @@ * Uppercase key for interface category lookup: PCFileManager.m * Adjusting UI elements ... : PCGormProject.m + * Code cleanup and corrected contact address: PCInfoController.m, + PCInfoController.h, PCLogController.m, PCLogController.h, + PCAppController.h, PCAppController.m, PCFindController.h, + PCFindController.m, PCMenuController.h, PCMenuController.m, + PCPrefController.m, PCPrefController.h + * Extracting UI creation into category: PCPrefController+UInterface.h, + PCPrefController+UInterface.m, PCPrefController.m, PCPrefController.h 2003-07-04 Philippe C.D. Robert diff --git a/GNUmakefile b/GNUmakefile index 76eaa47..1f46d86 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -88,7 +88,8 @@ PCFindController.h \ PCInfoController.h \ PCLogController.h \ PCMenuController.h \ -PCPrefController.h +PCPrefController.h \ +PCPrefController+UInterface.h # # Class files @@ -101,6 +102,7 @@ PCInfoController.m \ PCLogController.m \ PCMenuController.m \ PCPrefController.m \ +PCPrefController+UInterface.m \ ProjectCenter_main.m # @@ -115,3 +117,4 @@ include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/application.make -include GNUmakefile.postamble + diff --git a/GNUmakefile.bundles b/GNUmakefile.bundles index 7057a1b..2067c53 100644 --- a/GNUmakefile.bundles +++ b/GNUmakefile.bundles @@ -3,7 +3,7 @@ # # Copyright (C) 2001 Free Software Foundation, Inc. # -# Author: Philippe C.D. Robert +# Author: Philippe C.D. Robert # # This file is part of GNUstep # @@ -71,4 +71,4 @@ ADDITIONAL_INSTALL_DIRS += BUNDLE_EXTENSION = .bundle BUNDLE_INSTALL_DIR = $(GNUSTEP_SYSTEM_ROOT)/Applications/ProjectCenter.app/Resources -$(PACKAGE_NAME)_STANDARD_INSTALL = no \ No newline at end of file +$(PACKAGE_NAME)_STANDARD_INSTALL = no diff --git a/GNUmakefile.postamble b/GNUmakefile.postamble index d8a38d6..b80e36e 100644 --- a/GNUmakefile.postamble +++ b/GNUmakefile.postamble @@ -3,7 +3,7 @@ # # Copyright (C) 2001 Free Software Foundation, Inc. # -# Author: Philippe C.D. Robert +# Author: Philippe C.D. Robert # # This file is part of GNUstep # diff --git a/GNUmakefile.preamble b/GNUmakefile.preamble index 31b130d..ae93d35 100644 --- a/GNUmakefile.preamble +++ b/GNUmakefile.preamble @@ -2,7 +2,7 @@ # # Copyright (C) 2001 Free Software Foundation, Inc. # -# Author: Philippe C.D. Robert +# Author: Philippe C.D. Robert # # This file is part of GNUstep # diff --git a/PCAppController.h b/PCAppController.h index 07c9607..6df3854 100644 --- a/PCAppController.h +++ b/PCAppController.h @@ -3,7 +3,7 @@ Copyright (C) 2001 Free Software Foundation - Author: Philippe C.D. Robert + Author: Philippe C.D. Robert This file is part of GNUstep. diff --git a/PCAppController.m b/PCAppController.m index 6634e93..ef81939 100644 --- a/PCAppController.m +++ b/PCAppController.m @@ -3,7 +3,7 @@ Copyright (C) 2001 Free Software Foundation - Author: Philippe C.D. Robert + Author: Philippe C.D. Robert This file is part of GNUstep. @@ -80,19 +80,17 @@ { if ((self = [super init])) { - // The bundle loader bundleLoader = [[PCBundleLoader alloc] init]; [bundleLoader setDelegate:self]; - // They are registered by the bundleLoader projectTypes = [[NSMutableDictionary alloc] init]; prefController = [[PCPrefController alloc] init]; - finder = [[PCFindController alloc] init]; + finder = [[PCFindController alloc] init]; infoController = [[PCInfoController alloc] init]; - logger = [[PCLogController alloc] init]; + logger = [[PCLogController alloc] init]; projectManager = [[PCProjectManager alloc] init]; - fileManager = [PCFileManager fileManager]; + fileManager = [PCFileManager fileManager]; menuController = [[PCMenuController alloc] init]; [projectManager setDelegate:self]; @@ -109,22 +107,22 @@ - (void)dealloc { if (doConnection) - { - [doConnection invalidate]; - [doConnection release]; - } + { + [doConnection invalidate]; + RELEASE(doConnection); + } - [prefController release]; - [finder release]; - [infoController release]; - [logger release]; - [projectManager release]; - [fileManager release]; - [menuController release]; + RELEASE(prefController); + RELEASE(finder); + RELEASE(infoController); + RELEASE(logger); + RELEASE(projectManager); + RELEASE(fileManager); + RELEASE(menuController); - [bundleLoader release]; - [doServer release]; - [projectTypes release]; + RELEASE(bundleLoader); + RELEASE(doServer); + RELEASE(projectTypes); [super dealloc]; } @@ -242,11 +240,9 @@ { NSString *h = [[NSProcessInfo processInfo] hostName]; NSString *connectionName = [NSString stringWithFormat:@"ProjectCenter:%@",h]; + [logger logMessage:@"Loading additional subsystems..." tag:INFORMATION]; - //[bundleLoader loadBundles]; - - // The DO server doServer = [[PCServer alloc] init]; NS_DURING @@ -256,10 +252,14 @@ NS_HANDLER - NSRunAlertPanel(@"Warning!",@"Could not register the DO connection %@",@"OK",nil,nil,nil,connectionName); + NSRunAlertPanel(@"Warning!",@"Could not register the DO connection %@", + @"OK",nil,nil,nil,connectionName); NS_ENDHANDLER - [[NSNotificationCenter defaultCenter] addObserver:doServer selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:doConnection]; + [[NSNotificationCenter defaultCenter] addObserver:doServer + selector:@selector(connectionDidDie:) + name:NSConnectionDidDieNotification + object:doConnection]; [doConnection setDelegate:doServer]; @@ -292,9 +292,8 @@ - (void)applicationWillTerminate:(NSNotification *)notification { - // [[PCLogController sharedController] logMessageWithTag:INFORMATION object:self format:@"ProjectCenter is going down..."]; - - if ([[[NSUserDefaults standardUserDefaults] stringForKey:DeleteCacheWhenQuitting] isEqualToString:@"YES"]) { + if ([[[NSUserDefaults standardUserDefaults] stringForKey:DeleteCacheWhenQuitting] isEqualToString:@"YES"]) + { [[NSFileManager defaultManager] removeFileAtPath:[projectManager rootBuildPath] handler:nil]; } @@ -312,18 +311,20 @@ NSAssert(aBundle,@"No valid bundle!"); principalClass = [aBundle principalClass]; - if ([principalClass conformsToProtocol:@protocol(ProjectType)]) { + if ([principalClass conformsToProtocol:@protocol(ProjectType)]) + { NSString *name = [[principalClass sharedCreator] projectTypeName]; [logger logMessage:[NSString stringWithFormat:@"Project type %@ successfully loaded!",name] tag:INFORMATION]; - if ([self registerProjectCreator:NSStringFromClass(principalClass) forKey:name]) { + if ([self registerProjectCreator:NSStringFromClass(principalClass) forKey:name]) + { [menuController addProjectTypeNamed:name]; - [logger logMessage:[NSString stringWithFormat:@"Project type %@ successfully registered!",name] tag:INFORMATION]; } } - else if ([principalClass conformsToProtocol:@protocol(FileCreator)]) { + else if ([principalClass conformsToProtocol:@protocol(FileCreator)]) + { [fileManager registerCreatorsWithObjectsAndKeys:[[principalClass sharedCreator] creatorDictionary]]; // In objc.h there is already th like (char *)name... @@ -337,7 +338,8 @@ - (BOOL)registerProjectCreator:(NSString *)className forKey:(NSString *)aKey { - if ([projectTypes objectForKey:aKey]) { + if ([projectTypes objectForKey:aKey]) + { return NO; } diff --git a/PCFindController.h b/PCFindController.h index cfe9bdb..29c6c20 100644 --- a/PCFindController.h +++ b/PCFindController.h @@ -3,7 +3,7 @@ Copyright (C) 2001 Free Software Foundation - Author: Philippe C.D. Robert + Author: Philippe C.D. Robert This file is part of GNUstep. @@ -31,7 +31,6 @@ @interface PCFindController : NSObject { - } @end diff --git a/PCFindController.m b/PCFindController.m index e53ca4b..81885de 100644 --- a/PCFindController.m +++ b/PCFindController.m @@ -3,7 +3,7 @@ Copyright (C) 2001 Free Software Foundation - Author: Philippe C.D. Robert + Author: Philippe C.D. Robert This file is part of GNUstep. diff --git a/PCMenuController.h b/PCMenuController.h index 047d894..c4fccd0 100644 --- a/PCMenuController.h +++ b/PCMenuController.h @@ -3,7 +3,7 @@ Copyright (C) 2001 Free Software Foundation - Author: Philippe C.D. Robert + Author: Philippe C.D. Robert This file is part of GNUstep. @@ -118,3 +118,4 @@ @end #endif + diff --git a/PCMenuController.m b/PCMenuController.m index 79f92fd..16e21a8 100644 --- a/PCMenuController.m +++ b/PCMenuController.m @@ -3,7 +3,7 @@ Copyright (C) 2001 Free Software Foundation - Author: Philippe C.D. Robert + Author: Philippe C.D. Robert This file is part of GNUstep. @@ -29,16 +29,12 @@ #include #include "PCAppController.h" -#if defined(GNUSTEP) -#include -#endif - @implementation PCMenuController - (id)init { if ((self = [super init])) - { + { NSRect fr = NSMakeRect(20,30,160,20); [[NSNotificationCenter defaultCenter] addObserver:self @@ -67,7 +63,7 @@ NSViewMinXMargin | NSViewMaxXMargin]; RELEASE(projectTypePopup); - } + } return self; } @@ -99,19 +95,22 @@ - (void)setAppController:(id)anObject { [appController autorelease]; - appController = [anObject retain]; + appController = anObject; + RETAIN(appController); } - (void)setFileManager:(id)anObject { [fileManager autorelease]; - fileManager = [anObject retain]; + fileManager = anObject; + RETAIN(fileManager); } - (void)setProjectManager:(id)anObject { [projectManager autorelease]; - projectManager = [anObject retain]; + projectManager = anObject; + RETAIN(projectManager); } //============================================================================ @@ -241,7 +240,7 @@ NSArray *files = [[proj browserController] selectedFiles]; if ((fileName = [[proj browserController] nameOfSelectedFile])) - { + { int ret; ret = NSRunAlertPanel(@"Remove File!", @@ -252,12 +251,12 @@ files, [proj projectName]); if (ret == NSAlertAlternateReturn || ret == NSAlertOtherReturn) - { + { BOOL flag = (ret == NSAlertOtherReturn) ? YES : NO; [projectManager removeFilesPermanently:flag]; - } - } + } + } } - (void)projectRevertToSaved:(id)sender @@ -318,16 +317,16 @@ filePath = [[openPanel filenames] objectAtIndex:0]; if (![fm fileExistsAtPath:filePath isDirectory:&isDir] && !isDir) - { + { NSRunAlertPanel(@"Attention!", @"Couldn't open %@!", @"OK",nil,nil,filePath); - } + } else - { + { [PCEditorController openFileInEditor:filePath]; - } - } + } + } } - (void)fileNew:(id)sender @@ -624,3 +623,4 @@ } @end + diff --git a/PCPrefController+UInterface.h b/PCPrefController+UInterface.h new file mode 100644 index 0000000..c72238c --- /dev/null +++ b/PCPrefController+UInterface.h @@ -0,0 +1,39 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2003 Free Software Foundation + + Author: Philippe C.D. Robert + + 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. + + $Id$ +*/ + +#ifndef __PCPREFCONTROLLER_UINTERFACE_H +#define __PCPREFCONTROLLER_UINTERFACE_H + +#include "PCPrefController.h" + +@interface PCPrefController (UInterface) + +- (void)_initUI; + +@end + +#endif + diff --git a/PCPrefController+UInterface.m b/PCPrefController+UInterface.m new file mode 100644 index 0000000..bfa7761 --- /dev/null +++ b/PCPrefController+UInterface.m @@ -0,0 +1,444 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2003 Free Software Foundation + + Author: Philippe C.D. Robert + + 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. + + $Id$ +*/ + +#include "PCPrefController.h" +#include "PCPrefController+UInterface.h" + +@implementation PCPrefController (UInterface) + +- (void)_initUI +{ + NSView *_c_view; + unsigned int style = NSTitledWindowMask | NSClosableWindowMask; + NSRect _w_frame; + NSBox *line; + NSBox *v; + NSTextField *textField; + NSButtonCell *cell; + + /* + * Pref Window + * + */ + + _w_frame = NSMakeRect(200,300,270,365); + prefWindow = [[NSWindow alloc] initWithContentRect:_w_frame + styleMask:style + backing:NSBackingStoreBuffered + defer:YES]; + [prefWindow setMinSize: NSMakeSize (270,365)]; + [prefWindow setTitle: @"Preferences"]; + [prefWindow setDelegate: self]; + [prefWindow setReleasedWhenClosed: NO]; + [prefWindow center]; + [prefWindow setFrameAutosaveName: @"Preferences"]; + _c_view = [prefWindow contentView]; + + prefPopup = [[NSPopUpButton alloc] initWithFrame: NSMakeRect (72,334,120,21)]; + [prefPopup addItemWithTitle: @"None"]; + [prefPopup setTarget: self]; + [prefPopup setAction: @selector (popupChanged:)]; + [_c_view addSubview: prefPopup]; + RELEASE(prefPopup); + + line = [[NSBox alloc] init]; + [line setTitlePosition: NSNoTitle]; + [line setFrameFromContentFrame: NSMakeRect(0,312,270,2)]; + [_c_view addSubview:line]; + RELEASE(line); + + prefEmptyView = [[NSBox alloc] init]; + [prefEmptyView setTitlePosition: NSNoTitle]; + [prefEmptyView setFrameFromContentFrame: NSMakeRect(0,0,270,312)]; + [prefEmptyView setBorderType: NSNoBorder]; + [_c_view addSubview: prefEmptyView]; + RELEASE(prefEmptyView); + + /* + * Building view + * + */ + prefBuildingView = [[NSBox alloc] initWithFrame: NSMakeRect(0,0,270,310)]; + [prefBuildingView setTitlePosition:NSNoTitle]; + [prefBuildingView setBorderType:NSNoBorder]; + + v = [[NSBox alloc] initWithFrame: NSMakeRect(5,208,254,102)]; + [v setTitle: @"Sounds"]; + [prefBuildingView addSubview: v]; + RELEASE(v); + + textField = [[NSTextField alloc] initWithFrame: NSMakeRect(0,40,54,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue: @"Success:"]; + [v addSubview:textField]; + RELEASE(textField); + + successField = [[NSTextField alloc] initWithFrame:NSMakeRect(58,40,144,21)]; + [successField setAlignment: NSLeftTextAlignment]; + [successField setBordered: NO]; + [successField setEditable: YES]; + [successField setBezeled: YES]; + [successField setDrawsBackground: YES]; + [successField setTarget: self]; + [successField setAction: @selector (setSuccessSound:)]; + [v addSubview: successField]; + RELEASE(successField); + + textField = [[NSTextField alloc] initWithFrame: NSMakeRect(0,16,54,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue: @"Failure:"]; + [v addSubview:textField]; + RELEASE(textField); + + failureField = [[NSTextField alloc] initWithFrame:NSMakeRect(58,16,144,21)]; + [failureField setAlignment: NSLeftTextAlignment]; + [failureField setBordered: NO]; + [failureField setEditable: YES]; + [failureField setBezeled: YES]; + [failureField setDrawsBackground: YES]; + [failureField setTarget: self]; + [failureField setAction: @selector (setFailureSound:)]; + [v addSubview: failureField]; + RELEASE(failureField); + + promptOnClean = [[NSButton alloc] initWithFrame: NSMakeRect(72,170,108,21)]; + [promptOnClean setTitle: @"Prompt on clean"]; + [promptOnClean setButtonType: NSSwitchButton]; + [promptOnClean setBordered: NO]; + [promptOnClean setRefusesFirstResponder: YES]; + [promptOnClean setTarget: self]; + [promptOnClean setAction: @selector (setPromptOnClean:)]; + [promptOnClean setContinuous: NO]; + [prefBuildingView addSubview: promptOnClean]; + [promptOnClean sizeToFit]; + RELEASE(promptOnClean); + + /* + * Saving view + */ + prefSavingView = [[NSBox alloc] initWithFrame: NSMakeRect (0,0,270,310)]; + [prefSavingView setTitlePosition: NSNoTitle]; + [prefSavingView setBorderType: NSNoBorder]; + + v = [[NSBox alloc] initWithFrame: NSMakeRect (5,208,254,102)]; + [v setTitle: @"Saving"]; + [prefSavingView addSubview: v]; + RELEASE(v); + + saveOnQuit=[[NSButton alloc] initWithFrame: NSMakeRect (24,52,124,15)]; + [saveOnQuit setTitle: @"Save Projects Upon Quit"]; + [saveOnQuit setButtonType: NSSwitchButton]; + [saveOnQuit setBordered: NO]; + [saveOnQuit setTarget: self]; + [saveOnQuit setAction: @selector (setSaveOnQuit:)]; + [saveOnQuit setContinuous: NO]; + [v addSubview: saveOnQuit]; + [saveOnQuit sizeToFit]; + RELEASE(saveOnQuit); + + saveAutomatically=[[NSButton alloc] initWithFrame: NSMakeRect (24,32,124,15)]; + [saveAutomatically setTitle: @"Save Project Automatically"]; + [saveAutomatically setButtonType: NSSwitchButton]; + [saveAutomatically setBordered :NO]; + [saveAutomatically setTarget: self]; + [saveAutomatically setAction: @selector (setSaveAutomatically:)]; + [saveAutomatically setContinuous: NO]; + [v addSubview: saveAutomatically]; + [saveAutomatically sizeToFit]; + RELEASE(saveAutomatically); + + keepBackup = [[NSButton alloc] initWithFrame: NSMakeRect (24,12,124,15)]; + [keepBackup setTitle: @"Keep Project Backup"]; + [keepBackup setButtonType: NSSwitchButton]; + [keepBackup setBordered: NO]; + [keepBackup setTarget: self]; + [keepBackup setAction: @selector (setKeepBackup:)]; + [keepBackup setContinuous: NO]; + [v addSubview: keepBackup]; + [keepBackup sizeToFit]; + RELEASE(keepBackup); + + v = [[NSBox alloc] initWithFrame: NSMakeRect(5,149,254,49)]; + [v setTitle: @"Auto-Save"]; + [prefSavingView addSubview: v]; + RELEASE(v); + + textField = [[NSTextField alloc] initWithFrame: NSMakeRect(12,0,54,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue: @"Seconds:"]; + [v addSubview: textField]; + RELEASE(textField); + + autoSaveField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,0,144,21)]; + [autoSaveField setAlignment: NSLeftTextAlignment]; + [autoSaveField setBordered: NO]; + [autoSaveField setEditable: YES]; + [autoSaveField setBezeled: YES]; + [autoSaveField setDrawsBackground: YES]; + [autoSaveField setTarget:self]; + [autoSaveField setAction:@selector(setSavePeriod:)]; + [v addSubview:autoSaveField]; + RELEASE(autoSaveField); + + /* + * Editing view + */ + prefEditingView = [[NSBox alloc] initWithFrame: NSMakeRect (0,0,270,310)]; + [prefEditingView setTitlePosition: NSNoTitle]; + [prefEditingView setBorderType: NSNoBorder]; + + v = [[NSBox alloc] initWithFrame: NSMakeRect(5,208,254,102)]; + [v setTitle:@"Tab Control"]; + [prefEditingView addSubview:v]; + RELEASE(v); + + cell = [[NSButtonCell alloc] init]; + [cell setButtonType: NSRadioButton]; + [cell setBordered: NO]; + [cell setImagePosition: NSImageLeft]; + + tabMatrix = [[NSMatrix alloc] initWithFrame: NSMakeRect(32,16,164,40) + mode: NSRadioModeMatrix + prototype: cell + numberOfRows: 2 + numberOfColumns: 2]; + + [tabMatrix setIntercellSpacing: NSMakeSize (8, 8) ]; + [tabMatrix setTarget: self]; + [tabMatrix setAction: @selector (setTabBehaviour:)]; + [tabMatrix setAutosizesCells: NO]; + + cell = [tabMatrix cellAtRow: 0 column: 0]; + [cell setTitle: @"Tabulator"]; + [cell setTag: 0]; + + cell = [tabMatrix cellAtRow: 1 column: 0]; + [cell setTitle: @"2 Spaces"]; + [cell setTag: 1]; + + cell = [tabMatrix cellAtRow: 0 column: 1]; + [cell setTitle: @"4 Spaces"]; + [cell setTag: 2]; + + cell = [tabMatrix cellAtRow: 1 column: 1]; + [cell setTitle: @"8 Spaces"]; + [cell setTag: 3]; + + [v addSubview:tabMatrix]; + RELEASE(tabMatrix); + + [tabMatrix selectCellAtRow: 0 column: 1]; + + + /* + * Misc view + * + */ + prefMiscView = [[NSBox alloc] init]; + [prefMiscView setTitlePosition:NSNoTitle]; + [prefMiscView setFrameFromContentFrame:NSMakeRect(1,1,260,308)]; + [prefMiscView setBorderType:NSNoBorder]; + + v = [[NSBox alloc] initWithFrame: NSMakeRect(5,189,254,121)]; + [v setTitle:@"External Tools"]; + [prefMiscView addSubview:v]; + RELEASE(v); + + // Editor + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,16,60,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue:@"Editor:"]; + [v addSubview:textField]; + RELEASE(textField); + + editorField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,16,144,21)]; + [editorField setAlignment: NSLeftTextAlignment]; + [editorField setBordered: NO]; + [editorField setEditable: YES]; + [editorField setBezeled: YES]; + [editorField setDrawsBackground: YES]; + [editorField setTarget:self]; + [editorField setAction:@selector(setEditor:)]; + [v addSubview:editorField]; + RELEASE(editorField); + + // Compiler + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,40,60,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue:@"Compiler:"]; + [v addSubview:textField]; + RELEASE(textField); + + compilerField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,40,144,21)]; + [compilerField setAlignment: NSLeftTextAlignment]; + [compilerField setBordered: NO]; + [compilerField setEditable: YES]; + [compilerField setBezeled: YES]; + [compilerField setDrawsBackground: YES]; + [compilerField setTarget:self]; + [compilerField setAction:@selector(setCompiler:)]; + [v addSubview:compilerField]; + RELEASE(compilerField); + + // Debugger + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,64,60,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue:@"Debugger:"]; + [v addSubview:textField]; + RELEASE(textField); + + debuggerField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,64,144,21)]; + [debuggerField setAlignment: NSLeftTextAlignment]; + [debuggerField setBordered: NO]; + [debuggerField setEditable: YES]; + [debuggerField setBezeled: YES]; + [debuggerField setDrawsBackground: YES]; + [debuggerField setTarget:self]; + [debuggerField setAction:@selector(setDebugger:)]; + [v addSubview:debuggerField]; + RELEASE(debuggerField); + + // Bundles Box + v = [[NSBox alloc] initWithFrame: NSMakeRect(5,131,254,48)]; + [v setTitle: @"Bundle Path"]; + [prefMiscView addSubview: v]; + RELEASE(v); + + // Bundle path + bundlePathField=[[NSTextField alloc] initWithFrame:NSMakeRect(12,0,212,21)]; + [bundlePathField setAlignment: NSLeftTextAlignment]; + [bundlePathField setBordered: NO]; + [bundlePathField setEditable: YES]; + [bundlePathField setBezeled: YES]; + [bundlePathField setDrawsBackground: YES]; + [bundlePathField setTarget:self]; + [bundlePathField setAction:@selector(setBundlePath:)]; + [v addSubview:bundlePathField]; + RELEASE(bundlePathField); + + /* + * Interface view + */ + + prefInterfaceView = [[NSBox alloc] initWithFrame: NSMakeRect (0,0,270,310)]; + [prefInterfaceView setTitlePosition: NSNoTitle]; + [prefInterfaceView setBorderType: NSNoBorder]; + + v = [[NSBox alloc] initWithFrame: NSMakeRect (5,208,254,102)]; + [v setTitle: @"Display as separate panel..."]; + [prefInterfaceView addSubview: v]; + RELEASE(v); + + separateBuilder = [[NSButton alloc] initWithFrame: NSMakeRect (48,48,124,21)]; + [separateBuilder setTitle: @"Project Builder"]; + [separateBuilder setButtonType: NSSwitchButton]; + [separateBuilder setBordered: NO]; + [separateBuilder setRefusesFirstResponder: YES]; + [separateBuilder setTarget: self]; + [separateBuilder setAction: @selector (setDisplayPanels:)]; + [separateBuilder setContinuous: NO]; + [v addSubview: separateBuilder]; + RELEASE(separateBuilder); + + separateLauncher = [[NSButton alloc] initWithFrame: NSMakeRect(48,27,124,21)]; + [separateLauncher setTitle: @"Project Launcher"]; + [separateLauncher setButtonType: NSSwitchButton]; + [separateLauncher setBordered: NO]; + [separateLauncher setRefusesFirstResponder: YES]; + [separateLauncher setTarget: self]; + [separateLauncher setAction: @selector (setDisplayPanels:)]; + [separateLauncher setContinuous: NO]; + [v addSubview: separateLauncher]; + RELEASE(separateLauncher); + + separateEditor = [[NSButton alloc] initWithFrame: NSMakeRect(48,6,124,21)]; + [separateEditor setTitle: @"Project Editor"]; + [separateEditor setButtonType: NSSwitchButton]; + [separateEditor setBordered: NO]; + [separateEditor setRefusesFirstResponder: YES]; + [separateEditor setTarget: self]; + [separateEditor setAction: @selector (setDisplayPanels:)]; + [separateEditor setContinuous: NO]; + [v addSubview: separateEditor]; + RELEASE(separateEditor); + + // Some buttons + v = [[NSBox alloc] initWithFrame: NSMakeRect(5,121,254,77)]; + [v setTitle: @"Misc"]; + [prefInterfaceView addSubview: v]; + RELEASE(v); + + promptWhenQuit = [[NSButton alloc] initWithFrame: NSMakeRect(48,7,204,21)]; + [promptWhenQuit setTitle: @"Prompt when quitting"]; + [promptWhenQuit setButtonType: NSSwitchButton]; + [promptWhenQuit setBordered: NO]; + [promptWhenQuit setRefusesFirstResponder: YES]; + [promptWhenQuit setTarget: self]; + [promptWhenQuit setAction: @selector (promptWhenQuitting:)]; + [promptWhenQuit setContinuous: NO]; + [v addSubview: promptWhenQuit]; + [promptWhenQuit sizeToFit]; + RELEASE(promptWhenQuit); + + useExternalEditor = [[NSButton alloc] initWithFrame:NSMakeRect(48,28,204,21)]; + [useExternalEditor setTitle: @"Use external Editor"]; + [useExternalEditor setButtonType: NSSwitchButton]; + [useExternalEditor setBordered: NO]; + [useExternalEditor setRefusesFirstResponder: YES]; + [useExternalEditor setTarget: self]; + [useExternalEditor setAction: @selector(setUseExternalEditor:)]; + [useExternalEditor setContinuous: NO]; + [v addSubview: useExternalEditor]; + [useExternalEditor sizeToFit]; + RELEASE(useExternalEditor); +} + +@end + diff --git a/PCPrefController.h b/PCPrefController.h index b43f464..e7ad3de 100644 --- a/PCPrefController.h +++ b/PCPrefController.h @@ -3,7 +3,7 @@ Copyright (C) 2001 Free Software Foundation - Author: Philippe C.D. Robert + Author: Philippe C.D. Robert This file is part of GNUstep. @@ -101,3 +101,4 @@ extern NSString *SavePeriodDidChangeNotification; #endif + diff --git a/PCPrefController.m b/PCPrefController.m index 96da23a..fafe7e1 100644 --- a/PCPrefController.m +++ b/PCPrefController.m @@ -3,7 +3,7 @@ Copyright (C) 2001 Free Software Foundation - Author: Philippe C.D. Robert + Author: Philippe C.D. Robert This file is part of GNUstep. @@ -25,435 +25,11 @@ */ #include "PCPrefController.h" +#include "PCPrefController+UInterface.h" #include -#if defined(GNUSTEP) -#include -#endif - NSString *SavePeriodDidChangeNotification = @"SavePeriodDidChangeNotification"; -@interface PCPrefController (CreateUI) - -- (void)_initUI; - -@end - -@implementation PCPrefController (CreateUI) - -- (void)_initUI -{ - NSView *_c_view; - unsigned int style = NSTitledWindowMask | NSClosableWindowMask; - NSRect _w_frame; - NSBox *line; - NSBox *v; - NSTextField *textField; - NSButtonCell *cell; - - /* - * Pref Window - * - */ - - _w_frame = NSMakeRect(200,300,270,365); - prefWindow = [[NSWindow alloc] initWithContentRect:_w_frame - styleMask:style - backing:NSBackingStoreBuffered - defer:YES]; - [prefWindow setMinSize: NSMakeSize (270,365)]; - [prefWindow setTitle: @"Preferences"]; - [prefWindow setDelegate: self]; - [prefWindow setReleasedWhenClosed: NO]; - [prefWindow center]; - [prefWindow setFrameAutosaveName: @"Preferences"]; - _c_view = [prefWindow contentView]; - - prefPopup = [[NSPopUpButton alloc] initWithFrame: NSMakeRect (72,334,120,21)]; - [prefPopup addItemWithTitle: @"None"]; - [prefPopup setTarget: self]; - [prefPopup setAction: @selector (popupChanged:)]; - [_c_view addSubview: prefPopup]; - RELEASE(prefPopup); - - line = [[NSBox alloc] init]; - [line setTitlePosition: NSNoTitle]; - [line setFrameFromContentFrame: NSMakeRect(0,312,270,2)]; - [_c_view addSubview:line]; - RELEASE(line); - - prefEmptyView = [[NSBox alloc] init]; - [prefEmptyView setTitlePosition: NSNoTitle]; - [prefEmptyView setFrameFromContentFrame: NSMakeRect(0,0,270,312)]; - [prefEmptyView setBorderType: NSNoBorder]; - [_c_view addSubview: prefEmptyView]; - RELEASE(prefEmptyView); - - /* - * Building view - * - */ - prefBuildingView = [[NSBox alloc] initWithFrame: NSMakeRect(0,0,270,310)]; - [prefBuildingView setTitlePosition:NSNoTitle]; - [prefBuildingView setBorderType:NSNoBorder]; - - v = [[NSBox alloc] initWithFrame: NSMakeRect(5,208,254,102)]; - [v setTitle: @"Sounds"]; - [prefBuildingView addSubview: v]; - RELEASE(v); - - textField = [[NSTextField alloc] initWithFrame: NSMakeRect(0,40,54,21)]; - [textField setAlignment: NSRightTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: NO]; - [textField setBezeled: NO]; - [textField setDrawsBackground: NO]; - [textField setStringValue: @"Success:"]; - [v addSubview:textField]; - RELEASE(textField); - - successField = [[NSTextField alloc] initWithFrame:NSMakeRect(58,40,144,21)]; - [successField setAlignment: NSLeftTextAlignment]; - [successField setBordered: NO]; - [successField setEditable: YES]; - [successField setBezeled: YES]; - [successField setDrawsBackground: YES]; - [successField setTarget: self]; - [successField setAction: @selector (setSuccessSound:)]; - [v addSubview: successField]; - RELEASE(successField); - - textField = [[NSTextField alloc] initWithFrame: NSMakeRect(0,16,54,21)]; - [textField setAlignment: NSRightTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: NO]; - [textField setBezeled: NO]; - [textField setDrawsBackground: NO]; - [textField setStringValue: @"Failure:"]; - [v addSubview:textField]; - RELEASE(textField); - - failureField = [[NSTextField alloc] initWithFrame:NSMakeRect(58,16,144,21)]; - [failureField setAlignment: NSLeftTextAlignment]; - [failureField setBordered: NO]; - [failureField setEditable: YES]; - [failureField setBezeled: YES]; - [failureField setDrawsBackground: YES]; - [failureField setTarget: self]; - [failureField setAction: @selector (setFailureSound:)]; - [v addSubview: failureField]; - RELEASE(failureField); - - promptOnClean = [[NSButton alloc] initWithFrame: NSMakeRect(72,170,108,21)]; - [promptOnClean setTitle: @"Prompt on clean"]; - [promptOnClean setButtonType: NSSwitchButton]; - [promptOnClean setBordered: NO]; - [promptOnClean setRefusesFirstResponder: YES]; - [promptOnClean setTarget: self]; - [promptOnClean setAction: @selector (setPromptOnClean:)]; - [promptOnClean setContinuous: NO]; - [prefBuildingView addSubview: promptOnClean]; - [promptOnClean sizeToFit]; - RELEASE(promptOnClean); - - /* - * Saving view - */ - prefSavingView = [[NSBox alloc] initWithFrame: NSMakeRect (0,0,270,310)]; - [prefSavingView setTitlePosition: NSNoTitle]; - [prefSavingView setBorderType: NSNoBorder]; - - v = [[NSBox alloc] initWithFrame: NSMakeRect (5,208,254,102)]; - [v setTitle: @"Saving"]; - [prefSavingView addSubview: v]; - RELEASE(v); - - saveOnQuit=[[NSButton alloc] initWithFrame: NSMakeRect (24,52,124,15)]; - [saveOnQuit setTitle: @"Save Projects Upon Quit"]; - [saveOnQuit setButtonType: NSSwitchButton]; - [saveOnQuit setBordered: NO]; - [saveOnQuit setTarget: self]; - [saveOnQuit setAction: @selector (setSaveOnQuit:)]; - [saveOnQuit setContinuous: NO]; - [v addSubview: saveOnQuit]; - [saveOnQuit sizeToFit]; - RELEASE(saveOnQuit); - - saveAutomatically=[[NSButton alloc] initWithFrame: NSMakeRect (24,32,124,15)]; - [saveAutomatically setTitle: @"Save Project Automatically"]; - [saveAutomatically setButtonType: NSSwitchButton]; - [saveAutomatically setBordered :NO]; - [saveAutomatically setTarget: self]; - [saveAutomatically setAction: @selector (setSaveAutomatically:)]; - [saveAutomatically setContinuous: NO]; - [v addSubview: saveAutomatically]; - [saveAutomatically sizeToFit]; - RELEASE(saveAutomatically); - - keepBackup = [[NSButton alloc] initWithFrame: NSMakeRect (24,12,124,15)]; - [keepBackup setTitle: @"Keep Project Backup"]; - [keepBackup setButtonType: NSSwitchButton]; - [keepBackup setBordered: NO]; - [keepBackup setTarget: self]; - [keepBackup setAction: @selector (setKeepBackup:)]; - [keepBackup setContinuous: NO]; - [v addSubview: keepBackup]; - [keepBackup sizeToFit]; - RELEASE(keepBackup); - - v = [[NSBox alloc] initWithFrame: NSMakeRect(5,149,254,49)]; - [v setTitle: @"Auto-Save"]; - [prefSavingView addSubview: v]; - RELEASE(v); - - textField = [[NSTextField alloc] initWithFrame: NSMakeRect(12,0,54,21)]; - [textField setAlignment: NSRightTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: NO]; - [textField setBezeled: NO]; - [textField setDrawsBackground: NO]; - [textField setStringValue: @"Seconds:"]; - [v addSubview: textField]; - RELEASE(textField); - - autoSaveField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,0,144,21)]; - [autoSaveField setAlignment: NSLeftTextAlignment]; - [autoSaveField setBordered: NO]; - [autoSaveField setEditable: YES]; - [autoSaveField setBezeled: YES]; - [autoSaveField setDrawsBackground: YES]; - [autoSaveField setTarget:self]; - [autoSaveField setAction:@selector(setSavePeriod:)]; - [v addSubview:autoSaveField]; - RELEASE(autoSaveField); - - /* - * Editing view - */ - prefEditingView = [[NSBox alloc] initWithFrame: NSMakeRect (0,0,270,310)]; - [prefEditingView setTitlePosition: NSNoTitle]; - [prefEditingView setBorderType: NSNoBorder]; - - v = [[NSBox alloc] initWithFrame: NSMakeRect(5,208,254,102)]; - [v setTitle:@"Tab Control"]; - [prefEditingView addSubview:v]; - RELEASE(v); - - cell = [[NSButtonCell alloc] init]; - [cell setButtonType: NSRadioButton]; - [cell setBordered: NO]; - [cell setImagePosition: NSImageLeft]; - - tabMatrix = [[NSMatrix alloc] initWithFrame: NSMakeRect(32,16,164,40) - mode: NSRadioModeMatrix - prototype: cell - numberOfRows: 2 - numberOfColumns: 2]; - - [tabMatrix setIntercellSpacing: NSMakeSize (8, 8) ]; - [tabMatrix setTarget: self]; - [tabMatrix setAction: @selector (setTabBehaviour:)]; - [tabMatrix setAutosizesCells: NO]; - - cell = [tabMatrix cellAtRow: 0 column: 0]; - [cell setTitle: @"Tabulator"]; - [cell setTag: 0]; - - cell = [tabMatrix cellAtRow: 1 column: 0]; - [cell setTitle: @"2 Spaces"]; - [cell setTag: 1]; - - cell = [tabMatrix cellAtRow: 0 column: 1]; - [cell setTitle: @"4 Spaces"]; - [cell setTag: 2]; - - cell = [tabMatrix cellAtRow: 1 column: 1]; - [cell setTitle: @"8 Spaces"]; - [cell setTag: 3]; - - [v addSubview:tabMatrix]; - RELEASE(tabMatrix); - - [tabMatrix selectCellAtRow: 0 column: 1]; - - - /* - * Misc view - * - */ - prefMiscView = [[NSBox alloc] init]; - [prefMiscView setTitlePosition:NSNoTitle]; - [prefMiscView setFrameFromContentFrame:NSMakeRect(1,1,260,308)]; - [prefMiscView setBorderType:NSNoBorder]; - - v = [[NSBox alloc] initWithFrame: NSMakeRect(5,189,254,121)]; - [v setTitle:@"External Tools"]; - [prefMiscView addSubview:v]; - RELEASE(v); - - // Editor - textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,16,60,21)]; - [textField setAlignment: NSRightTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: NO]; - [textField setBezeled: NO]; - [textField setDrawsBackground: NO]; - [textField setStringValue:@"Editor:"]; - [v addSubview:textField]; - RELEASE(textField); - - editorField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,16,144,21)]; - [editorField setAlignment: NSLeftTextAlignment]; - [editorField setBordered: NO]; - [editorField setEditable: YES]; - [editorField setBezeled: YES]; - [editorField setDrawsBackground: YES]; - [editorField setTarget:self]; - [editorField setAction:@selector(setEditor:)]; - [v addSubview:editorField]; - RELEASE(editorField); - - // Compiler - textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,40,60,21)]; - [textField setAlignment: NSRightTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: NO]; - [textField setBezeled: NO]; - [textField setDrawsBackground: NO]; - [textField setStringValue:@"Compiler:"]; - [v addSubview:textField]; - RELEASE(textField); - - compilerField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,40,144,21)]; - [compilerField setAlignment: NSLeftTextAlignment]; - [compilerField setBordered: NO]; - [compilerField setEditable: YES]; - [compilerField setBezeled: YES]; - [compilerField setDrawsBackground: YES]; - [compilerField setTarget:self]; - [compilerField setAction:@selector(setCompiler:)]; - [v addSubview:compilerField]; - RELEASE(compilerField); - - // Debugger - textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,64,60,21)]; - [textField setAlignment: NSRightTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: NO]; - [textField setBezeled: NO]; - [textField setDrawsBackground: NO]; - [textField setStringValue:@"Debugger:"]; - [v addSubview:textField]; - RELEASE(textField); - - debuggerField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,64,144,21)]; - [debuggerField setAlignment: NSLeftTextAlignment]; - [debuggerField setBordered: NO]; - [debuggerField setEditable: YES]; - [debuggerField setBezeled: YES]; - [debuggerField setDrawsBackground: YES]; - [debuggerField setTarget:self]; - [debuggerField setAction:@selector(setDebugger:)]; - [v addSubview:debuggerField]; - RELEASE(debuggerField); - - // Bundles Box - v = [[NSBox alloc] initWithFrame: NSMakeRect(5,131,254,48)]; - [v setTitle: @"Bundle Path"]; - [prefMiscView addSubview: v]; - RELEASE(v); - - // Bundle path - bundlePathField=[[NSTextField alloc] initWithFrame:NSMakeRect(12,0,212,21)]; - [bundlePathField setAlignment: NSLeftTextAlignment]; - [bundlePathField setBordered: NO]; - [bundlePathField setEditable: YES]; - [bundlePathField setBezeled: YES]; - [bundlePathField setDrawsBackground: YES]; - [bundlePathField setTarget:self]; - [bundlePathField setAction:@selector(setBundlePath:)]; - [v addSubview:bundlePathField]; - RELEASE(bundlePathField); - - /* - * Interface view - */ - - prefInterfaceView = [[NSBox alloc] initWithFrame: NSMakeRect (0,0,270,310)]; - [prefInterfaceView setTitlePosition: NSNoTitle]; - [prefInterfaceView setBorderType: NSNoBorder]; - - v = [[NSBox alloc] initWithFrame: NSMakeRect (5,208,254,102)]; - [v setTitle: @"Display as separate panel..."]; - [prefInterfaceView addSubview: v]; - RELEASE(v); - - separateBuilder = [[NSButton alloc] initWithFrame: NSMakeRect (48,48,124,21)]; - [separateBuilder setTitle: @"Project Builder"]; - [separateBuilder setButtonType: NSSwitchButton]; - [separateBuilder setBordered: NO]; - [separateBuilder setRefusesFirstResponder: YES]; - [separateBuilder setTarget: self]; - [separateBuilder setAction: @selector (setDisplayPanels:)]; - [separateBuilder setContinuous: NO]; - [v addSubview: separateBuilder]; - RELEASE(separateBuilder); - - separateLauncher = [[NSButton alloc] initWithFrame: NSMakeRect(48,27,124,21)]; - [separateLauncher setTitle: @"Project Launcher"]; - [separateLauncher setButtonType: NSSwitchButton]; - [separateLauncher setBordered: NO]; - [separateLauncher setRefusesFirstResponder: YES]; - [separateLauncher setTarget: self]; - [separateLauncher setAction: @selector (setDisplayPanels:)]; - [separateLauncher setContinuous: NO]; - [v addSubview: separateLauncher]; - RELEASE(separateLauncher); - - separateEditor = [[NSButton alloc] initWithFrame: NSMakeRect(48,6,124,21)]; - [separateEditor setTitle: @"Project Editor"]; - [separateEditor setButtonType: NSSwitchButton]; - [separateEditor setBordered: NO]; - [separateEditor setRefusesFirstResponder: YES]; - [separateEditor setTarget: self]; - [separateEditor setAction: @selector (setDisplayPanels:)]; - [separateEditor setContinuous: NO]; - [v addSubview: separateEditor]; - RELEASE(separateEditor); - - // Some buttons - v = [[NSBox alloc] initWithFrame: NSMakeRect(5,121,254,77)]; - [v setTitle: @"Misc"]; - [prefInterfaceView addSubview: v]; - RELEASE(v); - - promptWhenQuit = [[NSButton alloc] initWithFrame: NSMakeRect(48,7,204,21)]; - [promptWhenQuit setTitle: @"Prompt when quitting"]; - [promptWhenQuit setButtonType: NSSwitchButton]; - [promptWhenQuit setBordered: NO]; - [promptWhenQuit setRefusesFirstResponder: YES]; - [promptWhenQuit setTarget: self]; - [promptWhenQuit setAction: @selector (promptWhenQuitting:)]; - [promptWhenQuit setContinuous: NO]; - [v addSubview: promptWhenQuit]; - [promptWhenQuit sizeToFit]; - RELEASE(promptWhenQuit); - - useExternalEditor = [[NSButton alloc] initWithFrame:NSMakeRect(48,28,204,21)]; - [useExternalEditor setTitle: @"Use external Editor"]; - [useExternalEditor setButtonType: NSSwitchButton]; - [useExternalEditor setBordered: NO]; - [useExternalEditor setRefusesFirstResponder: YES]; - [useExternalEditor setTarget: self]; - [useExternalEditor setAction: @selector(setUseExternalEditor:)]; - [useExternalEditor setContinuous: NO]; - [v addSubview: useExternalEditor]; - [useExternalEditor sizeToFit]; - RELEASE(useExternalEditor); -} - -@end - @implementation PCPrefController - (id)init @@ -518,8 +94,10 @@ NSString *SavePeriodDidChangeNotification = @"SavePeriodDidChangeNotification"; // Building [successField setStringValue: (val = [preferencesDict objectForKey: SuccessSound]) ? val : @""]; + [failureField setStringValue: (val = [preferencesDict objectForKey: FailureSound]) ? val : @""]; + [promptOnClean setState: ([[preferencesDict objectForKey: PromptOnClean] isEqualToString: @"YES"]) ? NSOnState : NSOffState];