aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-07-23 00:35:01 +0000
committerrowanbeentje <rowan@beent.je>2012-07-23 00:35:01 +0000
commitea1516eeb991cedd2ea8d86d65fef4b102996b2b (patch)
treed2c128b5ad0f68b974e3c5e2a44c1c49fd33ce7f /Source/SPDatabaseDocument.m
parent78b52f5a0cea1fc1d0c944f5408e7ef41d0ca2d6 (diff)
downloadsequelpro-ea1516eeb991cedd2ea8d86d65fef4b102996b2b.tar.gz
sequelpro-ea1516eeb991cedd2ea8d86d65fef4b102996b2b.tar.bz2
sequelpro-ea1516eeb991cedd2ea8d86d65fef4b102996b2b.zip
- Add a new SPSplitView class, intended to replace all BWSplitViews and so allow us to remove BWToolKit. Supports constraints and animated collapsible subviews configured in code, fixes crashes and exceptions if a window is closed while animations are taking place or scheduled to take place.
- Replace the two vertical splitters in the table list (the filter splitter, and the table info splitter) with SPSplitView implementations as a test - Add a helper method in the new SPDateAdditions
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m21
1 files changed, 3 insertions, 18 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 5f7cb49a..0cfec364 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -528,10 +528,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
// Set focus to table list filter field if visible
// otherwise set focus to Table List view
- if ([[tablesListInstance tables] count] > 20)
- [parentWindow makeFirstResponder:listFilterField];
- else
- [parentWindow makeFirstResponder:[tablesListInstance valueForKeyPath:@"tablesListView"]];
+ [self focusOnTableListFilter:self];
if (spfSession != nil) {
@@ -2296,7 +2293,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
*/
- (IBAction)focusOnTableListFilter:(id)sender
{
- [tablesListInstance performSelector:@selector(makeTableListFilterHaveFocus) withObject:nil afterDelay:0.1];
+ [[tablesListInstance onMainThread] performSelector:@selector(makeTableListFilterHaveFocus) withObject:nil afterDelay:0.25];
}
/**
@@ -5575,13 +5572,6 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
#pragma mark -
#pragma mark SplitView delegate methods
#ifndef SP_REFACTOR /* SplitView delegate methods */
-/**
- * tells the splitView that it can collapse views
- */
-- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview
-{
- return subview == [[tableInfoTable superview] superview];
-}
- (void)splitViewDidResizeSubviews:(NSNotification *)notification
{
@@ -6071,12 +6061,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
// Set focus to table list filter field if visible
// otherwise set focus to Table List view
- if ([[tablesListInstance tables] count] > 20) {
- [[parentWindow onMainThread] makeFirstResponder:listFilterField];
- }
- else {
- [[parentWindow onMainThread] makeFirstResponder:[tablesListInstance valueForKeyPath:@"tablesListView"]];
- }
+ [self focusOnTableListFilter:self];
#endif
}