From: Joe Wreschnig Date: Sun, 17 Mar 2013 17:31:52 +0000 (+0100) Subject: Fix an off-by-one error. Make the popover work correctly when conflicts occur. X-Git-Tag: version-1.1~19 X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=a3d6f991d110dcccb70e137f43cbafc60f7ecee7;p=enjoyable.git Fix an off-by-one error. Make the popover work correctly when conflicts occur. --- diff --git a/Classes/NJMappingsController.m b/Classes/NJMappingsController.m index 531de12..4859970 100644 --- a/Classes/NJMappingsController.m +++ b/Classes/NJMappingsController.m @@ -147,6 +147,7 @@ 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]; @@ -157,7 +158,7 @@ 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]; @@ -195,7 +196,7 @@ [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]; diff --git a/Info.plist b/Info.plist index 673fcbd..94c5825 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 444 + 448 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright