-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathMainMenuAppDelegate.m
48 lines (39 loc) · 1.23 KB
/
MainMenuAppDelegate.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// AvroKeyboard
//
// Created by Rifat Nabi on 6/24/12.
// Copyright (c) 2012 OmicronLab. All rights reserved.
//
#import "MainMenuAppDelegate.h"
#import "AutoCorrect.h"
#import "CacheManager.h"
#import "Database.h"
#import "RegexParser.h"
@implementation MainMenuAppDelegate
@synthesize imPref;
//this method is added so that our controllers can access the shared NSMenu.
-(NSMenu*)menu {
return _menu;
}
//add an awakeFromNib item so that we can set the action method. Note that any menuItems without an action will be disabled when
//displayed in the Text Input Menu.
-(void)awakeFromNib {
NSMenuItem* preferences = [_menu itemWithTag:1];
if (preferences) {
[preferences setAction:@selector(showPreferences:)];
}
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"IncludeDictionary"]) {
NSLog(@"Loading Dictionary...");
[Database sharedInstance];
[RegexParser sharedInstance];
[CacheManager sharedInstance];
}
[AutoCorrect sharedInstance];
}
// Currently doesn't work
- (void)applicationWillTerminate:(NSNotification *)notification {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"IncludeDictionary"]) {
[[CacheManager sharedInstance] persist];
}
}
@end