| 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 | } |
|---|