From a58f23691951d4d1e1961dddd514a7e9f3748203 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sat, 17 Aug 2013 14:03:51 +0200 Subject: [PATCH] Use renameMapping in the input controller rather than setting the name directly when setting an auto-discovered name. This triggers the appropriate callbacks to update some UI labels that were not being set when only the mappings list was marked change and not the currently active mapping. Fix some formatting issues. --- Classes/EnjoyableApplicationDelegate.m | 3 +-- Classes/NJInputController.m | 11 +++++------ Info.plist | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Classes/EnjoyableApplicationDelegate.m b/Classes/EnjoyableApplicationDelegate.m index 449f6ef..25b9937 100644 --- a/Classes/EnjoyableApplicationDelegate.m +++ b/Classes/EnjoyableApplicationDelegate.m @@ -301,8 +301,7 @@ - (void)mappingsViewController:(NJMappingsViewController *)mvc renameMappingAtIndex:(NSInteger)index toName:(NSString *)name { - [self.ic renameMapping:self.ic.mappings[index] - to:name]; + [self.ic renameMapping:self.ic.mappings[index] to:name]; } - (BOOL)mappingsViewController:(NJMappingsViewController *)mvc diff --git a/Classes/NJInputController.m b/Classes/NJInputController.m index 5ba9828..3ee0884 100644 --- a/Classes/NJInputController.m +++ b/Classes/NJInputController.m @@ -295,8 +295,7 @@ static CVReturn displayLink_update_cb(CVDisplayLinkRef displayLink, if ([oldMapping.name.lowercaseString isEqualToString:@"@application"] || [oldMapping.name.lowercaseString isEqualToString: NSLocalizedString(@"@Application", nil).lowercaseString]) { - oldMapping.name = app.bestMappingName; - [self mappingsChanged]; + [self renameMapping:oldMapping to:app.bestMappingName]; } } _manualMapping = oldMapping; @@ -307,10 +306,10 @@ static CVReturn displayLink_update_cb(CVDisplayLinkRef displayLink, _currentMapping = mapping; NSUInteger idx = [self indexOfMapping:_currentMapping]; [NSNotificationCenter.defaultCenter - postNotificationName:NJEventMappingChanged - object:self - userInfo:@{ NJMappingKey : _currentMapping, - NJMappingIndexKey: @(idx) }]; + postNotificationName:NJEventMappingChanged + object:self + userInfo:@{ NJMappingKey : _currentMapping, + NJMappingIndexKey: @(idx) }]; } - (void)activateMapping:(NJMapping *)mapping { diff --git a/Info.plist b/Info.plist index 1e6b7d9..24e0951 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 605 + 607 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright -- 2.30.2