From 7864bf91a63ad879ef1c6edc6a10b9dc1f932e12 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sun, 30 Nov 2008 01:08:53 +0000 Subject: Fix for issue 53. --- TableDocument.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/TableDocument.m b/TableDocument.m index f9805288..f3fe760a 100644 --- a/TableDocument.m +++ b/TableDocument.m @@ -1052,7 +1052,17 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa invoked before a query is performed */ { - [queryProgressBar startAnimation:self]; + // Only start the progress indicator is 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]; + } } - (void)hasPerformedQuery:(NSNotification *)notification @@ -1060,7 +1070,9 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa invoked after a query has been performed */ { - [queryProgressBar stopAnimation:self]; + if ([tableWindow isKeyWindow]) { + [queryProgressBar stopAnimation:self]; + } } - (void)applicationWillTerminate:(NSNotification *)notification -- cgit v1.2.3