diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-12-01 21:42:58 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-12-01 21:42:58 +0000 |
commit | 842e85a37b698be1245dee0948a1abd99973638c (patch) | |
tree | b9e642508660110488fdf4d90e3bd2c3c6dd9181 /Source/SPDatabaseViewController.m | |
parent | a7981fb1f88c16fbd0f7732a03d63f599d94309b (diff) | |
download | sequelpro-842e85a37b698be1245dee0948a1abd99973638c.tar.gz sequelpro-842e85a37b698be1245dee0948a1abd99973638c.tar.bz2 sequelpro-842e85a37b698be1245dee0948a1abd99973638c.zip |
• Bundle Editor / Bundle commands
- enabled trigger support to run a command if db, table, or table row was changed
- HTML output window will be ordered out without making it the key window to remain the first responder
• SPTableTExtFieldCell
- forgotten to remove expansionFrameWithFrame: method
Diffstat (limited to 'Source/SPDatabaseViewController.m')
-rw-r--r-- | Source/SPDatabaseViewController.m | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m index c1b1bdbf..8cf97998 100644 --- a/Source/SPDatabaseViewController.m +++ b/Source/SPDatabaseViewController.m @@ -481,6 +481,27 @@ // Empty the loading pool and exit the thread [self endTask]; + + NSArray *triggeredCommands = [[NSApp delegate] bundleCommandsForTrigger:SPBundleTriggerActionTableChanged]; + for(NSString* cmdPath in triggeredCommands) { + NSArray *data = [cmdPath componentsSeparatedByString:@"|"]; + NSMenuItem *aMenuItem = [[[NSMenuItem alloc] init] autorelease]; + [aMenuItem setTag:0]; + [aMenuItem setToolTip:[data objectAtIndex:0]]; + if([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) { + [[[NSApp delegate] onMainThread] executeBundleItemForApp:aMenuItem]; + } + else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) { + if([[[[NSApp mainWindow] firstResponder] description] isEqualToString:@"SPCopyTable"]) + [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForDataTable:aMenuItem]; + } + else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeInputField]) { + if([[[NSApp mainWindow] firstResponder] isKindOfClass:[NSTextView class]]) + [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForInputField:aMenuItem]; + } + } + + [loadPool drain]; } |