Signal mappings menu entry by a tag, not a check for a separator. Remove dead code.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 4 Mar 2013 13:06:53 +0000 (14:06 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 4 Mar 2013 13:06:53 +0000 (14:06 +0100)
English.lproj/MainMenu.xib
EnjoyableApplicationDelegate.h
EnjoyableApplicationDelegate.m

index 2e2b440547bda0ba63ccaa264acddef2a7f92ce3..a110b51f3da664c0fa388e99a41e2103d50d615c 100644 (file)
                                                                        <int key="NSMnemonicLoc">2147483647</int>
                                                                        <reference key="NSOnImage" ref="35465992"/>
                                                                        <reference key="NSMixedImage" ref="502551668"/>
+                                                                       <int key="NSTag">1</int>
                                                                </object>
                                                        </array>
                                                </object>
                                                                <string key="NSFrame">{{0, 14}, {140, 25}}</string>
                                                                <reference key="NSSuperview"/>
                                                                <reference key="NSWindow"/>
+                                                               <reference key="NSNextKeyView"/>
                                                                <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                <bool key="NSEnabled">YES</bool>
                                                                <object class="NSButtonCell" key="NSCell" id="850080795">
                                                                <string key="NSFrame">{{5, 14}, {67, 25}}</string>
                                                                <reference key="NSSuperview"/>
                                                                <reference key="NSWindow"/>
+                                                               <reference key="NSNextKeyView"/>
                                                                <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                <bool key="NSEnabled">YES</bool>
                                                                <object class="NSSegmentedCell" key="NSCell" id="594076765">
                                                        </object>
                                                </object>
                                        </dictionary>
-                                       <array class="NSMutableArray" key="NSToolbarIBAllowedItems">
+                                       <array key="NSToolbarIBAllowedItems">
                                                <reference ref="496378711"/>
                                                <reference ref="981531896"/>
                                                <reference ref="658903347"/>
                                                                                        <string key="NSFrame">{{227, 55}, {180, 24}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView"/>
                                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSSegmentedCell" key="NSCell" id="301345285">
                                                <string key="NSFrame">{{67, 19}, {39, 28}}</string>
                                                <reference key="NSSuperview" ref="671181514"/>
                                                <reference key="NSWindow"/>
+                                               <reference key="NSNextKeyView"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSButtonCell" key="NSCell" id="1008023024">
                                                        <int key="NSCellFlags">603979776</int>
                                <object class="IBPartialClassDescription">
                                        <string key="className">EnjoyableApplicationDelegate</string>
                                        <string key="superclassName">NSObject</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <string key="NS.key.0">toggleActivity:</string>
+                                               <string key="NS.object.0">id</string>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <string key="NS.key.0">toggleActivity:</string>
+                                               <object class="IBActionInfo" key="NS.object.0">
+                                                       <string key="name">toggleActivity:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                       </object>
                                        <dictionary class="NSMutableDictionary" key="outlets">
-                                               <string key="activeMenuItem">NSMenuItem</string>
                                                <string key="dockMenuBase">NSMenu</string>
-                                               <string key="drawer">NSDrawer</string>
                                                <string key="inputController">NJDeviceController</string>
                                                <string key="mappingsController">NJMappingsController</string>
                                                <string key="outputController">NJOutputController</string>
                                        </dictionary>
                                        <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <object class="IBToOneOutletInfo" key="activeMenuItem">
-                                                       <string key="name">activeMenuItem</string>
-                                                       <string key="candidateClassName">NSMenuItem</string>
-                                               </object>
                                                <object class="IBToOneOutletInfo" key="dockMenuBase">
                                                        <string key="name">dockMenuBase</string>
                                                        <string key="candidateClassName">NSMenu</string>
                                                </object>
-                                               <object class="IBToOneOutletInfo" key="drawer">
-                                                       <string key="name">drawer</string>
-                                                       <string key="candidateClassName">NSDrawer</string>
-                                               </object>
                                                <object class="IBToOneOutletInfo" key="inputController">
                                                        <string key="name">inputController</string>
                                                        <string key="candidateClassName">NJDeviceController</string>
index 17737e807e5d538f779c27a61bd81d32b7fdab3b..3e744189657c2098356575284327b044a264a0d1 100644 (file)
@@ -11,7 +11,6 @@
 @class NJMappingsController;
 
 @interface EnjoyableApplicationDelegate : NSObject <NSApplicationDelegate> {
-    IBOutlet NSMenuItem *activeMenuItem;
     IBOutlet NSMenu *dockMenuBase;
 }
 
index 74e8265cec07c98326220ea93c38ce87d64fc530..0dbea223a020f2539bee62e59aee380d839b12b4 100644 (file)
@@ -39,9 +39,7 @@
         name:NJEventTranslationDeactivated
         object:nil];
 
-    mappingsMenuIndex = dockMenuBase.numberOfItems;
-    while (![dockMenuBase itemAtIndex:mappingsMenuIndex - 1].isSeparatorItem)
-        --mappingsMenuIndex;
+    while (![dockMenuBase itemAtIndex:mappingsMenuIndex++].tag);
     
     self.outputController.enabled = NO;
     [self.inputController setup];
     NSLog(@"Ignoring application changes.");
 }
 
-- (IBAction)toggleActivity:(id)sender {
-    self.inputController.translatingEvents = !self.inputController.translatingEvents;
-}
-
 - (void)mappingsChanged {
     NSInteger removeFrom = mappingsMenuIndex;
     while (dockMenuBase.numberOfItems > removeFrom)