diff options
author | stuconnolly <stuart02@gmail.com> | 2012-04-29 10:08:52 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-04-29 10:08:52 +0000 |
commit | fb3b03a7d96870cc3829a8c1d01b37267866e8e7 (patch) | |
tree | 6ec3239fcdf8085273c53359e0a6ea58ed421706 /Source/SPWindow.m | |
parent | 4cad6f0e6e4fb497b480256c2abe3de34ebf225c (diff) | |
download | sequelpro-fb3b03a7d96870cc3829a8c1d01b37267866e8e7.tar.gz sequelpro-fb3b03a7d96870cc3829a8c1d01b37267866e8e7.tar.bz2 sequelpro-fb3b03a7d96870cc3829a8c1d01b37267866e8e7.zip |
Bring outline view branch up to date with trunk (r3586:r3592).
Diffstat (limited to 'Source/SPWindow.m')
-rw-r--r-- | Source/SPWindow.m | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/SPWindow.m b/Source/SPWindow.m index 0285ce8a..d023b7b4 100644 --- a/Source/SPWindow.m +++ b/Source/SPWindow.m @@ -27,6 +27,8 @@ @implementation SPWindow +@synthesize isSheetWhichCanBecomeMain; + #pragma mark - #pragma mark Keyboard shortcut additions @@ -116,6 +118,9 @@ [super sendEvent:theEvent]; } +#pragma mark - +#pragma mark Undo manager handling + /** * If this window is controlled by an SPWindowController, and thus supports being asked * for the frontmost SPTableDocument, request the undoController for that table @@ -130,4 +135,27 @@ return [super undoManager]; } +#pragma mark - +#pragma mark Method overrides + +/** + * Allow sheets to become main if necessary, for example if they are acting as an + * editor for a window. + */ +- (BOOL)canBecomeMainWindow +{ + + // If this window is a sheet which is permitted to become main, respond appropriately + if ([self isSheet] && isSheetWhichCanBecomeMain) { + return [self isVisible]; + } + + // Otherwise, if this window has a sheet attached which can become main, return NO. + if ([[self attachedSheet] isKindOfClass:[SPWindow class]] && [(SPWindow *)[self attachedSheet] isSheetWhichCanBecomeMain]) { + return NO; + } + + return [super canBecomeMainWindow]; +} + @end |