From f90186c282f37878f9c80b41a478bcde4af74502 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 27 Oct 2009 02:10:26 +0000 Subject: - 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. --- Source/CustomQuery.m | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Source/CustomQuery.m') diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 2df3227e..00201015 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1442,6 +1442,9 @@ - (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn *)tableColumn { + // Prevent sorting while a query is running + if ([tableDocumentInstance isWorking]) return; + NSMutableString *queryString = [NSMutableString stringWithString:lastExecutedQuery]; //sets order descending if a header is clicked twice @@ -1671,6 +1674,9 @@ - (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { + // Only allow editing if a task is not active + if ([tableDocumentInstance isWorking]) return NO; + // Check if the field can identified bijectively if ( aTableView == customQueryView ) { @@ -1760,6 +1766,14 @@ } } +/** + * Prevent the selection of rows while the table is still loading + */ +- (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(NSInteger)rowIndex +{ + return ![tableDocumentInstance isWorking]; +} + #pragma mark - #pragma mark TableView notifications @@ -2554,7 +2568,6 @@ || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToRunQueryToolbarItemIdentifier"]) return; - [customQueryView setEnabled:NO]; [runSelectionButton setEnabled:NO]; [runSelectionMenuItem setEnabled:NO]; [runAllButton setEnabled:NO]; @@ -2579,8 +2592,6 @@ } [runAllButton setEnabled:YES]; [runAllMenuItem setEnabled:YES]; - [customQueryView setEnabled:YES]; - [customQueryView displayIfNeeded]; } #pragma mark - -- cgit v1.2.3