diff options
author | stuconnolly <stuart02@gmail.com> | 2013-01-25 21:03:35 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2013-01-25 21:03:35 +0000 |
commit | 23833c899c531705557443da649c1f13701dc197 (patch) | |
tree | fc949bda39b7532841a47b502ceb1ccd1c436538 /Source/SPTableView.m | |
parent | b442a9920d8e873c4df7b84799aa49e551922e2d (diff) | |
download | sequelpro-23833c899c531705557443da649c1f13701dc197.tar.gz sequelpro-23833c899c531705557443da649c1f13701dc197.tar.bz2 sequelpro-23833c899c531705557443da649c1f13701dc197.zip |
Fix more warnings.
Diffstat (limited to 'Source/SPTableView.m')
-rw-r--r-- | Source/SPTableView.m | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/Source/SPTableView.m b/Source/SPTableView.m index 8ec61f0a..61c63c75 100644 --- a/Source/SPTableView.m +++ b/Source/SPTableView.m @@ -42,7 +42,7 @@ @end -@interface SPTableView (PrivateAPI) +@interface SPTableView () - (void)_doubleClickAction; - (void)_disableDoubleClickAction:(NSNotification *)notification; @@ -50,32 +50,37 @@ @end - @implementation SPTableView @synthesize tabEditingDisabled; -- (id) init +- (id)init { if ((self = [super init])) { emptyDoubleClickAction = NULL; } + return self; } -- (void) awakeFromNib +- (void)awakeFromNib { [super setDoubleAction:@selector(_doubleClickAction)]; - if ([NSTableView instancesRespondToSelector:@selector(awakeFromNib)]) + + if ([NSTableView instancesRespondToSelector:@selector(awakeFromNib)]) { [super awakeFromNib]; + } } +#pragma mark - + /** * Track window changes, in order to add listeners for when sheets are shown * or hidden; this allows the double-click action to be disabled while sheets * are open, preventing beeps when using the field editor on double-click. */ -- (void) viewWillMoveToWindow:(NSWindow *)aWindow { +- (void)viewWillMoveToWindow:(NSWindow *)aWindow +{ NSNotificationCenter *notifier = [NSNotificationCenter defaultCenter]; [notifier removeObserver:self name:NSWindowWillBeginSheetNotification object:nil]; @@ -87,8 +92,6 @@ } } -#pragma mark - - /** * Right-click at row will select that row before ordering out the contextual menu * if not more than one row is selected. @@ -100,7 +103,7 @@ SPDatabaseDocument *parentTableDocument = nil; if ([[[[[self window] delegate] class] description] isEqualToString:@"SPWindowController"]) { - parentTableDocument = [[[self window] delegate] selectedTableDocument]; + parentTableDocument = [(SPWindowController *)[[self window] delegate] selectedTableDocument]; } // If SPDatabaseDocument is performing a task suppress any context menu @@ -150,11 +153,14 @@ * display instead; this prevents the selected cell from automatically editing * if the table is backtabbed to. */ -- (BOOL)becomeFirstResponder { +- (BOOL)becomeFirstResponder +{ if (tabEditingDisabled) { [self display]; + return YES; } + return [super becomeFirstResponder]; } @@ -208,9 +214,11 @@ else if (tabEditingDisabled && [[theEvent characters] length] && [[theEvent characters] characterAtIndex:0] == NSTabCharacter) { if (([theEvent modifierFlags] & NSShiftKeyMask) != NSShiftKeyMask) { [[self window] selectKeyViewFollowingView:self]; - } else { + } + else { [[self window] selectKeyViewPrecedingView:self]; } + return; } @@ -277,11 +285,6 @@ #endif -@end - - -@implementation SPTableView (PrivateAPI) - /** * On a double click, determine whether the action was in the empty area * of the current table; if so, perform the assigned emptyDoubleClick action. |