diff options
author | rowanbeentje <rowan@beent.je> | 2009-10-27 01:24:00 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-10-27 01:24:00 +0000 |
commit | a99b0940d264ffbc4c525c5f17049f64e391ccc3 (patch) | |
tree | 2a8c20d71f0d15ff66bf464805542cf1f0e8b9cd /Source/TableContent.m | |
parent | 9e6adb426de189704f0d0fe09b926b286dbb813e (diff) | |
download | sequelpro-a99b0940d264ffbc4c525c5f17049f64e391ccc3.tar.gz sequelpro-a99b0940d264ffbc4c525c5f17049f64e391ccc3.tar.bz2 sequelpro-a99b0940d264ffbc4c525c5f17049f64e391ccc3.zip |
- Set up TableSource to respond to task notifications to prepare for threaded queries
- Alter task notifications to pass the TableDocument as the notification object so that only the current window responds to the notification, allowing other windows to be fully used while a window is performing a task
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r-- | Source/TableContent.m | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m index 4286723a..156b46ab 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -2657,8 +2657,11 @@ - (void) startDocumentTaskForTab:(NSNotification *)aNotification { - // Only disable elements if the current tab is the content view - if (![[aNotification object] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) return; + // Only proceed if the current document is the notifying document, and only if + // this view is selected. + if ([aNotification object] != tableDocumentInstance + || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) + return; [tableContentView setEnabled:NO]; [addButton setEnabled:NO]; @@ -2674,8 +2677,11 @@ - (void) endDocumentTaskForTab:(NSNotification *)aNotification { - // Only enable elements if the current tab is the content view - if (![[aNotification object] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) return; + // Only proceed if the current document is the notifying document, and only if + // this view is selected. + if ([aNotification object] != tableDocumentInstance + || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) + return; if ( ![[[tableDataInstance statusValues] objectForKey:@"Rows"] isNSNull] && selectedTable && [selectedTable length] && [tableDataInstance tableEncoding]) [addButton setEnabled:YES]; if ([tableContentView numberOfSelectedRows] > 0) { |