Revision: 18292
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18292&view=rev
Author:   hofman
Date:     2011-12-05 12:07:57 +0000 (Mon, 05 Dec 2011)
Log Message:
-----------
only animate file matcher progress indicator when indexing

Modified Paths:
--------------
    trunk/bibdesk/BDSKFileMatcher.m

Modified: trunk/bibdesk/BDSKFileMatcher.m
===================================================================
--- trunk/bibdesk/BDSKFileMatcher.m     2011-12-05 11:07:09 UTC (rev 18291)
+++ trunk/bibdesk/BDSKFileMatcher.m     2011-12-05 12:07:57 UTC (rev 18292)
@@ -76,6 +76,7 @@
 
 // only use from main thread
 - (void)updateProgressIndicatorWithNumber:(NSNumber *)val;
+- (void)indexingFinished;
 
 // entry point to the searching/matching; acquire indexingLock first
 - (void)indexFiles:(NSArray *)absoluteURLs;
@@ -201,6 +202,7 @@
     // for the progress indicator
     [[self window] makeKeyAndOrderFront:self];
     [abortButton setEnabled:YES];
+    [progressIndicator startAnimation:nil];
 
     OSAtomicCompareAndSwap32Barrier(0, 1, &_matchFlags.shouldAbortThread);
     
@@ -235,6 +237,7 @@
     if (false == OSAtomicCompareAndSwap32Barrier(0, 1, 
&_matchFlags.shouldAbortThread))
         NSBeep();
     [abortButton setEnabled:NO];
+    [progressIndicator stopAnimation:nil];
 }
 
 - (void)configSheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)code 
contextInfo:(void *)context;
@@ -556,6 +559,12 @@
     [progressIndicator setDoubleValue:[val doubleValue]];
 }
 
+- (void)indexingFinished
+{
+    [abortButton setEnabled:NO];
+    [progressIndicator stopAnimation:nil];
+}
+
 - (void)indexFiles:(NSArray *)absoluteURLs;
 {    
     NSAutoreleasePool *threadPool = [NSAutoreleasePool new];
@@ -599,11 +608,8 @@
         [statusField performSelectorOnMainThread:@selector(setStringValue:) 
withObject:NSLocalizedString(@"Indexing aborted.", @"") waitUntilDone:NO];
     }
 
-    // disable the stop button
-    BOOL state = NO;
-    NSInvocation *invocation = [NSInvocation invocationWithTarget:abortButton 
selector:@selector(setEnabled:)];
-    [invocation setArgument:&state atIndex:2];
-    [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil 
waitUntilDone:YES];
+    // disable the stop button and progress animation
+    [self performSelectorOnMainThread:@selector(indexingFinished) 
withObject:nil waitUntilDone:YES];
     
     [indexingLock unlock];
     [threadPool release];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to