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/CustomQuery.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/CustomQuery.m')
-rw-r--r-- | Source/CustomQuery.m | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 108d360e..2df3227e 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -2548,8 +2548,11 @@ - (void) startDocumentTaskForTab:(NSNotification *)aNotification { - // Only disable elements if the current tab is the content view - if (![[aNotification object] isEqualToString:@"SwitchToRunQueryToolbarItemIdentifier"]) 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:@"SwitchToRunQueryToolbarItemIdentifier"]) + return; [customQueryView setEnabled:NO]; [runSelectionButton setEnabled:NO]; @@ -2564,8 +2567,11 @@ - (void) endDocumentTaskForTab:(NSNotification *)aNotification { - // Only enable elements if the current tab is the content view - if (![[aNotification object] isEqualToString:@"SwitchToRunQueryToolbarItemIdentifier"]) 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:@"SwitchToRunQueryToolbarItemIdentifier"]) + return; if (selectionButtonCanBeEnabled) { [runSelectionButton setEnabled:YES]; |