cog/Preferences/PreferencesController.m

45 lines
1.1 KiB
Matlab
Raw Normal View History

2006-09-04 18:06:23 +00:00
//
// PreferencesController.m
// Cog
//
// Created by Vincent Spader on 9/4/06.
// Copyright 2006 Vincent Spader. All rights reserved.
2006-09-04 18:06:23 +00:00
//
#import "PreferencesController.h"
#import "PreferencePluginController.h"
#import "PreferencesWindow.h"
2006-09-04 18:06:23 +00:00
@implementation PreferencesController
- (IBAction)showPreferences:(id)sender
2006-09-04 18:06:23 +00:00
{
if (nil == window) {
2006-09-04 18:06:23 +00:00
// Determine path to the sample preference panes
NSString *pluginPath = [[NSBundle mainBundle] pathForResource:@"General" ofType:@"preferencePane"];
NSBundle *bundle = [NSBundle bundleWithPath:pluginPath];
2006-09-04 18:06:23 +00:00
PreferencePluginController *pluginController = [[PreferencePluginController alloc] initWithPlugins:[NSArray arrayWithObject:bundle]];
window = [[PreferencesWindow alloc] initWithPreferencePanes:[pluginController preferencePanes]];
2006-09-04 18:06:23 +00:00
// Set which panes are included, and their order.
2006-09-10 21:27:20 +00:00
//[prefs setPanesOrder:[NSArray arrayWithObjects:@"General", @"Updating", @"A Non-Existent Preference Pane", nil]];
2009-09-02 04:14:07 +00:00
[pluginController release];
2006-09-04 18:06:23 +00:00
}
// Show the preferences window.
[window show];
2006-09-04 18:06:23 +00:00
}
- (void)dealloc
{
[window release];
2006-09-04 18:06:23 +00:00
[super dealloc];
}
@end