Adium

Changeset 15997

Show
Ignore:
Timestamp:
05/19/2006 01:54:41 AM (3 years ago)
Author:
catfish_man
Message:

Starts of an 'xtra not found' notification system. Refs #3980

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plugins/WebKit Message View/AIWebKitMessageViewPlugin.m

    r15845 r15997  
    117117        //If the style isn't available, use our default.  Or, failing that, any available style 
    118118        if (!bundle) { 
     119                NSError *error = [NSError errorWithDomain:@"AIXtraErrors" 
     120                                                                                         code:0 
     121                                                                                 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
     122                                                                                         @"Couldn't find a message view style", NSLocalizedDescriptionKey, 
     123                                                                                         @"This is probably because the style is not included in this version of Adium", NSLocalizedFailureReasonErrorKey, 
     124                                                                                         @"Adium will revert to the default message style, but you can find the missing one on the Xtras website", NSLocalizedRecoverySuggestionErrorKey, 
     125                                                                                         [NSArray arrayWithObjects:@"Open Xtras Website", @"Continue", nil], NSLocalizedRecoveryOptionsErrorKey, nil]]; 
     126                [[adium notificationCenter] postNotificationName:@"AIXtraNotFound" 
     127                                                                                                                        object:nil 
     128                                                                                                                  userInfo:[NSDictionary dictionaryWithObject:error forKey:@"AIXtraNotFoundError"]]; 
    119129                bundle = [styles objectForKey:WEBKIT_DEFAULT_STYLE]; 
    120130                if (!bundle) 
  • trunk/Source/AIXtrasManager.m

    r15965 r15997  
    4141{ 
    4242        manager = self; 
     43        [[adium notificationCenter] addObserver:manager 
     44                                                                   selector:@selector(xtraNotFound:) 
     45                                                                           name:@"AIXtraNotFound" 
     46                                                                         object:nil]; 
    4347} 
    4448 
     
    100104        //Now redisplay our current category, in case it changed 
    101105        [self setCategory:nil]; 
     106} 
     107 
     108- (void) xtraNotFound:(NSNotification *)not 
     109{ 
     110        NSError *error = [[not userInfo] objectForKey:@"AIXtraNotFoundError"]; 
     111#warning gbooker: maybe we should switch this to use that class you mentioned from Fire, since there may be multiple xtras not found 
     112        NSAlert *alert = [NSAlert alertWithError:error]; 
     113        int returnval = [alert runModal]; 
     114         
     115        if(returnval ==  NSAlertFirstButtonReturn) 
     116                [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.adiumxtras.com"]]; 
    102117} 
    103118