Added preferences patch from alex rauchfuss

CQTexperiment
vspader 2007-07-05 01:16:25 +00:00
parent fbd7368b3c
commit 2f3b3c880c
1 changed files with 10 additions and 2 deletions

View File

@ -61,7 +61,8 @@
// Designated initializer
- (id)initWithPanesSearchPath:(NSString*)path bundleExtension:(NSString *)ext
{
if (self = [super init]) {
if (self = [super init])
{
[self setDebug:NO];
preferencePanes = [[NSMutableDictionary alloc] init];
panesOrder = [[NSMutableArray alloc] init];
@ -166,7 +167,7 @@
[prefsWindow setReleasedWhenClosed:NO];
[prefsWindow setTitle:@"Preferences"]; // initial default title
[prefsWindow setShowsToolbarButton: NO];
[prefsWindow center];
[self createPrefsToolbar];
@ -427,6 +428,7 @@ float ToolbarHeightForWindow(NSWindow *window)
} else if (!alwaysShowsToolbar && prefsToolbarItems && ([prefsToolbarItems count] == 1)) {
[self debugLog:@"Not showing toolbar in Preferences window because there is only one preference pane loaded. You can override this behaviour using -[setAlwaysShowsToolbar:YES]."];
}
[prefsToolbar setSelectedItemIdentifier: [panesOrder objectAtIndex: 0]];
}
@ -470,6 +472,12 @@ float ToolbarHeightForWindow(NSWindow *window)
}
- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
{
return panesOrder;
}
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar
{
return panesOrder;