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 531de12..4859970 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 673fcbd..94c5825 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>