Cog/Preferences/PreferencesController.m
Christopher Snowhill 80adb85b36 [Path Suggester] Automatically pop where required
The Path Suggester will now automatically open when new files are added
to the playlist and a given path is not in the sandbox settings. It will
also pop for both the File Tree and MIDI SoundFont path configuration
settings being changed.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-24 00:29:50 -07:00

41 lines
1,007 B
Objective-C

//
// PreferencesController.m
// Cog
//
// Created by Vincent Spader on 9/4/06.
// Copyright 2006 Vincent Spader. All rights reserved.
//
#import "PreferencesController.h"
#import "PreferencePluginController.h"
#import "PreferencesWindow.h"
@implementation PreferencesController
- (void)initWindow {
if(nil == window) {
// Determine path to the sample preference panes
NSString *pluginPath = [[NSBundle mainBundle] pathForResource:@"Preferences" ofType:@"preferencePane"];
NSBundle *bundle = [NSBundle bundleWithPath:pluginPath];
PreferencePluginController *pluginController = [[PreferencePluginController alloc] initWithPlugins:@[bundle]];
window = [[PreferencesWindow alloc] initWithPreferencePanes:[pluginController preferencePanes]];
}
}
- (IBAction)showPreferences:(id)sender {
[self initWindow];
// Show the preferences window.
[window show];
}
- (IBAction)showPathSuggester:(id)sender {
[self initWindow];
// Show the path suggester
[window showPathSuggester];
}
@end