From a3d6f991d110dcccb70e137f43cbafc60f7ecee7 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sun, 17 Mar 2013 18:31:52 +0100 Subject: [PATCH] Fix an off-by-one error. Make the popover work correctly when conflicts occur. --- Classes/NJMappingsController.m | 5 +++-- Info.plist | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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 -- 2.30.2