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 03:27:25 +0200
commitb089a0d3249d3139bedc2679a36efa705d2bae04 (patch)
treedf43a2984520b318f0b8c281d85f2defd72d3943 /Source/SPCustomQuery.m
parent91abde0c94df8bd7f63bd4e5d062562b0827adbd (diff)
downloadsequelpro-b089a0d3249d3139bedc2679a36efa705d2bae04.tar.gz
sequelpro-b089a0d3249d3139bedc2679a36efa705d2bae04.tar.bz2
sequelpro-b089a0d3249d3139bedc2679a36efa705d2bae04.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 a6e14b34..9289f2ce 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -2563,16 +2563,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];
}
}
}