View-free NJMappingsController.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 18 Mar 2013 00:41:19 +0000 (01:41 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 18 Mar 2013 00:41:19 +0000 (01:41 +0100)
Classes/EnjoyableApplicationDelegate.h
Classes/EnjoyableApplicationDelegate.m
Classes/NJMappingsController.h
Classes/NJMappingsController.m
Classes/NJMappingsViewController.h
Classes/NJMappingsViewController.m
Info.plist
Other Sources/NJEvents.h
Resources/English.lproj/MainMenu.xib

index b28269b007b89cd9c9dbf4127a2ea1f498fd70a5..dbc17eefb50d61e35474c1084b03d4079c1f4569 100644 (file)
@@ -9,8 +9,10 @@
 @class NJMappingsController;
 
 #import "NJMappingMenuController.h"
+#import "NJMappingsViewController.h"
 
 @interface EnjoyableApplicationDelegate : NSObject <NSApplicationDelegate,
+                                                    NJMappingsViewControllerDelegate,
                                                     NJMappingMenuDelegate,
                                                     NSWindowDelegate> {
     IBOutlet NSMenu *dockMenu;
@@ -19,6 +21,7 @@
 }
 
 @property (nonatomic, strong) IBOutlet NJMappingsController *mappingsController;
+@property (nonatomic, strong) IBOutlet NJMappingsViewController *mvc;
 
 - (IBAction)restoreToForeground:(id)sender;
 - (IBAction)importMappingClicked:(id)sender;
index 9fef7c378357aebc223570ee477bbb9c24da66c0..7c9ae7e7964689ed8ff0d1656266376b905fae7e 100644 (file)
         object:nil];
 
     [self.mappingsController load];
+    [self.mvc.mappingList reloadData];
+    [self.mvc changedActiveMappingToIndex:
+     [self.mappingsController indexOfMapping:
+      self.mappingsController.currentMapping]];
 
     statusItem = [NSStatusBar.systemStatusBar statusItemWithLength:36];
     statusItem.image = [NSImage imageNamed:@"Status Menu Icon Disabled"];
 }
 
 - (void)mappingDidChange:(NSNotification *)note {
+    NSUInteger idx = [note.userInfo[NJMappingIndexKey] intValue];
+    [self.mvc changedActiveMappingToIndex:idx];
+
     if (!window.isVisible)
         for (int i = 0; i < 4; ++i)
             [self performSelector:@selector(flashStatusItem)
     NJMapping *mapping = [NJMapping mappingWithContentsOfURL:URL
                                                        error:&error];
     if ([self.mappingsController[mapping.name] hasConflictWith:mapping]) {
-        [self.mappingsController promptForMapping:mapping atIndex:self.mappingsController.count];
+        [self promptForMapping:mapping atIndex:self.mappingsController.count];
     } else if (self.mappingsController[mapping.name]) {
         [self.mappingsController[mapping.name] mergeEntriesFrom:mapping];
     } else if (mapping) {
 
 - (void)mappingListShouldOpen {
     [self restoreToForeground:self];
-    [self.mappingsController.mvc mappingTriggerClicked:self];
+    [self.mvc mappingTriggerClicked:self];
 }
 
 - (void)loginItemPromptDidEnd:(NSWindow *)sheet
                       NJMapping *mapping = [NJMapping mappingWithContentsOfURL:panel.URL
                                                                          error:&error];
                       if ([self.mappingsController[mapping.name] hasConflictWith:mapping]) {
-                          [self.mappingsController promptForMapping:mapping atIndex:self.mappingsController.count];
+                          [self promptForMapping:mapping atIndex:self.mappingsController.count];
                       } else if (self.mappingsController[mapping.name]) {
                           [self.mappingsController[mapping.name] mergeEntriesFrom:mapping];
                       } else if (mapping) {
                   }];
 }
 
+- (void)mappingConflictDidResolve:(NSAlert *)alert
+                       returnCode:(NSInteger)returnCode
+                      contextInfo:(void *)contextInfo {
+    NSDictionary *userInfo = CFBridgingRelease(contextInfo);
+    NJMapping *oldMapping = userInfo[@"old mapping"];
+    NJMapping *newMapping = userInfo[@"new mapping"];
+    NSInteger idx = [userInfo[@"index"] intValue];
+    [alert.window orderOut:nil];
+    switch (returnCode) {
+        case NSAlertFirstButtonReturn: // Merge
+            [self.mappingsController mergeMapping:newMapping intoMapping:oldMapping];
+            [self.mappingsController activateMapping:oldMapping];
+            break;
+        case NSAlertThirdButtonReturn: // New Mapping
+            [self.mvc beginUpdates];
+            [self.mappingsController addMapping:newMapping];
+            [self.mvc addedMappingAtIndex:idx startEditing:YES];
+            [self.mvc endUpdates];
+            [self.mappingsController activateMapping:newMapping];
+            break;
+        default: // Cancel, other.
+            break;
+    }
+}
+
+- (void)promptForMapping:(NJMapping *)mapping atIndex:(NSInteger)idx {
+    NJMapping *mergeInto = self.mappingsController[mapping.name];
+    NSAlert *conflictAlert = [[NSAlert alloc] init];
+    conflictAlert.messageText = NSLocalizedString(@"import conflict prompt", @"Title of import conflict alert");
+    conflictAlert.informativeText =
+    [NSString stringWithFormat:NSLocalizedString(@"import conflict in %@", @"Explanation of import conflict"),
+     mapping.name];
+    [conflictAlert addButtonWithTitle:NSLocalizedString(@"import and merge", @"button to merge imported mappings")];
+    [conflictAlert addButtonWithTitle:NSLocalizedString(@"cancel import", @"button to cancel import")];
+    [conflictAlert addButtonWithTitle:NSLocalizedString(@"import new mapping", @"button to import as new mapping")];
+    [conflictAlert beginSheetModalForWindow:window
+                              modalDelegate:self
+                             didEndSelector:@selector(mappingConflictDidResolve:returnCode:contextInfo:)
+                                contextInfo:(void *)CFBridgingRetain(@{ @"index": @(idx),
+                                                                        @"old mapping": mergeInto,
+                                                                        @"new mapping": mapping })];
+}
+
+- (NSInteger)numberOfMappings:(NJMappingsViewController *)mvc {
+    return self.mappingsController.count;
+}
+
+- (NJMapping *)mappingsViewController:(NJMappingsViewController *)mvc
+                      mappingForIndex:(NSUInteger)idx {
+    return self.mappingsController[idx];
+}
+
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+          renameMappingAtIndex:(NSInteger)index
+                        toName:(NSString *)name {
+    [self.mappingsController renameMapping:self.mappingsController[index]
+                                        to:name];
+}
+
+- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
+       canMoveMappingFromIndex:(NSInteger)fromIdx
+                       toIndex:(NSInteger)toIdx {
+    return fromIdx != toIdx && fromIdx != 0 && toIdx != 0
+            && toIdx < (NSInteger)self.mappingsController.count;
+}
+
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+          moveMappingFromIndex:(NSInteger)fromIdx
+                       toIndex:(NSInteger)toIdx {
+    [mvc beginUpdates];
+    [mvc.mappingList moveRowAtIndex:fromIdx toIndex:toIdx];
+    [self.mappingsController moveMoveMappingFromIndex:fromIdx toIndex:toIdx];
+    [mvc endUpdates];
+}
+
+- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
+       canRemoveMappingAtIndex:(NSInteger)idx {
+    return idx != 0;
+}
+
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+          removeMappingAtIndex:(NSInteger)idx {
+    [mvc beginUpdates];
+    [mvc removedMappingAtIndex:idx];
+    [self.mappingsController removeMappingAtIndex:idx];
+    [mvc endUpdates];
+}
+
+- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
+          importMappingFromURL:(NSURL *)url
+                       atIndex:(NSInteger)index
+                         error:(NSError **)error {
+    NJMapping *mapping = [NJMapping mappingWithContentsOfURL:url
+                                                       error:error];
+    if ([self.mappingsController[mapping.name] hasConflictWith:mapping]) {
+        [self promptForMapping:mapping atIndex:index];
+    } else if (self.mappingsController[mapping.name]) {
+        [self.mappingsController[mapping.name] mergeEntriesFrom:mapping];
+    } else if (mapping) {
+        [self.mappingsController insertMapping:mapping atIndex:index];
+    }
+    return !!mapping;
+}
+
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+                    addMapping:(NJMapping *)mapping {
+    [mvc beginUpdates];
+    [mvc addedMappingAtIndex:self.mappingsController.count startEditing:YES];
+    [self.mappingsController addMapping:mapping];
+    [mvc endUpdates];
+    [self.mappingsController activateMapping:mapping];
+}
 
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+           choseMappingAtIndex:(NSInteger)idx {
+    [self.mappingsController activateMapping:self.mappingsController[idx]];
+}
 
 @end
index 85ba54ff873e1b14b13eed9d0ff2fdf2bd86b7b1..83ed8ef5d8b61aa54f7d906e7545ec0f2161c4c3 100644 (file)
@@ -9,16 +9,11 @@
 @class NJMapping;
 @class NJOutputController;
 
-#import "NJMappingsViewController.h"
-
-@interface NJMappingsController : NSObject <NSFastEnumeration,
-                                            NJMappingsViewControllerDelegate>
+@interface NJMappingsController : NSObject <NSFastEnumeration>
 
 @property (nonatomic, readonly) NJMapping *currentMapping;
 @property (nonatomic, readonly) NSUInteger count;
 
-@property (nonatomic, strong) IBOutlet NJMappingsViewController *mvc;
-
 - (NJMapping *)objectForKeyedSubscript:(NSString *)name;
 - (NJMapping *)objectAtIndexedSubscript:(NSUInteger)idx;
 - (NSInteger)indexOfMapping:(NJMapping *)mapping;
 - (void)removeMappingAtIndex:(NSInteger)idx;
 - (void)mergeMapping:(NJMapping *)mapping intoMapping:(NJMapping *)existing;
 - (void)moveMoveMappingFromIndex:(NSInteger)fromIdx toIndex:(NSInteger)toIdx;
+- (void)renameMapping:(NJMapping *)mapping to:(NSString *)name;
 
 - (void)mappingsChanged;
 
-- (void)promptForMapping:(NJMapping *)mapping atIndex:(NSInteger)idx;
-    // FIXME: Doesn't belong here.
-
 - (void)activateMapping:(NJMapping *)mapping;
 - (void)activateMappingForProcess:(NSRunningApplication *)app;
 - (void)save;
index 2b08a52a3db05228e687b96a89d1e4e504b02d47..8f0492cc7d88d3ac00c5aac8e7132f1e37e35849 100644 (file)
@@ -8,7 +8,6 @@
 #import "NJMappingsController.h"
 
 #import "NJMapping.h"
-#import "NJMappingsController.h"
 #import "NJOutput.h"
 #import "NJEvents.h"
 
@@ -48,7 +47,6 @@
                       object:self
                     userInfo:@{ NJMappingListKey: _mappings,
                                 NJMappingKey: _currentMapping }];
-    [self.mvc changedActiveMappingToIndex:[_mappings indexOfObjectIdenticalTo:_currentMapping]];
 }
 
 - (void)mappingsChanged {
     NSLog(@"Switching to mapping %@.", mapping.name);
     _manualMapping = mapping;
     _currentMapping = mapping;
-    [self.mvc changedActiveMappingToIndex:[_mappings indexOfObjectIdenticalTo:_currentMapping]];
+    NSUInteger idx = [_mappings indexOfObjectIdenticalTo:_currentMapping];
     [NSNotificationCenter.defaultCenter
          postNotificationName:NJEventMappingChanged
                        object:self
-                     userInfo:@{ NJMappingKey : _currentMapping }];
+                     userInfo:@{ NJMappingKey : _currentMapping,
+                                 NJMappingIndexKey: @(idx) }];
 }
 
 - (void)save {
         _mappings = newMappings;
         if (selected >= newMappings.count)
             selected = 0;
-        [self.mvc reloadData];
         [self activateMapping:_mappings[selected]];
         [self mappingsSet];
     }
     [existing mergeEntriesFrom:mapping];
     [self mappingsChanged];
     if (existing == _currentMapping) {
-        // FIXME: Hack to trigger updates when renaming.
+        // FIXME: Hack to trigger updates in the rest of the UI.
         _currentMapping = nil;
         NJMapping *manual = _manualMapping;
         [self activateMapping:existing];
     }
 }
 
+- (void)renameMapping:(NJMapping *)mapping to:(NSString *)name {
+    mapping.name = name;
+    if (mapping == _currentMapping) {
+        // FIXME: Hack to trigger updates in the rest of the UI.
+        _currentMapping = nil;
+        NJMapping *manual = _manualMapping;
+        [self activateMapping:mapping];
+        _manualMapping = manual;        
+    }
+    [self mappingsChanged];
+}
+
 - (void)addMapping:(NJMapping *)mapping {
     [self insertMapping:mapping atIndex:_mappings.count];
 }
     return _mappings.count;
 }
 
-- (void)mappingConflictDidResolve:(NSAlert *)alert
-                       returnCode:(NSInteger)returnCode
-                      contextInfo:(void *)contextInfo {
-    NSDictionary *userInfo = CFBridgingRelease(contextInfo);
-    NJMapping *oldMapping = userInfo[@"old mapping"];
-    NJMapping *newMapping = userInfo[@"new mapping"];
-    [alert.window orderOut:nil];
-    switch (returnCode) {
-        case NSAlertFirstButtonReturn: // Merge
-            [self mergeMapping:newMapping intoMapping:oldMapping];
-            [self activateMapping:oldMapping];
-            break;
-        case NSAlertThirdButtonReturn: // New Mapping
-            [self.mvc.mappingList beginUpdates];
-            [self addMapping:newMapping];
-            [self.mvc addedMappingAtIndex:_mappings.count - 1 startEditing:YES];
-            [self.mvc.mappingList endUpdates];
-            [self activateMapping:newMapping];
-            break;
-        default: // Cancel, other.
-            break;
-    }
-}
-
-- (void)promptForMapping:(NJMapping *)mapping atIndex:(NSInteger)idx {
-    NSWindow *window = NSApplication.sharedApplication.keyWindow;
-    NJMapping *mergeInto = self[mapping.name];
-    NSAlert *conflictAlert = [[NSAlert alloc] init];
-    conflictAlert.messageText = NSLocalizedString(@"import conflict prompt", @"Title of import conflict alert");
-    conflictAlert.informativeText =
-    [NSString stringWithFormat:NSLocalizedString(@"import conflict in %@", @"Explanation of import conflict"),
-                               mapping.name];
-    [conflictAlert addButtonWithTitle:NSLocalizedString(@"import and merge", @"button to merge imported mappings")];
-    [conflictAlert addButtonWithTitle:NSLocalizedString(@"cancel import", @"button to cancel import")];
-    [conflictAlert addButtonWithTitle:NSLocalizedString(@"import new mapping", @"button to import as new mapping")];
-    [conflictAlert beginSheetModalForWindow:window
-                              modalDelegate:self
-                             didEndSelector:@selector(mappingConflictDidResolve:returnCode:contextInfo:)
-                                contextInfo:(void *)CFBridgingRetain(@{ @"old mapping": mergeInto,
-                                                                        @"new mapping": mapping })];
-}
-
-- (NSInteger)numberOfMappings:(NJMappingsViewController *)mvc {
-    return self.count;
-}
-
-- (NJMapping *)mappingsViewController:(NJMappingsViewController *)mvc
-                      mappingForIndex:(NSUInteger)idx {
-    return self[idx];
-}
-
-- (void)mappingsViewController:(NJMappingsViewController *)mvc
-          editedMappingAtIndex:(NSInteger)index {
-    [self mappingsChanged];
-}
-
-- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
-       canMoveMappingFromIndex:(NSInteger)fromIdx
-                       toIndex:(NSInteger)toIdx {
-    return fromIdx != toIdx && fromIdx != 0 && toIdx != 0;
-}
-
-- (void)mappingsViewController:(NJMappingsViewController *)mvc
-          moveMappingFromIndex:(NSInteger)fromIdx
-                       toIndex:(NSInteger)toIdx {
-    [mvc.mappingList beginUpdates];
-    [mvc.mappingList moveRowAtIndex:fromIdx toIndex:toIdx];
-    [self moveMoveMappingFromIndex:fromIdx toIndex:toIdx];
-    [mvc.mappingList endUpdates];
-}
-
-- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
-       canRemoveMappingAtIndex:(NSInteger)idx {
-    return idx != 0;
-}
-
-- (void)mappingsViewController:(NJMappingsViewController *)mvc
-          removeMappingAtIndex:(NSInteger)idx {
-    [mvc.mappingList beginUpdates];
-    [mvc removedMappingAtIndex:idx];
-    [self removeMappingAtIndex:idx];
-    [mvc.mappingList endUpdates];
-}
-
-- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
-          importMappingFromURL:(NSURL *)url
-                       atIndex:(NSInteger)index
-                         error:(NSError **)error {
-    NJMapping *mapping = [NJMapping mappingWithContentsOfURL:url
-                                                       error:error];
-    if ([self[mapping.name] hasConflictWith:mapping]) {
-        [self promptForMapping:mapping atIndex:index];
-    } else if (self[mapping.name]) {
-        [self[mapping.name] mergeEntriesFrom:mapping];
-    } else if (mapping) {
-        [self insertMapping:mapping atIndex:index];
-    }
-    return !!mapping;
-}
-
-- (void)mappingsViewController:(NJMappingsViewController *)mvc
-                    addMapping:(NJMapping *)mapping {
-    [mvc.mappingList beginUpdates];
-    [mvc addedMappingAtIndex:_mappings.count startEditing:YES];
-    [self addMapping:mapping];
-    [mvc.mappingList endUpdates];
-    [self activateMapping:mapping];
-}
-
-- (void)mappingsViewController:(NJMappingsViewController *)mvc
-                  choseMappingAtIndex:(NSInteger)idx {
-    [self activateMapping:self[idx]];
-}
-
 @end
index 2d0bd256ed3d77393beb9b173c2d0d13092aacc0..8e1055aca86709955a0fd7a09d2fd6991bc00b96 100644 (file)
@@ -34,6 +34,9 @@
 - (void)changedActiveMappingToIndex:(NSInteger)index;
 
 - (void)reloadData;
+- (void)beginUpdates;
+- (void)endUpdates;
+
 
 @end
 
@@ -45,7 +48,8 @@
 
 
 - (void)mappingsViewController:(NJMappingsViewController *)mvc
-          editedMappingAtIndex:(NSInteger)index;
+          renameMappingAtIndex:(NSInteger)index
+                        toName:(NSString *)name;
 
 - (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
        canMoveMappingFromIndex:(NSInteger)fromIdx
index e7c28dab189a82475aada87e8aff7f6d3fa8a51f..854c1142a1ca4034d08197066bb87c114ac2c6c8 100644 (file)
     self.mappingListTrigger.state = NSOffState;
 }
 
+- (void)beginUpdates {
+    [self.mappingList beginUpdates];
+}
+
+- (void)endUpdates {
+    [self.mappingList endUpdates];
+    [self changedActiveMappingToIndex:self.mappingList.selectedRow];
+}
+
 - (void)addedMappingAtIndex:(NSInteger)index startEditing:(BOOL)startEditing {
     [self.mappingList abortEditing];
     [self.mappingList insertRowsAtIndexes:[[NSIndexSet alloc] initWithIndex:index]
    setObjectValue:(NSString *)obj
    forTableColumn:(NSTableColumn *)col
               row:(NSInteger)index {
-    NJMapping *mapping = [self.delegate mappingsViewController:self
-                                               mappingForIndex:index];
-    mapping.name = obj;
-    [self.delegate mappingsViewController:self editedMappingAtIndex:index];
+    [self.delegate mappingsViewController:self
+                     renameMappingAtIndex:index
+                                   toName:obj];
 }
 
 - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
index a750109be106e085aed3a9c96ceb0e1d6dccf386..98f8dd549d836fd4559e5b95170c020d76578c5a 100644 (file)
@@ -46,7 +46,7 @@
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>502</string>
+       <string>517</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.utilities</string>
        <key>NSHumanReadableCopyright</key>
index 204a270b68b9f0e7722554be11f01d6309382f29..646bbf62d1ee11d426f8b4e9ed25edb234852bc6 100644 (file)
@@ -12,4 +12,5 @@
 #define NJEventSimulationStopped @"com.yukkurigames.Enjoyable.EventSimulationStopped"
 
 #define NJMappingKey @"com.yukkurigames.Enjoyable.Mapping"
+#define NJMappingIndexKey @"com.yukkurigames.Enjoyable.MappingIndex"
 #define NJMappingListKey @"com.yukkurigames.Enjoyable.MappingList"
index e045c4d3598a79a4ef1a396f834b43bac4e0673e..b2cc462bd025c796567c86c567cfb7a8491e7736 100644 (file)
@@ -566,7 +566,7 @@ aW5nLg</string>
                                                                                                        <string key="NSFrameSize">{232, 321}</string>
                                                                                                        <reference key="NSSuperview" ref="698362889"/>
                                                                                                        <reference key="NSWindow"/>
-                                                                                                       <reference key="NSNextKeyView" ref="1036252745"/>
+                                                                                                       <reference key="NSNextKeyView" ref="892486973"/>
                                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                                        <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
                                                                                                        <bool key="NSControlAllowsExpansionToolTips">YES</bool>
@@ -696,7 +696,7 @@ aW5nLg</string>
                                                                        <string key="NSFrameSize">{234, 323}</string>
                                                                        <reference key="NSSuperview" ref="734312853"/>
                                                                        <reference key="NSWindow"/>
-                                                                       <reference key="NSNextKeyView" ref="892486973"/>
+                                                                       <reference key="NSNextKeyView" ref="698362889"/>
                                                                        <int key="NSsFlags">150034</int>
                                                                        <reference key="NSVScroller" ref="1036252745"/>
                                                                        <reference key="NSHScroller" ref="892486973"/>
@@ -791,7 +791,6 @@ aW5nLg</string>
                                                                        <string key="NSFrame">{{343, 31}, {70, 18}}</string>
                                                                        <reference key="NSSuperview" ref="471332453"/>
                                                                        <reference key="NSWindow"/>
-                                                                       <reference key="NSNextKeyView"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                        <bool key="NSEnabled">YES</bool>
                                                                        <object class="NSButtonCell" key="NSCell" id="868379451">
@@ -1233,7 +1232,7 @@ aW5nLg</string>
                                                                                <string key="NSFrameSize">{198, 198}</string>
                                                                                <reference key="NSSuperview" ref="947403733"/>
                                                                                <reference key="NSWindow"/>
-                                                                               <reference key="NSNextKeyView" ref="968378655"/>
+                                                                               <reference key="NSNextKeyView" ref="553414014"/>
                                                                                <bool key="NSEnabled">YES</bool>
                                                                                <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
                                                                                <bool key="NSControlAllowsExpansionToolTips">YES</bool>
@@ -1325,7 +1324,7 @@ aW5nLg</string>
                                                <string key="NSFrame">{{0, 20}, {200, 200}}</string>
                                                <reference key="NSSuperview" ref="671181514"/>
                                                <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView" ref="553414014"/>
+                                               <reference key="NSNextKeyView" ref="947403733"/>
                                                <int key="NSsFlags">150034</int>
                                                <reference key="NSVScroller" ref="968378655"/>
                                                <reference key="NSHScroller" ref="553414014"/>
@@ -1397,7 +1396,6 @@ aW5nLg</string>
                                                <string key="NSFrame">{{166, -1}, {34, 23}}</string>
                                                <reference key="NSSuperview" ref="671181514"/>
                                                <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSButtonCell" key="NSCell" id="828611353">
                                                        <int key="NSCellFlags">67108864</int>
@@ -1784,14 +1782,6 @@ aW5nLg</string>
                                        </object>
                                        <int key="connectionID">930</int>
                                </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">mappingsMenu</string>
-                                               <reference key="source" ref="207406104"/>
-                                               <reference key="destination" ref="720053764"/>
-                                       </object>
-                                       <int key="connectionID">931</int>
-                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBActionConnection" key="connection">
                                                <string key="label">restoreToForeground:</string>
@@ -1816,6 +1806,14 @@ aW5nLg</string>
                                        </object>
                                        <int key="connectionID">1016</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mvc</string>
+                                               <reference key="source" ref="207406104"/>
+                                               <reference key="destination" ref="70919963"/>
+                                       </object>
+                                       <int key="connectionID">1024</int>
+                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBActionConnection" key="connection">
                                                <string key="label">performClick:</string>
@@ -2176,14 +2174,6 @@ aW5nLg</string>
                                        </object>
                                        <int key="connectionID">989</int>
                                </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="70919963"/>
-                                               <reference key="destination" ref="468285243"/>
-                                       </object>
-                                       <int key="connectionID">994</int>
-                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
                                                <string key="label">view</string>
@@ -2280,6 +2270,14 @@ aW5nLg</string>
                                        </object>
                                        <int key="connectionID">1011</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="70919963"/>
+                                               <reference key="destination" ref="207406104"/>
+                                       </object>
+                                       <int key="connectionID">1023</int>
+                               </object>
                        </array>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <array key="orderedObjects">
@@ -3387,7 +3385,7 @@ aW5nLg</string>
                        <nil key="activeLocalization"/>
                        <dictionary class="NSMutableDictionary" key="localizations"/>
                        <nil key="sourceID"/>
-                       <int key="maxID">1022</int>
+                       <int key="maxID">1024</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3416,6 +3414,7 @@ aW5nLg</string>
                                        <dictionary class="NSMutableDictionary" key="outlets">
                                                <string key="dockMenu">NSMenu</string>
                                                <string key="mappingsController">NJMappingsController</string>
+                                               <string key="mvc">NJMappingsViewController</string>
                                                <string key="statusItemMenu">NSMenu</string>
                                                <string key="window">NSWindow</string>
                                        </dictionary>
@@ -3428,6 +3427,10 @@ aW5nLg</string>
                                                        <string key="name">mappingsController</string>
                                                        <string key="candidateClassName">NJMappingsController</string>
                                                </object>
+                                               <object class="IBToOneOutletInfo" key="mvc">
+                                                       <string key="name">mvc</string>
+                                                       <string key="candidateClassName">NJMappingsViewController</string>
+                                               </object>
                                                <object class="IBToOneOutletInfo" key="statusItemMenu">
                                                        <string key="name">statusItemMenu</string>
                                                        <string key="candidateClassName">NSMenu</string>
@@ -3566,17 +3569,6 @@ aW5nLg</string>
                                <object class="IBPartialClassDescription">
                                        <string key="className">NJMappingsController</string>
                                        <string key="superclassName">NSObject</string>
-                                       <object class="NSMutableDictionary" key="outlets">
-                                               <string key="NS.key.0">mvc</string>
-                                               <string key="NS.object.0">NJMappingsViewController</string>
-                                       </object>
-                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <string key="NS.key.0">mvc</string>
-                                               <object class="IBToOneOutletInfo" key="NS.object.0">
-                                                       <string key="name">mvc</string>
-                                                       <string key="candidateClassName">NJMappingsViewController</string>
-                                               </object>
-                                       </object>
                                        <object class="IBClassDescriptionSource" key="sourceIdentifier">
                                                <string key="majorKey">IBProjectSource</string>
                                                <string key="minorKey">./Classes/NJMappingsController.h</string>
@@ -3713,7 +3705,7 @@ aW5nLg</string>
                                                <string key="scrollSpeedSlider">NSSlider</string>
                                                <string key="smoothCheck">NSButton</string>
                                                <string key="title">NSTextField</string>
-                                               <string key="unknownMapping">NSBUtton</string>
+                                               <string key="unknownMapping">NSButton</string>
                                        </dictionary>
                                        <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
                                                <object class="IBToOneOutletInfo" key="inputController">
@@ -3766,7 +3758,7 @@ aW5nLg</string>
                                                </object>
                                                <object class="IBToOneOutletInfo" key="unknownMapping">
                                                        <string key="name">unknownMapping</string>
-                                                       <string key="candidateClassName">NSBUtton</string>
+                                                       <string key="candidateClassName">NSButton</string>
                                                </object>
                                        </dictionary>
                                        <object class="IBClassDescriptionSource" key="sourceIdentifier">