From 575060419129256e87f232b7c71860c34084ad2f Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 1 Jun 2003 21:29:22 +0000 Subject: [PATCH] Remove preferences files which have been replaced. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@16851 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 ++ GormPreferences.h | 47 ------------ GormPreferences.m | 181 ---------------------------------------------- 3 files changed, 5 insertions(+), 228 deletions(-) delete mode 100644 GormPreferences.h delete mode 100644 GormPreferences.m diff --git a/ChangeLog b/ChangeLog index aa093065..33bf9337 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-06-01 Gregory John Casamento + + * GormPreferences.[hm]: Removed. These were superceded + by the GormPrefController. + 2003-06-01 Gregory John Casamento * GormTabViewInspector.gorm: Added new images to complete the diff --git a/GormPreferences.h b/GormPreferences.h deleted file mode 100644 index da66582f..00000000 --- a/GormPreferences.h +++ /dev/null @@ -1,47 +0,0 @@ -/* GormPreferences.h - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * Author: Gregory John Casamento - * Date: 2003 - * - * This file is part of GNUstep. - * - * This program 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 program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef INCLUDED_GormPreferences_h -#define INCLUDED_GormPreferences_h - -#include - -@interface GormPreferences : NSObject -{ - id box; - id window; - - // values - id preloadHeaders; - id showPalettes; - id showInspectors; - id browser; - - // data for delegate... - NSMutableArray *headers; -} -- (void) setGeneralPreferences: (id)sender; -- (id) window; -@end - -#endif diff --git a/GormPreferences.m b/GormPreferences.m deleted file mode 100644 index 15a8a605..00000000 --- a/GormPreferences.m +++ /dev/null @@ -1,181 +0,0 @@ -/* GormPreferences.m - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * Author: Gregory John Casamento - * Date: 2003 - * - * This file is part of GNUstep. - * - * This program 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 program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include "GormPreferences.h" - -@implementation GormPreferences - -- (id) init -{ - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - int state = NSOffState; - - // load the interface... - if(![NSBundle loadNibNamed: @"GormPreferences" owner: self]) - { - NSLog(@"Failed to load interface"); - exit(-1); - } - - // set the buttons to the proper states... - state = [defaults boolForKey: @"PreloadHeaders"]?NSOnState:NSOffState; - [preloadHeaders setState: state]; - state = [defaults boolForKey: @"ShowPalettes"]?NSOnState:NSOffState; - [showPalettes setState: state]; - state = [defaults boolForKey: @"ShowInspectors"]?NSOnState:NSOffState; - [showInspectors setState: state]; - - // get the preloaded headers list... - headers = [NSMutableArray arrayWithArray: [defaults arrayForKey: @"HeaderList"]]; - RETAIN(headers); - - // return - return self; -} - -- (void) awakeFromNib -{ - [browser setTarget: self]; - [browser setAction: @selector(selectHeader:)]; -} - -- (void) setGeneralPreferences: (id)sender -{ - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - - [defaults setBool: ([preloadHeaders state] == NSOnState) - forKey: @"PreloadHeaders"]; - [defaults setBool: ([showPalettes state] == NSOnState) - forKey: @"ShowPalettes"]; - [defaults setBool: ([showInspectors state] == NSOnState) - forKey: @"ShowInspectors"]; - - // get the preloaded headers list... - [defaults setObject: headers forKey: @"HeaderList"]; -} - -- (void) addHeader: (id)sender -{ - NSArray *fileTypes = [NSArray arrayWithObjects: @"h", @"H", nil]; - NSOpenPanel *oPanel = [NSOpenPanel openPanel]; - int result; - - [oPanel setAllowsMultipleSelection: YES]; - [oPanel setCanChooseFiles: YES]; - [oPanel setCanChooseDirectories: NO]; - result = [oPanel runModalForDirectory: nil - file: nil - types: fileTypes]; - if (result == NSOKButton) - { - [headers addObjectsFromArray: [oPanel filenames]]; - [browser reloadColumn: 0]; - } -} - -- (void) removeHeader: (id)sender -{ - NSCell *cell = [browser selectedCellInColumn: 0]; - - if(cell != nil) - { - NSString *stringValue = [NSString stringWithString: [cell stringValue]]; - [headers removeObject: stringValue]; - [browser reloadColumn: 0]; - NSLog(@"Header removed"); - } -} - -- (void) selectHeader: (id)sender -{ - NSLog(@"Selected header"); -} - -- (id) window -{ - return window; -} -@end - -// delegate -@interface GormPreferences(BrowserDelegate) -- (BOOL) browser: (NSBrowser*)sender selectRow: (int)row inColumn: (int)column; - -- (void) browser: (NSBrowser *)sender createRowsForColumn: (int)column - inMatrix: (NSMatrix *)matrix; - -- (NSString*) browser: (NSBrowser*)sender titleOfColumn: (int)column; - -- (void) browser: (NSBrowser *)sender - willDisplayCell: (id)cell - atRow: (int)row - column: (int)column; - -- (BOOL) browser: (NSBrowser *)sender isColumnValid: (int)column; -@end - -@implementation GormPreferences(BrowserDelegate) -- (BOOL) browser: (NSBrowser*)sender selectRow: (int)row inColumn: (int)column -{ - return YES; -} - -- (void) browser: (NSBrowser *)sender createRowsForColumn: (int)column - inMatrix: (NSMatrix *)matrix -{ - NSEnumerator *e = [headers objectEnumerator]; - NSString *header = nil; - NSBrowserCell *cell = nil; - int i = 0; - - while((header = [e nextObject]) != nil) - { - [matrix insertRow: i withCells: nil]; - cell = [matrix cellAtRow: i column: 0]; - [cell setLeaf: YES]; - i++; - [cell setStringValue: header]; - } -} - -- (NSString*) browser: (NSBrowser*)sender titleOfColumn: (int)column -{ - return @"Preloaded Headers"; -} - -- (void) browser: (NSBrowser *)sender - willDisplayCell: (id)cell - atRow: (int)row - column: (int)column -{ -} - -- (BOOL) browser: (NSBrowser *)sender isColumnValid: (int)column -{ - return NO; -} -@end -