From: Joe Wreschnig Date: Mon, 11 Mar 2013 10:39:08 +0000 (+0100) Subject: Symbols for mapping userInfo key names. X-Git-Tag: version-1.1~59 X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=commitdiff_plain;h=9a400b562a83ed0ef9449cded72152d1e4860f5c Symbols for mapping userInfo key names. --- diff --git a/Classes/NJMappingMenuController.m b/Classes/NJMappingMenuController.m index 0fa6183..882a984 100644 --- a/Classes/NJMappingMenuController.m +++ b/Classes/NJMappingMenuController.m @@ -52,8 +52,8 @@ } - (void)mappingsListDidChange:(NSNotification *)note { - NSArray *mappings = note.userInfo[@"mappings"]; - NJMapping *currentMapping = note.userInfo[@"mapping"]; + NSArray *mappings = note.userInfo[NJMappingListKey]; + NJMapping *currentMapping = note.userInfo[NJMappingKey]; NSMenuItem *toRemove; while (self.menu.numberOfItems > self.firstMappingIndex && (toRemove = [self.menu itemAtIndex:self.firstMappingIndex]) @@ -92,7 +92,7 @@ } - (void)mappingDidChange:(NSNotification *)note { - NJMapping *mapping = note.userInfo[@"mapping"]; + NJMapping *mapping = note.userInfo[NJMappingKey]; for (NSMenuItem *item in self.menu.itemArray) if ([item.representedObject isKindOfClass:NJMapping.class]) item.state = mapping == item.representedObject; diff --git a/Classes/NJMappingsController.m b/Classes/NJMappingsController.m index ad257cf..d7310c0 100644 --- a/Classes/NJMappingsController.m +++ b/Classes/NJMappingsController.m @@ -52,8 +52,8 @@ [NSNotificationCenter.defaultCenter postNotificationName:NJEventMappingListChanged object:self - userInfo:@{ @"mappings": _mappings, - @"mapping": _currentMapping }]; + userInfo:@{ NJMappingListKey: _mappings, + NJMappingKey: _currentMapping }]; } - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state diff --git a/Info.plist b/Info.plist index 5eb91a7..74f1265 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 123 + 124 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright diff --git a/Other Sources/NJEvents.h b/Other Sources/NJEvents.h index ce87b24..5485154 100644 --- a/Other Sources/NJEvents.h +++ b/Other Sources/NJEvents.h @@ -6,7 +6,10 @@ // // -#define NJEventMappingChanged @"NJEventMappingChanged" -#define NJEventMappingListChanged @"NJEventMappingListChanged" -#define NJEventTranslationActivated @"NJEventTranslationActivated" -#define NJEventTranslationDeactivated @"NJEventTranslationDeactivated" +#define NJEventMappingChanged @"com.yukkurigames.Enjoyable.MappingChanged" +#define NJEventMappingListChanged @"com.yukkurigames.Enjoyable.MappingListChanged" +#define NJEventTranslationActivated @"com.yukkurigames.Enjoyable.EventTranslationActivated" +#define NJEventTranslationDeactivated @"com.yukkurigames.Enjoyable.EventTranslationDeactivated" + +#define NJMappingKey @"com.yukkurigames.Enjoyable.Mapping" +#define NJMappingListKey @"com.yukkurigames.Enjoyable.MappingList"