diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-12-01 14:57:27 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-12-01 14:57:27 +0000 |
commit | a7981fb1f88c16fbd0f7732a03d63f599d94309b (patch) | |
tree | 2dd7166d8a2b141651e9485fa31c9007295da9f4 /Source/SPAppController.m | |
parent | 40b1a5d57e6445f5a644521018ceb7762b3b59b8 (diff) | |
download | sequelpro-a7981fb1f88c16fbd0f7732a03d63f599d94309b.tar.gz sequelpro-a7981fb1f88c16fbd0f7732a03d63f599d94309b.tar.bz2 sequelpro-a7981fb1f88c16fbd0f7732a03d63f599d94309b.zip |
• progress on trigger support for Bundle commands
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r-- | Source/SPAppController.m | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index d9fe64bb..3cd718db 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -54,6 +54,7 @@ bundleItems = [[NSMutableDictionary alloc] initWithCapacity:1]; bundleCategories = [[NSMutableDictionary alloc] initWithCapacity:1]; + bundleTriggers = [[NSMutableDictionary alloc] initWithCapacity:1]; bundleUsedScopes = [[NSMutableArray alloc] initWithCapacity:1]; bundleKeyEquivalents = [[NSMutableDictionary alloc] initWithCapacity:1]; installedBundleUUIDs = [[NSMutableDictionary alloc] initWithCapacity:1]; @@ -1179,6 +1180,7 @@ [bundleItems removeAllObjects]; [bundleUsedScopes removeAllObjects]; [bundleCategories removeAllObjects]; + [bundleTriggers removeAllObjects]; [bundleKeyEquivalents removeAllObjects]; [installedBundleUUIDs removeAllObjects]; @@ -1234,6 +1236,13 @@ [aDict setObject:[cmdData objectForKey:SPBundleFileNameKey] forKey:SPBundleInternLabelKey]; [aDict setObject:infoPath forKey:SPBundleInternPathToFileKey]; + // Register trigger + if([cmdData objectForKey:SPBundleFileTriggerKey]) { + if(![bundleTriggers objectForKey:[cmdData objectForKey:SPBundleFileTriggerKey]]) + [bundleTriggers setObject:[NSMutableArray array] forKey:[cmdData objectForKey:SPBundleFileTriggerKey]]; + [[bundleTriggers objectForKey:[cmdData objectForKey:SPBundleFileTriggerKey]] addObject:[NSString stringWithFormat:@"%@|%@", infoPath, [cmdData objectForKey:SPBundleFileScopeKey]]]; + } + if([cmdData objectForKey:SPBundleFileKeyEquivalentKey] && [[cmdData objectForKey:SPBundleFileKeyEquivalentKey] length]) { NSString *theKey = [cmdData objectForKey:SPBundleFileKeyEquivalentKey]; NSString *theChar = [theKey substringFromIndex:[theKey length]-1]; @@ -1518,6 +1527,11 @@ return [bundleCategories objectForKey:scope]; } +- (NSArray *)bundleCommandsForTrigger:(NSString*)trigger +{ + return [bundleTriggers objectForKey:trigger]; +} + - (NSArray *)bundleItemsForScope:(NSString*)scope { return [bundleItems objectForKey:scope]; @@ -1595,6 +1609,7 @@ if(bundleItems) [bundleItems release]; if(bundleUsedScopes) [bundleUsedScopes release]; if(bundleCategories) [bundleCategories release]; + if(bundleTriggers) [bundleTriggers release]; if(bundleKeyEquivalents) [bundleKeyEquivalents release]; if(installedBundleUUIDs) [installedBundleUUIDs release]; if (runningActivitiesArray) [runningActivitiesArray release]; |