Have device controller setup itself rather than relying on the application delegate...
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 10 Mar 2013 21:54:07 +0000 (22:54 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 10 Mar 2013 21:54:07 +0000 (22:54 +0100)
Classes/EnjoyableApplicationDelegate.h
Classes/EnjoyableApplicationDelegate.m
Classes/NJDeviceController.h
Classes/NJDeviceController.m
Info.plist
Resources/English.lproj/MainMenu.xib

index c4d8e3b47953dc8eb5397553704ee174f950402e..36374d301c887102fd431d397c5deece6f81a43d 100644 (file)
@@ -16,7 +16,6 @@
     IBOutlet NSWindow *window;
 }
 
-@property (nonatomic, strong) IBOutlet NJDeviceController *inputController;
 @property (nonatomic, strong) IBOutlet NJMappingsController *mappingsController;
 
 - (IBAction)restoreToForeground:(id)sender;
index 2710e3ad209578a89aa85bf9ea22f3876e062472..634f3621ab9ce5f4eaeb02d65d6534971dbb5f24 100644 (file)
@@ -55,7 +55,6 @@
 }
 
 - (void)applicationDidFinishLaunching:(NSNotification *)notification {
-    [self.inputController setup];
     [window makeKeyAndOrderFront:nil];
 }
 
index ce05cee96f12b2565efdcc376965726b45ace260..e668b0f6167b1e30ca9cc075c44913dc1366f1ff 100644 (file)
@@ -24,7 +24,6 @@
 @property (nonatomic, assign) NSPoint mouseLoc;
 @property (nonatomic, assign) BOOL translatingEvents;
 
-- (void)setup;
 - (IBAction)translatingEventsChanged:(id)sender;
 
 @end
index 8417927dbb5ddb029c7a530150d842bef13ebd2c..5a6603c9bac55f5ffc92572e41971d2232d290c8 100644 (file)
     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;
 }
index e875f02020d5a1ea772f0e3c2457a7dc9fd1800d..be682f8c3f4afd8b9fb0a4fec935ae8d84243c68 100644 (file)
@@ -46,7 +46,7 @@
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>97</string>
+       <string>106</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.utilities</string>
        <key>NSHumanReadableCopyright</key>
index c8a38ed1f29943168c1cfb658fb95a46b9c02221..2cf1266acc3d7fdf4c5709b2f4602f96bfba8406 100644 (file)
                                <nil key="NSUserInterfaceItemIdentifier"/>
                                <string key="NSWindowContentMinSize">{664, 323}</string>
                                <object class="NSView" key="NSWindowView" id="177223957">
-                                       <nil key="NSNextResponder"/>
+                                       <reference key="NSNextResponder"/>
                                        <int key="NSvFlags">256</int>
                                        <array class="NSMutableArray" key="NSSubviews">
                                                <object class="NSCustomView" id="734312853">
                                                                        <int key="NSvFlags">274</int>
                                                                        <string key="NSFrame">{{20, 20}, {194, 283}}</string>
                                                                        <reference key="NSSuperview" ref="734312853"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="471332453"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:22</string>
                                                                        <bool key="NSEnabled">YES</bool>
@@ -522,6 +523,7 @@ aW5nLg</string>
                                                                                                        <array class="NSMutableArray" key="NSSubviews"/>
                                                                                                        <string key="NSFrameSize">{232, 321}</string>
                                                                                                        <reference key="NSSuperview" ref="698362889"/>
+                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="892486973"/>
                                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                                        <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -617,6 +619,7 @@ aW5nLg</string>
                                                                                        </array>
                                                                                        <string key="NSFrame">{{1, 1}, {232, 321}}</string>
                                                                                        <reference key="NSSuperview" ref="364857164"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="365506042"/>
                                                                                        <reference key="NSDocView" ref="365506042"/>
                                                                                        <reference key="NSBGColor" ref="834857663"/>
@@ -627,6 +630,7 @@ aW5nLg</string>
                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                        <string key="NSFrame">{{1, 1}, {8, 298}}</string>
                                                                                        <reference key="NSSuperview" ref="364857164"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="12898323"/>
                                                                                        <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
                                                                                        <reference key="NSTarget" ref="364857164"/>
@@ -638,6 +642,7 @@ aW5nLg</string>
                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                        <string key="NSFrame">{{-100, -100}, {473, 15}}</string>
                                                                                        <reference key="NSSuperview" ref="364857164"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="698362889"/>
                                                                                        <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
                                                                                        <int key="NSsFlags">1</int>
@@ -648,6 +653,7 @@ aW5nLg</string>
                                                                        </array>
                                                                        <string key="NSFrameSize">{234, 323}</string>
                                                                        <reference key="NSSuperview" ref="734312853"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="698362889"/>
                                                                        <int key="NSsFlags">150034</int>
                                                                        <reference key="NSVScroller" ref="1036252745"/>
@@ -661,6 +667,7 @@ aW5nLg</string>
                                                        </array>
                                                        <string key="NSFrameSize">{234, 323}</string>
                                                        <reference key="NSSuperview" ref="177223957"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="364857164"/>
                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                        <string key="NSClassName">NSView</string>
@@ -674,6 +681,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">265</int>
                                                                        <string key="NSFrame">{{189, 117}, {224, 20}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="385416822"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                        <bool key="NSEnabled">YES</bool>
@@ -715,6 +723,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">268</int>
                                                                        <string key="NSFrame">{{343, 31}, {70, 18}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                        <bool key="NSEnabled">YES</bool>
                                                                        <object class="NSButtonCell" key="NSCell" id="868379451">
@@ -745,6 +754,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">265</int>
                                                                        <string key="NSFrame">{{189, 33}, {150, 20}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="792189805"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                        <bool key="NSEnabled">YES</bool>
@@ -789,6 +799,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">265</int>
                                                                        <string key="NSFrame">{{191, 24}, {146, 16}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="20704797"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                        <bool key="NSEnabled">YES</bool>
@@ -814,6 +825,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">265</int>
                                                                        <string key="NSFrame">{{189, 70}, {224, 24}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="921829691"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                        <bool key="NSEnabled">YES</bool>
@@ -867,6 +879,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">265</int>
                                                                        <string key="NSFrame">{{191, 108}, {220, 16}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="125828224"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                        <bool key="NSEnabled">YES</bool>
@@ -892,6 +905,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">265</int>
                                                                        <string key="NSFrame">{{191, 196}, {220, 23}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="194275224"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                        <string key="NSClassName">NJKeyInputField</string>
@@ -901,6 +915,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">265</int>
                                                                        <string key="NSFrame">{{188, 153}, {226, 26}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="875916470"/>
                                                                        <bool key="NSEnabled">YES</bool>
                                                                        <object class="NSPopUpButtonCell" key="NSCell" id="74311158">
@@ -933,6 +948,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">268</int>
                                                                        <string key="NSFrame">{{24, 20}, {163, 250}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="57697638"/>
                                                                        <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
                                                                        <int key="NSNumRows">6</int>
@@ -1063,6 +1079,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">266</int>
                                                                        <string key="NSFrame">{{9, 286}, {369, 17}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="497528019"/>
                                                                        <bool key="NSEnabled">YES</bool>
                                                                        <object class="NSTextFieldCell" key="NSCell" id="853503577">
@@ -1086,6 +1103,7 @@ aW5nLg</string>
                                                                        <int key="NSvFlags">10</int>
                                                                        <string key="NSFrame">{{12, 276}, {363, 5}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="120408205"/>
                                                                        <string key="NSOffsets">{0, 0}</string>
                                                                        <object class="NSTextFieldCell" key="NSTitleCell">
@@ -1112,12 +1130,15 @@ aW5nLg</string>
                                                        </array>
                                                        <string key="NSFrame">{{233, 0}, {431, 323}}</string>
                                                        <reference key="NSSuperview" ref="177223957"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="1016088174"/>
                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                        <string key="NSClassName">NSView</string>
                                                </object>
                                        </array>
                                        <string key="NSFrameSize">{664, 323}</string>
+                                       <reference key="NSSuperview"/>
+                                       <reference key="NSWindow"/>
                                        <reference key="NSNextKeyView" ref="734312853"/>
                                </object>
                                <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
@@ -1625,14 +1646,6 @@ aW5nLg</string>
                                        </object>
                                        <int key="connectionID">915</int>
                                </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">inputController</string>
-                                               <reference key="source" ref="207406104"/>
-                                               <reference key="destination" ref="1007832501"/>
-                                       </object>
-                                       <int key="connectionID">819</int>
-                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
                                                <string key="label">mappingsController</string>
@@ -3009,7 +3022,6 @@ aW5nLg</string>
                                        </object>
                                        <dictionary class="NSMutableDictionary" key="outlets">
                                                <string key="dockMenu">NSMenu</string>
-                                               <string key="inputController">NJDeviceController</string>
                                                <string key="mappingsController">NJMappingsController</string>
                                                <string key="mappingsMenu">NSMenu</string>
                                                <string key="statusItemMenu">NSMenu</string>
@@ -3020,10 +3032,6 @@ aW5nLg</string>
                                                        <string key="name">dockMenu</string>
                                                        <string key="candidateClassName">NSMenu</string>
                                                </object>
-                                               <object class="IBToOneOutletInfo" key="inputController">
-                                                       <string key="name">inputController</string>
-                                                       <string key="candidateClassName">NJDeviceController</string>
-                                               </object>
                                                <object class="IBToOneOutletInfo" key="mappingsController">
                                                        <string key="name">mappingsController</string>
                                                        <string key="candidateClassName">NJMappingsController</string>