From 1d9578185de7fb08cf1f4b1e42812e87d8e18040 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sun, 10 Mar 2013 22:54:07 +0100 Subject: [PATCH] Have device controller setup itself rather than relying on the application delegate to do it. --- Classes/EnjoyableApplicationDelegate.h | 1 - Classes/EnjoyableApplicationDelegate.m | 1 - Classes/NJDeviceController.h | 1 - Classes/NJDeviceController.m | 5 ++++ Info.plist | 2 +- Resources/English.lproj/MainMenu.xib | 36 ++++++++++++++++---------- 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Classes/EnjoyableApplicationDelegate.h b/Classes/EnjoyableApplicationDelegate.h index c4d8e3b..36374d3 100644 --- a/Classes/EnjoyableApplicationDelegate.h +++ b/Classes/EnjoyableApplicationDelegate.h @@ -16,7 +16,6 @@ IBOutlet NSWindow *window; } -@property (nonatomic, strong) IBOutlet NJDeviceController *inputController; @property (nonatomic, strong) IBOutlet NJMappingsController *mappingsController; - (IBAction)restoreToForeground:(id)sender; diff --git a/Classes/EnjoyableApplicationDelegate.m b/Classes/EnjoyableApplicationDelegate.m index 2710e3a..634f362 100644 --- a/Classes/EnjoyableApplicationDelegate.m +++ b/Classes/EnjoyableApplicationDelegate.m @@ -55,7 +55,6 @@ } - (void)applicationDidFinishLaunching:(NSNotification *)notification { - [self.inputController setup]; [window makeKeyAndOrderFront:nil]; } diff --git a/Classes/NJDeviceController.h b/Classes/NJDeviceController.h index ce05cee..e668b0f 100644 --- a/Classes/NJDeviceController.h +++ b/Classes/NJDeviceController.h @@ -24,7 +24,6 @@ @property (nonatomic, assign) NSPoint mouseLoc; @property (nonatomic, assign) BOOL translatingEvents; -- (void)setup; - (IBAction)translatingEventsChanged:(id)sender; @end diff --git a/Classes/NJDeviceController.m b/Classes/NJDeviceController.m index 8417927..5a6603c 100644 --- a/Classes/NJDeviceController.m +++ b/Classes/NJDeviceController.m @@ -26,6 +26,11 @@ if ((self = [super init])) { _devices = [[NSMutableArray alloc] initWithCapacity:16]; _continousOutputs = [[NSMutableArray alloc] initWithCapacity:32]; + [NSNotificationCenter.defaultCenter + addObserver:self + selector:@selector(setup) + name:NSApplicationDidFinishLaunchingNotification + object:nil]; } return self; } diff --git a/Info.plist b/Info.plist index e875f02..be682f8 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 97 + 106 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright diff --git a/Resources/English.lproj/MainMenu.xib b/Resources/English.lproj/MainMenu.xib index c8a38ed..2cf1266 100644 --- a/Resources/English.lproj/MainMenu.xib +++ b/Resources/English.lproj/MainMenu.xib @@ -472,7 +472,7 @@ {664, 323} - + 256 @@ -484,6 +484,7 @@ 274 {{20, 20}, {194, 283}} + _NS:22 YES @@ -522,6 +523,7 @@ aW5nLg {232, 321} + YES NO @@ -617,6 +619,7 @@ aW5nLg {{1, 1}, {232, 321}} + @@ -627,6 +630,7 @@ aW5nLg -2147483392 {{1, 1}, {8, 298}} + NO @@ -638,6 +642,7 @@ aW5nLg -2147483392 {{-100, -100}, {473, 15}} + NO 1 @@ -648,6 +653,7 @@ aW5nLg {234, 323} + 150034 @@ -661,6 +667,7 @@ aW5nLg {234, 323} + _NS:9 NSView @@ -674,6 +681,7 @@ aW5nLg 265 {{189, 117}, {224, 20}} + _NS:9 YES @@ -715,6 +723,7 @@ aW5nLg 268 {{343, 31}, {70, 18}} + _NS:9 YES @@ -745,6 +754,7 @@ aW5nLg 265 {{189, 33}, {150, 20}} + _NS:9 YES @@ -789,6 +799,7 @@ aW5nLg 265 {{191, 24}, {146, 16}} + _NS:9 YES @@ -814,6 +825,7 @@ aW5nLg 265 {{189, 70}, {224, 24}} + _NS:9 YES @@ -867,6 +879,7 @@ aW5nLg 265 {{191, 108}, {220, 16}} + _NS:9 YES @@ -892,6 +905,7 @@ aW5nLg 265 {{191, 196}, {220, 23}} + _NS:9 NJKeyInputField @@ -901,6 +915,7 @@ aW5nLg 265 {{188, 153}, {226, 26}} + YES @@ -933,6 +948,7 @@ aW5nLg 268 {{24, 20}, {163, 250}} + NO 6 @@ -1063,6 +1079,7 @@ aW5nLg 266 {{9, 286}, {369, 17}} + YES @@ -1086,6 +1103,7 @@ aW5nLg 10 {{12, 276}, {363, 5}} + {0, 0} @@ -1112,12 +1130,15 @@ aW5nLg {{233, 0}, {431, 323}} + _NS:9 NSView {664, 323} + + {{0, 0}, {1440, 878}} @@ -1625,14 +1646,6 @@ aW5nLg 915 - - - inputController - - - - 819 - mappingsController @@ -3009,7 +3022,6 @@ aW5nLg NSMenu - NJDeviceController NJMappingsController NSMenu NSMenu @@ -3020,10 +3032,6 @@ aW5nLg dockMenu NSMenu - - inputController - NJDeviceController - mappingsController NJMappingsController -- 2.30.2