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/TablesList.m | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Source/TablesList.m') diff --git a/Source/TablesList.m b/Source/TablesList.m index 5be863fd..bb5f80ec 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -1113,6 +1113,14 @@ return [filteredTables objectAtIndex:rowIndex]; } +/** + * Prevent table renames while tasks are active + */ +- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex +{ + return ![tableDocumentInstance isWorking]; +} + /** * Renames a table (in tables-array and mysql-db). */ @@ -1261,6 +1269,10 @@ */ - (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView { + + // Don't allow selection changes while performing a task + if ([tableDocumentInstance isWorking]) return NO; + // End editing (otherwise problems when user hits reload button) [tableWindow endEditingFor:nil]; @@ -1302,6 +1314,10 @@ */ - (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(int)rowIndex { + + // Disallow selection while the document is working on a task + if ([tableDocumentInstance isWorking]) return NO; + //return (rowIndex != 0); if( [filteredTableTypes count] == 0 ) return (rowIndex != 0 ); @@ -1545,7 +1561,6 @@ // Only proceed if the notification was received from the current document. if ([aNotification object] != tableDocumentInstance) return; - [tablesListView setEnabled:NO]; [toolbarAddButton setEnabled:NO]; [toolbarActionsButton setEnabled:NO]; [toolbarReloadButton setEnabled:NO]; @@ -1558,7 +1573,6 @@ { if ([aNotification object] != tableDocumentInstance) return; - [tablesListView setEnabled:YES]; [toolbarAddButton setEnabled:YES]; [toolbarActionsButton setEnabled:YES]; [toolbarReloadButton setEnabled:YES]; -- cgit v1.2.3