ample/Ample/AppDelegate.m

69 lines
1.4 KiB
Mathematica
Raw Normal View History

2020-08-16 16:53:17 +00:00
//
// AppDelegate.m
2020-08-30 03:24:49 +00:00
// Ample
2020-08-16 16:53:17 +00:00
//
// Created by Kelvin Sherlock on 8/16/2020.
// Copyright © 2020 Kelvin Sherlock. All rights reserved.
//
#import "AppDelegate.h"
2020-08-20 00:26:44 +00:00
#import "SlotViewController.h"
2020-08-21 22:38:02 +00:00
#import "MediaViewController.h"
#import "LaunchWindowController.h"
#import "PreferencesWindowController.h"
2020-08-16 20:23:51 +00:00
2020-08-16 16:53:17 +00:00
@interface AppDelegate ()
@end
2020-08-29 18:40:34 +00:00
@implementation AppDelegate {
NSWindowController *_prefs;
NSWindowController *_launcher;
2020-08-29 18:40:34 +00:00
}
2020-08-16 16:53:17 +00:00
2020-08-16 20:23:51 +00:00
2020-08-16 16:53:17 +00:00
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
2020-08-16 20:23:51 +00:00
2020-08-29 18:40:34 +00:00
NSBundle *bundle = [NSBundle mainBundle];
NSString *path;
NSDictionary *dict;
path = [bundle pathForResource: @"Defaults" ofType: @"plist"];
dict = [NSDictionary dictionaryWithContentsOfFile: path];
if (dict)
{
[[NSUserDefaults standardUserDefaults] registerDefaults: dict];
}
_launcher = [LaunchWindowController new];
[_launcher showWindow: nil];
2020-08-16 16:53:17 +00:00
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
}
2020-08-17 01:22:45 +00:00
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
return YES;
}
2020-08-16 16:53:17 +00:00
2020-08-16 20:23:51 +00:00
2020-08-26 03:22:08 +00:00
#pragma mark - IBActions
2020-08-29 18:40:34 +00:00
- (IBAction)displayPreferences:(id)sender {
if (!_prefs) {
_prefs = [PreferencesWindowController new];
2020-08-29 18:40:34 +00:00
}
[_prefs showWindow: sender];
}
2020-08-16 20:23:51 +00:00
2020-08-20 00:26:44 +00:00
2020-08-16 16:53:17 +00:00
@end