aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-10-21 00:39:34 +0200
committerMax <post@wickenrode.com>2015-10-21 00:39:34 +0200
commitffbf7a4a9d4c617afd47a5428a17e0646b9bce97 (patch)
tree9fe49434f160567671b1fe844b1fd590db1108af /Source/SPCustomQuery.m
parent5357fd1375d19a6c5de96293b3899f430422a3c0 (diff)
downloadsequelpro-ffbf7a4a9d4c617afd47a5428a17e0646b9bce97.tar.gz
sequelpro-ffbf7a4a9d4c617afd47a5428a17e0646b9bce97.tar.bz2
sequelpro-ffbf7a4a9d4c617afd47a5428a17e0646b9bce97.zip
Fix bundle commands no longer working in popup field editor (and possibly other cases) (#2299)
Replacing some [NSApp mainWindow] with their actually intended calls [NSApp keyWindow] and [view window]
Diffstat (limited to 'Source/SPCustomQuery.m')
-rw-r--r--Source/SPCustomQuery.m9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 7b446237..4737bea8 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -2583,16 +2583,17 @@
if(!correspondingWindowFound) stopTrigger = YES;
}
if(!stopTrigger) {
+ id firstResponder = [[NSApp keyWindow] firstResponder];
if([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) {
[[SPAppDelegate onMainThread] executeBundleItemForApp:aMenuItem];
}
else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) {
- if([[[[[NSApp mainWindow] firstResponder] class] description] isEqualToString:@"SPCopyTable"])
- [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForDataTable:aMenuItem];
+ if([[[firstResponder class] description] isEqualToString:@"SPCopyTable"])
+ [[firstResponder onMainThread] executeBundleItemForDataTable:aMenuItem];
}
else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeInputField]) {
- if([[[NSApp mainWindow] firstResponder] isKindOfClass:[NSTextView class]])
- [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForInputField:aMenuItem];
+ if([firstResponder isKindOfClass:[NSTextView class]])
+ [[firstResponder onMainThread] executeBundleItemForInputField:aMenuItem];
}
}
}