aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TablesList.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/TablesList.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/TablesList.m')
-rw-r--r--Source/TablesList.m18
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m
index 5be863fd..bb5f80ec 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -1114,6 +1114,14 @@
}
/**
+ * 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).
*/
- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
@@ -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];