2006-09-04 18:06:23 +00:00
|
|
|
//
|
|
|
|
// PreferencesController.m
|
|
|
|
// Cog
|
|
|
|
//
|
2006-09-04 18:46:18 +00:00
|
|
|
// 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"
|
2009-03-08 01:49:50 +00:00
|
|
|
#import "PreferencePluginController.h"
|
|
|
|
#import "PreferencesWindow.h"
|
2006-09-04 18:06:23 +00:00
|
|
|
|
|
|
|
@implementation PreferencesController
|
|
|
|
|
2022-06-24 07:29:50 +00:00
|
|
|
- (void)initWindow {
|
2022-02-07 05:49:27 +00:00
|
|
|
if(nil == window) {
|
|
|
|
// Determine path to the sample preference panes
|
|
|
|
NSString *pluginPath = [[NSBundle mainBundle] pathForResource:@"Preferences" ofType:@"preferencePane"];
|
|
|
|
NSBundle *bundle = [NSBundle bundleWithPath:pluginPath];
|
2009-03-08 01:49:50 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
PreferencePluginController *pluginController = [[PreferencePluginController alloc] initWithPlugins:@[bundle]];
|
2021-01-08 05:25:30 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
window = [[PreferencesWindow alloc] initWithPreferencePanes:[pluginController preferencePanes]];
|
|
|
|
}
|
2022-06-24 07:29:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)showPreferences:(id)sender {
|
|
|
|
[self initWindow];
|
2021-01-08 05:25:30 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
// Show the preferences window.
|
|
|
|
[window show];
|
2006-09-04 18:06:23 +00:00
|
|
|
}
|
|
|
|
|
2022-06-24 07:29:50 +00:00
|
|
|
- (IBAction)showPathSuggester:(id)sender {
|
|
|
|
[self initWindow];
|
|
|
|
|
|
|
|
// Show the path suggester
|
|
|
|
[window showPathSuggester];
|
|
|
|
}
|
|
|
|
|
2006-09-04 18:06:23 +00:00
|
|
|
@end
|