aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TablesList.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-10-20 23:45:16 +0000
committerrowanbeentje <rowan@beent.je>2009-10-20 23:45:16 +0000
commit951330376a7b1e85dea0c44825534a4ab598c100 (patch)
tree1f098f10b4eebd660c9e2fcf1ea2926f1efbc24b /Source/TablesList.m
parent53ca17c5bba2d57ecaee3a8ccd005fe4d6a4abe3 (diff)
downloadsequelpro-951330376a7b1e85dea0c44825534a4ab598c100.tar.gz
sequelpro-951330376a7b1e85dea0c44825534a4ab598c100.tar.bz2
sequelpro-951330376a7b1e85dea0c44825534a4ab598c100.zip
Initial work on threaded task, with an implementation of Table Content view data loading:
- Removal of AMIndeterminateProgressIndicatorCell, and addition of a custom fork of YRKSpinningProgressIndicator which fixes bugs, adds threaded drawing, and adds a determinate mode. - Addition of a task system within TableDocument, triggering display of a large central progress indicator and stopping the window from being interacted with in any way that would cause a query while the task is running. - Add threaded TableContent content fetching, including use of the new task system and determinate progress bar; make fixes to improve threading stability and interaction.
Diffstat (limited to 'Source/TablesList.m')
-rw-r--r--Source/TablesList.m36
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m
index 348fb033..4e2aecef 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -1535,6 +1535,31 @@
}
#pragma mark -
+#pragma mark Task interaction
+
+/**
+ * Disable all table list interactive elements during an ongoing task.
+ */
+- (void) startDocumentTaskForTab:(NSNotification *)aNotification
+{
+ [tablesListView setEnabled:NO];
+ [toolbarAddButton setEnabled:NO];
+ [toolbarActionsButton setEnabled:NO];
+ [toolbarReloadButton setEnabled:NO];
+}
+
+/**
+ * Enable all table list interactive elements after an ongoing task.
+ */
+- (void) endDocumentTaskForTab:(NSNotification *)aNotification
+{
+ [tablesListView setEnabled:YES];
+ [toolbarAddButton setEnabled:YES];
+ [toolbarActionsButton setEnabled:YES];
+ [toolbarReloadButton setEnabled:YES];
+}
+
+#pragma mark -
#pragma mark SplitView Delegate Methods
- (NSRect)splitView:(NSSplitView *)splitView effectiveRect:(NSRect)proposedEffectiveRect forDrawnRect:(NSRect)drawnRect ofDividerAtIndex:(NSInteger)dividerIndex
@@ -1594,6 +1619,15 @@
[tableListFilterSplitView setCollapsibleSubviewCollapsed:YES];
}
+ // Add observers for document task activity
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(startDocumentTaskForTab:)
+ name:SPDocumentTaskStartNotification
+ object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(endDocumentTaskForTab:)
+ name:SPDocumentTaskEndNotification
+ object:nil];
}
/**
@@ -1601,6 +1635,8 @@
*/
- (void)dealloc
{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
[tables release];
[tableTypes release];
if (isTableListFiltered && filteredTables) [filteredTables release];