aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-01 14:57:27 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-01 14:57:27 +0000
commita7981fb1f88c16fbd0f7732a03d63f599d94309b (patch)
tree2dd7166d8a2b141651e9485fa31c9007295da9f4 /Source/SPAppController.m
parent40b1a5d57e6445f5a644521018ceb7762b3b59b8 (diff)
downloadsequelpro-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.m15
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];