Adium

Changeset 14062

Show
Ignore:
Timestamp:
11/19/2005 06:01:12 AM (3 years ago)
Author:
evands
Message:

Improved wording in the delete contact dialogue. Fixes #2017

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/AIContactListEditorPlugin.m

    r12821 r14062  
    280280{ 
    281281        if (array) { 
    282                 int count = [array count]; 
    283                  
    284                 NSString        *name = ((count == 1) ? 
    285                                                          [[array objectAtIndex:0] displayName] :  
    286                                                          [NSString stringWithFormat:AILocalizedString(@"%i contacts",nil),count]); 
     282                NSString        *message; 
     283                int                     count = [array count]; 
     284 
     285                if (count == 1) { 
     286                        AIListObject    *listObject = [array objectAtIndex:0]; 
     287                        NSString                *name = [listObject displayName]; 
     288                        if ([listObject isKindOfClass:[AIListGroup class]]) { 
     289                                message = [NSString stringWithFormat:AILocalizedString(@"This will remove the group \"%@\" from the contact lists of your online accounts. The %i contacts within this group will also be removed.\n\nThis action can not be undone.",nil), 
     290                                        name, 
     291                                        [(AIListGroup *)listObject containedObjectsCount]]; 
     292                                 
     293                        } else { 
     294                                message = [NSString stringWithFormat:AILocalizedString(@"This will remove %@ from the contact lists of your online accounts.",nil), name]; 
     295                        } 
     296                } else { 
     297                        BOOL            containsGroup = NO; 
     298                        NSEnumerator *enumerator = [array objectEnumerator]; 
     299                        AIListObject *listObject; 
     300                         
     301                        while ((listObject = [enumerator nextObject]) && !containsGroup) { 
     302                                containsGroup = [listObject isKindOfClass:[AIListGroup class]]; 
     303                        } 
     304 
     305                        if (containsGroup) { 
     306                                message = [NSString stringWithFormat:AILocalizedString(@"This will remove %i items from the contact lists of your online accounts. Contacts in any deleted groups will also be removed.\n\nThis action can not be undone.",nil), count]; 
     307                        } else { 
     308                                message = [NSString stringWithFormat:AILocalizedString(@"This will remove %i contacts from the contact lists of your online accounts.",nil), count]; 
     309                        } 
     310                } 
    287311                 
    288312                //Make sure we're in the front so our prompt is visible 
     
    291315                //Guard deletion with a warning prompt           
    292316                int result = NSRunAlertPanel(AILocalizedString(@"Remove from list?",nil), 
    293                                                                          [NSString stringWithFormat:AILocalizedString(@"This will remove %@ from the contact lists of your online accounts.",nil), name]
     317                                                                         message
    294318                                                                         AILocalizedString(@"Remove",nil), 
    295319                                                                         AILocalizedString(@"Cancel",nil),