aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldEditorController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-04-24 00:05:50 +0000
committerrowanbeentje <rowan@beent.je>2012-04-24 00:05:50 +0000
commit76d1d9d7fe2046bcf9281f95c5a7b541d49e6a0b (patch)
treea582f71ba9e26440db2b4aa28a24f0824796239e /Source/SPFieldEditorController.m
parent3b079c8d06ee5676190c9f11aec3b64f4631b048 (diff)
downloadsequelpro-76d1d9d7fe2046bcf9281f95c5a7b541d49e6a0b.tar.gz
sequelpro-76d1d9d7fe2046bcf9281f95c5a7b541d49e6a0b.tar.bz2
sequelpro-76d1d9d7fe2046bcf9281f95c5a7b541d49e6a0b.zip
- Rework edit sheet find/replace handling; instead of altering the main window's firstResponder, which only worked under certain NSTextView focus conditions, allow the field edit sheet to become the main window. This fixes issues with the Find/Replace dialog not fully working correctly in the edit sheet.
Diffstat (limited to 'Source/SPFieldEditorController.m')
-rw-r--r--Source/SPFieldEditorController.m17
1 files changed, 5 insertions, 12 deletions
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index 3a4ee14c..f94af537 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -32,6 +32,7 @@
#import "SPTooltip.h"
#import "SPGeometryDataView.h"
#import "SPCopyTable.h"
+#import "SPWindow.h"
#include <objc/objc-runtime.h>
#import "SPCustomQuery.h"
#import "SPTableContent.h"
@@ -85,6 +86,10 @@
// Allow the user to enter cmd+return to close the edit sheet in addition to fn+return
[editSheetOkButton setKeyEquivalentModifierMask:NSCommandKeyMask];
+ // Permit the field edit sheet to become main if necessary; this allows fields within the sheet to
+ // support full interactivity, for example use of the NSFindPanel inside NSTextViews.
+ [editSheet setIsSheetWhichCanBecomeMain:YES];
+
allowUndo = NO;
selectionChanged = NO;
@@ -431,19 +436,7 @@
editSheetWillBeInitialized = NO;
[editSheetProgressBar stopAnimation:self];
-
- // The field editor sheet runs as sheet thus a NSTextView won't respond to the Find Panel
- // since the Find Panel validate its buttons against [[NSApp mainWindow] firstResponder] == NSTextView.
- // After ordering out this sheet SPCopyTable remains the first responder thus set it hard.
- // This only works in conjunction with [NSTextView becomeFirstResponder] and [NSTextView resignFirstResponder]
- // which has to return YES.
-#ifndef SP_REFACTOR
- if([[self window] firstResponder] == editTextView)
- [[NSApp mainWindow] makeFirstResponder:[[self window] firstResponder]];
-#endif
-
}
-
}
/**