diff options
author | rowanbeentje <rowan@beent.je> | 2009-11-05 00:00:23 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-11-05 00:00:23 +0000 |
commit | 4cc035fd625bc2ee76927cf9e7649af829ce8482 (patch) | |
tree | 170a8ac6da319e002f48e1ca561f55f5177d4209 /Source/TableDocument.m | |
parent | 97fd0957cef34210caece133fee16a370e5b9f5d (diff) | |
download | sequelpro-4cc035fd625bc2ee76927cf9e7649af829ce8482.tar.gz sequelpro-4cc035fd625bc2ee76927cf9e7649af829ce8482.tar.bz2 sequelpro-4cc035fd625bc2ee76927cf9e7649af829ce8482.zip |
- Alter query start/stop notifications to apply to only the originating window, regardless of key state, by passing in and looking for the table document instance
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 089c6306..211c37c0 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -2148,17 +2148,7 @@ */ - (void)willPerformQuery:(NSNotification *)notification { - // Only start the progress indicator if this document window is key. - // Because we are starting the progress indicator based on the notification - // of a query being started, we have to prevent other windows from - // starting theirs. The same is also true for the below hasPerformedQuery: - // method. - // - // This code should be removed. Updating user interface elements based on - // notifications is bad practice as notifications are global to the application. - if ([tableWindow isKeyWindow]) { - [queryProgressBar startAnimation:self]; - } + [queryProgressBar startAnimation:self]; } /** @@ -2166,9 +2156,7 @@ */ - (void)hasPerformedQuery:(NSNotification *)notification { - if ([tableWindow isKeyWindow]) { - [queryProgressBar stopAnimation:self]; - } + [queryProgressBar stopAnimation:self]; } /** @@ -3273,9 +3261,9 @@ //register for notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willPerformQuery:) - name:@"SMySQLQueryWillBePerformed" object:nil]; + name:@"SMySQLQueryWillBePerformed" object:self]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hasPerformedQuery:) - name:@"SMySQLQueryHasBeenPerformed" object:nil]; + name:@"SMySQLQueryHasBeenPerformed" object:self]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:@"NSApplicationWillTerminateNotification" object:nil]; |