Fix an off-by-one error. Make the popover work correctly when conflicts occur.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 17 Mar 2013 17:31:52 +0000 (18:31 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 17 Mar 2013 17:31:52 +0000 (18:31 +0100)
Classes/NJMappingsController.m
Info.plist

index 531de12645c42b326076d634ecaf4e5f0d246e36..4859970fc63ff07b81788bf655978ec33d63f019 100644 (file)
     NSDictionary *userInfo = CFBridgingRelease(contextInfo);
     NJMapping *oldMapping = userInfo[@"old mapping"];
     NJMapping *newMapping = userInfo[@"new mapping"];
+    [alert.window orderOut:nil];
     switch (returnCode) {
         case NSAlertFirstButtonReturn: // Merge
             [oldMapping mergeEntriesFrom:newMapping];
         case NSAlertThirdButtonReturn: // New Mapping
             [self.mvc.mappingList beginUpdates];
             [_mappings addObject:newMapping];
-            [self.mvc addedMappingAtIndex:_mappings.count - 1 startEditing:NO];
+            [self.mvc addedMappingAtIndex:_mappings.count - 1 startEditing:YES];
             [self.mvc.mappingList endUpdates];
             [self activateMapping:newMapping];
             [self mappingsChanged];
             [self mappingsChanged];
         } else {
             if (idx == -1)
-                idx = _mappings.count - 1;
+                idx = _mappings.count;
             [self.mvc.mappingList beginUpdates];
             [_mappings insertObject:mapping atIndex:idx];
             [self.mvc addedMappingAtIndex:idx startEditing:NO];
index 673fcbd1d80e28633cc211f83bd2ccc90d9c9492..94c58253434e2874b12f8628cc7fccf60d75362a 100644 (file)
@@ -46,7 +46,7 @@
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>444</string>
+       <string>448</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.utilities</string>
        <key>NSHumanReadableCopyright</key>