aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-01 21:42:58 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-01 21:42:58 +0000
commit842e85a37b698be1245dee0948a1abd99973638c (patch)
treeb9e642508660110488fdf4d90e3bd2c3c6dd9181 /Source/SPDatabaseDocument.m
parenta7981fb1f88c16fbd0f7732a03d63f599d94309b (diff)
downloadsequelpro-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/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m36
1 files changed, 20 insertions, 16 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 02889b5e..2729932f 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -5301,6 +5301,19 @@
[[parentWindow onMainThread] makeFirstResponder:[tablesListInstance valueForKeyPath:@"tablesListView"]];
}
+ // If a the table has changed, update the selection
+ if (![targetItemName isEqualToString:[self table]]) {
+ if (targetItemName) {
+ [tablesListInstance selectItemWithName:targetItemName];
+ } else {
+ [[tablesListInstance onMainThread] setTableListSelectability:YES];
+ [[[tablesListInstance valueForKey:@"tablesListView"] onMainThread] deselectAll:self];
+ [[tablesListInstance onMainThread] setTableListSelectability:NO];
+ }
+ }
+
+ [self endTask];
+
NSArray *triggeredCommands = [[NSApp delegate] bundleCommandsForTrigger:SPBundleTriggerActionDatabaseChanged];
for(NSString* cmdPath in triggeredCommands) {
NSArray *data = [cmdPath componentsSeparatedByString:@"|"];
@@ -5308,28 +5321,19 @@
[aMenuItem setTag:0];
[aMenuItem setToolTip:[data objectAtIndex:0]];
if([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) {
- ;
- }
- else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeInputField]) {
- ;
+ [[[NSApp delegate] onMainThread] executeBundleItemForApp:aMenuItem];
}
else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) {
- ;
+ if([[[NSApp mainWindow] firstResponder] isKindOfClass:[SPCopyTable class]])
+ [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForDataTable:aMenuItem];
}
- }
-
- // If a the table has changed, update the selection
- if (![targetItemName isEqualToString:[self table]]) {
- if (targetItemName) {
- [tablesListInstance selectItemWithName:targetItemName];
- } else {
- [[tablesListInstance onMainThread] setTableListSelectability:YES];
- [[[tablesListInstance valueForKey:@"tablesListView"] onMainThread] deselectAll:self];
- [[tablesListInstance onMainThread] setTableListSelectability:NO];
+ else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeInputField]) {
+ if([[[NSApp mainWindow] firstResponder] isKindOfClass:[NSTextView class]])
+ [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForInputField:aMenuItem];
}
}
- [self endTask];
[taskPool drain];
+
}
@end