aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-10-27 02:10:26 +0000
committerrowanbeentje <rowan@beent.je>2009-10-27 02:10:26 +0000
commitf90186c282f37878f9c80b41a478bcde4af74502 (patch)
tree66851f80f1c74ca5f9668f35ae2487e336b8dc8a /Source/CustomQuery.m
parenta99b0940d264ffbc4c525c5f17049f64e391ccc3 (diff)
downloadsequelpro-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/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m17
1 files changed, 14 insertions, 3 deletions
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 -