Show
Ignore:
Timestamp:
07/29/08 16:35:01 (4 months ago)
Author:
astrange
Message:

Delete progress indicators from the prefpane, they're ugly and pointless.
Get rid of alert panels in the update checker and use IPC to show them in the prefpane instead.
Fix the update checker never cleaning up its locks.
Synchronize user defaults more often since it seems necessary.
Delete code for not running too often in the update checker, it's a duplicate of the same more-maintained code in Perian.

This requires merging the nib into release branch again...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CPFPerianPrefPaneController.m

    r909 r917  
    401401 
    402402- (void) dealloc { 
     403        [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:UPDATE_STATUS_NOTIFICATION object:nil]; 
    403404        [perianForumURL release]; 
    404405        [perianDonateURL release]; 
     
    654655                auth = nil; 
    655656         
    656         int tag = 0; 
    657657        componentPath = [[self quickTimeComponentDir:userInstalled] stringByAppendingPathComponent:@"Perian.component"]; 
    658658        if(auth != nil && !userInstalled) 
     
    685685- (IBAction)installUninstall:(id)sender 
    686686{ 
    687         [progress_install startAnimation:sender]; 
    688687        if(installStatus == InstallStatusInstalled) 
    689688                [NSThread detachNewThreadSelector:@selector(uninstall:) toTarget:self withObject:nil]; 
     
    694693- (void)installComplete:(id)sender 
    695694{ 
    696         [progress_install stopAnimation:sender]; 
    697695        [self checkForInstallation]; 
    698696} 
    699697 
    700698#pragma mark Check Updates 
     699- (void)updateCheckStatusChanged:(NSNotification*)notification 
     700{ 
     701        NSString *status = [notification object]; 
     702         
     703        //FIXME localize these 
     704        if ([status isEqualToString:@"Starting"]) { 
     705                [textField_updateStatus setStringValue:@"Checking..."]; 
     706        } else if ([status isEqualToString:@"Error"]) { 
     707                [textField_updateStatus setStringValue:@"Couldn't reach the update server."]; 
     708        } else if ([status isEqualToString:@"NoUpdates"]) { 
     709                [textField_updateStatus setStringValue:@"There are no updates."]; 
     710        } else if ([status isEqualToString:@"NoUpdates"]) { 
     711                [textField_updateStatus setStringValue:@"Updates found!"]; 
     712        } 
     713} 
     714 
    701715- (IBAction)updateCheck:(id)sender  
    702716{ 
    703717        FSRef updateCheckRef; 
    704718         
     719        [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:UPDATE_STATUS_NOTIFICATION object:nil]; 
     720        [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(updateCheckStatusChanged:) name:UPDATE_STATUS_NOTIFICATION object:nil]; 
    705721        CFPreferencesSetAppValue((CFStringRef)NEXT_RUN_KEY, NULL, perianAppID); 
    706722        CFPreferencesSetAppValue((CFStringRef)MANUAL_RUN_KEY, [NSNumber numberWithBool:YES], perianAppID);