Symbols for mapping userInfo key names.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 11 Mar 2013 10:39:08 +0000 (11:39 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 11 Mar 2013 10:39:08 +0000 (11:39 +0100)
Classes/NJMappingMenuController.m
Classes/NJMappingsController.m
Info.plist
Other Sources/NJEvents.h

index 0fa61834ff3663bdf3ee455e80dc3edb5e2779d4..882a984405b2fc5865de6ee2cc45d067a05e2fb5 100644 (file)
@@ -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;
index ad257cfb8b269028d62d85bc6d4882108b7706f8..d7310c09f84f616bd245bb60666ff1dc832612c2 100644 (file)
@@ -52,8 +52,8 @@
     [NSNotificationCenter.defaultCenter
         postNotificationName:NJEventMappingListChanged
                       object:self
-                    userInfo:@{ @"mappings": _mappings,
-                                @"mapping": _currentMapping }];
+                    userInfo:@{ NJMappingListKey: _mappings,
+                                NJMappingKey: _currentMapping }];
 }
 
 - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
index 5eb91a77febb30efee5419179139670f7876acad..74f12656ebfdf7bf617f77d8d5d3c23caf3bd663 100644 (file)
@@ -46,7 +46,7 @@
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>123</string>
+       <string>124</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.utilities</string>
        <key>NSHumanReadableCopyright</key>
index ce87b24725c550af21ec9023151c00ea687b9cbd..5485154fbe0f5caa142bfaa4eb8317a39438053a 100644 (file)
@@ -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"