diff options
author | rowanbeentje <rowan@beent.je> | 2009-10-27 02:10:26 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-10-27 02:10:26 +0000 |
commit | f90186c282f37878f9c80b41a478bcde4af74502 (patch) | |
tree | 66851f80f1c74ca5f9668f35ae2487e336b8dc8a /Source/TableContent.m | |
parent | a99b0940d264ffbc4c525c5f17049f64e391ccc3 (diff) | |
download | sequelpro-f90186c282f37878f9c80b41a478bcde4af74502.tar.gz sequelpro-f90186c282f37878f9c80b41a478bcde4af74502.tar.bz2 sequelpro-f90186c282f37878f9c80b41a478bcde4af74502.zip |
- When performing threaded data loads, no longer disable the tables and instead prevent selection/editing/sorting in code; this prevents the tableviews from going grey during the load and minimises flicker and loss of focussed elements.
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r-- | Source/TableContent.m | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m index 156b46ab..b8626866 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -2426,12 +2426,15 @@ if clicked twice, order is descending */ { - + if ( [selectedTable isEqualToString:@""] || !selectedTable ) return; // Check whether a save of the current row is required. if ( ![self saveRowOnDeselect] ) return; + + // Prevent sorting while the table is still loading + if ([tableDocumentInstance isWorking]) return; //sets order descending if a header is clicked twice if ( [[tableColumn identifier] isEqualTo:sortCol] ) { @@ -2531,6 +2534,7 @@ */ - (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { + if ([tableDocumentInstance isWorking]) return NO; // Ensure that row is editable since it could contain "(not loaded)" columns together with // issue that the table has no primary key @@ -2630,6 +2634,14 @@ return NO; } +/** + * Disable row selection while the document is working. + */ +- (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(NSInteger)rowIndex +{ + return ![tableDocumentInstance isWorking]; +} + #pragma mark - #pragma mark SplitView delegate methods @@ -2663,7 +2675,6 @@ || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) return; - [tableContentView setEnabled:NO]; [addButton setEnabled:NO]; [removeButton setEnabled:NO]; [copyButton setEnabled:NO]; @@ -2690,8 +2701,6 @@ } [reloadButton setEnabled:YES]; [filterButton setEnabled:[fieldField isEnabled]]; - [tableContentView setEnabled:YES]; - [tableContentView displayIfNeeded]; } #pragma mark - |