Ticket #344: KGContactBlockedPlugin2.diff
| File KGContactBlockedPlugin2.diff, 48.3 kB (added by Kiel Gillard, 3 years ago) |
|---|
-
Frameworks/Adium
old new 44 44 - (void)setOnline:(BOOL)online notify:(NotifyTiming)notify silently:(BOOL)silent; 45 45 - (void)setSignonDate:(NSDate *)signonDate notify:(NotifyTiming)notify; 46 46 - (NSDate *)signonDate; 47 - (void)setIsBlocked:(BOOL)yesOrNo; 47 48 48 49 - (void)setIdle:(BOOL)isIdle sinceDate:(NSDate *)idleSinceDate notify:(NotifyTiming)notify; 49 50 - (void)setServersideIconData:(NSData *)iconData notify:(NotifyTiming)notify; -
Frameworks/Adium
old new 26 26 27 27 #import <AIUtilities/AIMutableOwnerArray.h> 28 28 29 #define IS_BLOCKED_KEY @"isBlocked" 30 29 31 @implementation AIListContact 30 32 31 33 //Init with an account … … 446 448 notify:notify]; 447 449 } 448 450 451 /*! 452 * @brief Is this contact blocked? 453 */ 454 - (BOOL)isBlocked 455 { 456 return [self integerStatusObjectForKey:IS_BLOCKED_KEY]; 457 } 458 459 /*! 460 * @brief Set if this contact is blocked 461 */ 462 - (void)setIsBlocked:(BOOL)yesOrNo 463 { 464 [self setStatusObject:(yesOrNo ? [NSNumber numberWithBool:YES] : nil) 465 forKey:IS_BLOCKED_KEY 466 notify:NotifyNever]; 467 } 468 449 469 #pragma mark Status 450 470 451 471 /*! -
Frameworks/Adium
old new 31 31 #define KEY_LIST_LAYOUT_SHOW_EXT_STATUS @"Show Extended Status" 32 32 #define KEY_LIST_LAYOUT_SHOW_STATUS_ICONS @"Show Status Icons" 33 33 #define KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS @"Show Service Icons" 34 #define KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS @"Show Blocked Icons" 34 35 #define KEY_LIST_LAYOUT_WINDOW_STYLE @"Window Style" 35 36 36 37 #define KEY_LIST_LAYOUT_EXTENDED_STATUS_STYLE @"Extended Status Style" … … 38 39 #define KEY_LIST_LAYOUT_USER_ICON_POSITION @"User Icon Position" 39 40 #define KEY_LIST_LAYOUT_STATUS_ICON_POSITION @"Status Icon Position" 40 41 #define KEY_LIST_LAYOUT_SERVICE_ICON_POSITION @"Service Icon Position" 42 #define KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION @"Blocked Icon Position" 41 43 42 44 #define KEY_LIST_LAYOUT_CONTACT_SPACING @"Contact Spacing" 43 45 #define KEY_LIST_LAYOUT_GROUP_TOP_SPACING @"Group Top Spacing" -
Frameworks/Adium
old new 249 249 [contentCell setExtendedStatusVisible:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_EXT_STATUS] boolValue]]; 250 250 [contentCell setStatusIconsVisible:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_STATUS_ICONS] boolValue]]; 251 251 [contentCell setServiceIconsVisible:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS] boolValue]]; 252 [contentCell setBlockedIconVisible:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS] boolValue]]; 252 253 253 254 [contentCell setUserIconPosition:[[prefDict objectForKey:KEY_LIST_LAYOUT_USER_ICON_POSITION] intValue]]; 254 255 [contentCell setStatusIconPosition:[[prefDict objectForKey:KEY_LIST_LAYOUT_STATUS_ICON_POSITION] intValue]]; 255 256 [contentCell setServiceIconPosition:[[prefDict objectForKey:KEY_LIST_LAYOUT_SERVICE_ICON_POSITION] intValue]]; 257 [contentCell setBlockedIconPosition:[[prefDict objectForKey:KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION] intValue]]; 256 258 [contentCell setExtendedStatusIsBelowName:[[prefDict objectForKey:KEY_LIST_LAYOUT_EXTENDED_STATUS_POSITION] boolValue]]; 257 259 } else { 258 260 //Fitted pillows + centered text = no icons … … 261 263 [contentCell setUserIconVisible:(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_ICON] boolValue] : NO)]; 262 264 [contentCell setStatusIconsVisible:(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_STATUS_ICONS] boolValue] : NO)]; 263 265 [contentCell setServiceIconsVisible:(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS] boolValue] : NO)]; 266 [contentCell setBlockedIconVisible:(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS] boolValue] : NO)]; 264 267 265 268 [contentCell setExtendedStatusVisible:NO /*(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_EXT_STATUS] boolValue] : NO)*/]; 266 269 … … 282 285 contentCellAlignment:contentCellAlignment]; 283 286 [contentCell setServiceIconPosition:iconPosition]; 284 287 288 iconPosition = [[prefDict objectForKey:KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION] intValue]; 289 iconPosition = [self pillowsFittedIconPositionForIconPosition:iconPosition 290 contentCellAlignment:contentCellAlignment]; 291 [contentCell setBlockedIconPosition:iconPosition]; 292 285 293 //Force extended status below the name (?) 286 294 [contentCell setExtendedStatusIsBelowName:YES]; 287 295 } -
Frameworks/Adium
old new 31 31 #define SERVICE_ICON_LEFT_PAD 2 32 32 #define SERVICE_ICON_RIGHT_PAD 2 33 33 34 //Blocked icon 35 #define BLOCKED_ICON_LEFT_PAD 2 36 #define BLOCKED_ICON_RIGHT_PAD 2 37 34 38 @interface AIListContactCell : AIListCell { 35 39 BOOL userIconVisible; 36 40 BOOL extendedStatusVisible; 37 41 BOOL statusIconsVisible; 38 42 BOOL serviceIconsVisible; 43 BOOL blockedIconVisible; 39 44 NSSize userIconSize; 40 45 int statusFontHeight; 41 46 … … 46 51 LIST_POSITION userIconPosition; 47 52 LIST_POSITION statusIconPosition; 48 53 LIST_POSITION serviceIconPosition; 54 LIST_POSITION blockedIconPosition; 49 55 BOOL extendedStatusIsBelowName; 50 56 51 57 float backgroundOpacity; … … 77 83 - (BOOL)statusIconsVisible; 78 84 - (void)setServiceIconsVisible:(BOOL)inShowService; 79 85 - (BOOL)serviceIconsVisible; 86 - (void)setBlockedIconVisible:(BOOL)yesOrNo; 87 - (BOOL)blockedIconVisible; 80 88 - (void)setExtendedStatusIsBelowName:(BOOL)inBelowName; 81 89 - (void)setUserIconPosition:(LIST_POSITION)inPosition; 82 90 - (void)setStatusIconPosition:(LIST_POSITION)inPosition; 83 91 - (void)setServiceIconPosition:(LIST_POSITION)inPosition; 92 - (void)setBlockedIconPosition:(LIST_POSITION)inPosition; 84 93 - (void)setBackgroundOpacity:(float)inOpacity; 85 94 - (float)backgroundOpacity; 86 95 - (void)setBackgroundColorIsStatus:(BOOL)isStatus; … … 93 102 - (NSRect)drawUserIconInRect:(NSRect)inRect position:(IMAGE_POSITION)position; 94 103 - (NSRect)drawStatusIconInRect:(NSRect)rect position:(IMAGE_POSITION)position; 95 104 - (NSRect)drawServiceIconInRect:(NSRect)rect position:(IMAGE_POSITION)position; 105 - (NSRect)drawBlockedIconInRect:(NSRect)rect position:(IMAGE_POSITION)position; 96 106 - (NSRect)drawUserExtendedStatusInRect:(NSRect)rect drawUnder:(BOOL)drawUnder; 97 107 - (NSColor *)labelColor; 98 108 - (NSColor *)textColor; 99 109 - (NSImage *)userIconImage; 100 110 - (NSImage *)statusImage; 101 111 - (NSImage *)serviceImage; 112 - (NSImage *)blockedImage; 102 113 //- (BOOL)drawStatusBelowLabelInRect:(NSRect)rect; 103 114 - (BOOL)drawGridBehindCell; 104 115 - (float)imageOpacityForDrawing; -
Frameworks/Adium
old new 17 17 #import "AIListContactCell.h" 18 18 #import "AIListLayoutWindowController.h" 19 19 #import "AIListObject.h" 20 #import "AIListContact.h" 20 21 #import <AIUtilities/AIAttributedStringAdditions.h> 21 22 #import <AIUtilities/AIParagraphStyleAdditions.h> 23 #import <Adium/AIStatusIcons.h> 22 24 #import <Adium/AIServiceIcons.h> 23 25 #import <Adium/AIUserIcons.h> 24 26 … … 135 137 width += SERVICE_ICON_LEFT_PAD + SERVICE_ICON_RIGHT_PAD; 136 138 } 137 139 140 //Blocked icon 141 if (blockedIconVisible && 142 (blockedIconPosition != LIST_POSITION_BADGE_LEFT && blockedIconPosition != LIST_POSITION_BADGE_RIGHT)) { 143 width += 16;//[[NSImage imageNamed:@"remove.png"] size].width; 144 width += BLOCKED_ICON_LEFT_PAD + BLOCKED_ICON_RIGHT_PAD; 145 } 146 138 147 return width + 1; 139 148 } 140 149 … … 270 279 return serviceIconsVisible; 271 280 } 272 281 282 /*! 283 * @brief Set if a blocked icon be shown for a blocked contact 284 */ 285 - (void)setBlockedIconVisible:(BOOL)yesOrNo 286 { 287 blockedIconVisible = yesOrNo; 288 } 289 290 /*! 291 * @brief Should a block icon for a blocked contact be shown? 292 */ 293 - (BOOL)blockedIconVisible 294 { 295 return blockedIconVisible; 296 } 297 273 298 //Element Positioning 274 299 - (void)setExtendedStatusIsBelowName:(BOOL)inBelowName{ 275 300 extendedStatusIsBelowName = inBelowName; … … 283 308 - (void)setServiceIconPosition:(LIST_POSITION)inPosition{ 284 309 serviceIconPosition = inPosition; 285 310 } 311 - (void)setBlockedIconPosition:(LIST_POSITION)inPosition{ 312 blockedIconPosition = inPosition; 313 } 286 314 287 315 //Opacity 288 316 - (void)setBackgroundOpacity:(float)inOpacity … … 320 348 //Far Left 321 349 if (statusIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_LEFT]; 322 350 if (serviceIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_LEFT]; 351 if (blockedIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_LEFT]; 323 352 324 353 //User Icon [Left] 325 354 if (userIconPosition == LIST_POSITION_LEFT) rect = [self drawUserIconInRect:rect position:IMAGE_POSITION_LEFT]; … … 327 356 //Left 328 357 if (statusIconPosition == LIST_POSITION_LEFT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_LEFT]; 329 358 if (serviceIconPosition == LIST_POSITION_LEFT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_LEFT]; 359 if (blockedIconPosition == LIST_POSITION_LEFT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_LEFT]; 360 330 361 331 362 //Far Right 332 363 if (statusIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_RIGHT]; 333 364 if (serviceIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_RIGHT]; 365 if (blockedIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_RIGHT]; 334 366 335 367 //User Icon [Right] 336 368 if (userIconPosition == LIST_POSITION_RIGHT) rect = [self drawUserIconInRect:rect position:IMAGE_POSITION_RIGHT]; … … 338 370 //Right 339 371 if (statusIconPosition == LIST_POSITION_RIGHT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_RIGHT]; 340 372 if (serviceIconPosition == LIST_POSITION_RIGHT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_RIGHT]; 373 if (blockedIconPosition == LIST_POSITION_RIGHT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_RIGHT]; 341 374 342 375 //Extended Status 343 376 if (extendedStatusIsBelowName) rect = [self drawUserExtendedStatusInRect:rect drawUnder:YES]; … … 392 425 [self drawServiceIconInRect:drawRect position:IMAGE_POSITION_LOWER_RIGHT]; 393 426 } 394 427 428 //badge the user icon with the status pack's blocked icon 429 if (blockedIconPosition == LIST_POSITION_BADGE_LEFT) { 430 [self drawBlockedIconInRect:drawRect position:IMAGE_POSITION_LOWER_LEFT]; 431 } else if (blockedIconPosition == LIST_POSITION_BADGE_RIGHT) { 432 [self drawBlockedIconInRect:drawRect position:IMAGE_POSITION_LOWER_RIGHT]; 433 } 434 395 435 //If we're using space on the right, shrink the width so we won't be overlapped 396 436 // if (position == IMAGE_POSITION_RIGHT) rect.size.width -= USER_ICON_RIGHT_PAD; 397 437 if (position == IMAGE_POSITION_LEFT) rect.origin.x += USER_ICON_RIGHT_PAD; … … 459 499 return rect; 460 500 } 461 501 502 /*! 503 * @brief Draw the Blocked icon in the contact's rect 504 */ 505 - (NSRect)drawBlockedIconInRect:(NSRect)rect position:(IMAGE_POSITION)position 506 { 507 508 if ([self blockedIconVisible] && [(AIListContact *)listObject isBlocked]) { 509 BOOL isBadge = (position == IMAGE_POSITION_LOWER_LEFT || position == IMAGE_POSITION_LOWER_RIGHT); 510 511 if (!isBadge) { 512 if (position == IMAGE_POSITION_LEFT) rect.origin.x += BLOCKED_ICON_LEFT_PAD; 513 rect.size.width -= BLOCKED_ICON_LEFT_PAD; 514 } 515 516 /* 517 Draw the blocked icon if (it is not a badge), or if (it is a badge and there is a userIconImage) 518 (We have already drawn the blocked icon if there is no userIconImage, in drawUserIconInRect:position:) 519 */ 520 if (!isBadge || ([self userIconImage] != nil)) { 521 NSImage *image = [self blockedImage]; 522 [image setFlipped:![image isFlipped]]; 523 rect = [image drawInRect:rect 524 atSize:NSMakeSize(0, 0) 525 position:position 526 fraction:1.0]; 527 [image setFlipped:![image isFlipped]]; 528 } 529 530 if (!isBadge) { 531 if (position == IMAGE_POSITION_LEFT) rect.origin.x += BLOCKED_ICON_RIGHT_PAD; 532 rect.size.width -= BLOCKED_ICON_RIGHT_PAD; 533 } 534 } 535 return rect; 536 } 537 462 538 //User Extended Status 463 539 - (NSRect)drawUserExtendedStatusInRect:(NSRect)rect drawUnder:(BOOL)drawUnder 464 540 { … … 582 658 return [AIServiceIcons serviceIconForObject:listObject type:AIServiceIconList direction:AIIconFlipped]; 583 659 } 584 660 661 //Return blocked icon image from current status pack 662 - (NSImage *)blockedImage 663 { 664 return [AIStatusIcons statusIconForStatusName:@"Blocked" 665 statusType:AIAwayStatus 666 iconType:AIAwayStatusType 667 direction:AIIconNormal]; 668 } 669 585 670 //No need to the grid if we have a status color to draw 586 671 - (BOOL)drawGridBehindCell 587 672 { -
Frameworks/Adium
old new 119 119 120 120 - (BOOL)isStranger; 121 121 - (BOOL)isMobile; 122 - (BOOL)isBlocked; 122 123 123 124 - (NSString *)displayName; 124 125 - (void)setDisplayName:(NSString *)alias; -
Frameworks/Adium
old new 590 590 } 591 591 592 592 /*! 593 * @brief Is this contact blocked? 594 */ 595 - (BOOL)isBlocked 596 { 597 return NO; 598 } 599 600 /*! 593 601 * @brief Set the current status message 594 602 * 595 603 * @param statusMessage Status message. May be nil. -
Frameworks/Adium
old new 182 182 return NO; 183 183 } 184 184 185 /*! 186 * @brief Are all the contacts in this meta blocked? 187 */ 188 - (BOOL)isBlocked 189 { 190 BOOL allContactsBlocked = YES; 191 NSEnumerator *enumerator = [self listContactsEnumerator]; 192 AIListContact *currentContact = nil; 193 194 while ((currentContact = [enumerator nextObject])) { 195 if (![currentContact isBlocked]) { 196 allContactsBlocked = NO; 197 break; 198 } 199 } 200 201 return allContactsBlocked; 202 } 203 185 204 //Object Storage ------------------------------------------------------------------------------------------------------- 186 205 #pragma mark Object Storage 187 206 /*! -
Plugins/Contact
old new 26 26 IBOutlet NSPopUpButton *popUp_userIconPosition; 27 27 IBOutlet NSPopUpButton *popUp_statusIconPosition; 28 28 IBOutlet NSPopUpButton *popUp_serviceIconPosition; 29 IBOutlet NSPopUpButton *popUp_blockedIconPosition; 29 30 30 31 IBOutlet NSButton *checkBox_userIconVisible; 31 32 IBOutlet NSButton *checkBox_extendedStatusVisible; 32 33 IBOutlet NSButton *checkBox_statusIconsVisible; 33 34 IBOutlet NSButton *checkBox_serviceIconsVisible; 35 IBOutlet NSButton *checkBox_blockedIconsVisible; 34 36 35 37 IBOutlet NSSlider *slider_userIconSize; 36 38 IBOutlet NSTextField *textField_userIconSize; -
Plugins/Contact
old new 35 35 - (void)configureControlDimming; 36 36 - (void)updateSliderValues; 37 37 - (void)updateDisplayedTabsFromPrefDict:(NSDictionary *)prefDict; 38 - (void)update StatusAndServiceIconMenusFromPrefDict:(NSDictionary *)prefDict;38 - (void)updateMenusOfBadgeableIconsFromPrefDict:(NSDictionary *)prefDict; 39 39 - (void)updateUserIconMenuFromPrefDict:(NSDictionary *)prefDict; 40 - (void)updateBlockedIconMenuFromPrefDict:(NSDictionary *)prefDict; 40 41 - (NSMenu *)alignmentMenuWithChoices:(int [])alignmentChoices; 41 42 - (NSMenu *)positionMenuWithChoices:(int [])positionChoices; 42 43 - (NSMenu *)extendedStatusStyleMenu; … … 144 145 textAlignmentChoices[3] = -1; 145 146 146 147 [self updateDisplayedTabsFromPrefDict:prefDict]; 147 148 [self updateStatusAndServiceIconMenusFromPrefDict:prefDict]; 149 148 [self updateMenusOfBadgeableIconsFromPrefDict:prefDict]; 150 149 [self updateUserIconMenuFromPrefDict:prefDict]; 151 150 152 151 //Context text alignment … … 189 188 NSDictionary *prefDict; 190 189 prefDict = [[adium preferenceController] preferencesForGroup:PREF_GROUP_LIST_LAYOUT]; 191 190 192 [self update StatusAndServiceIconMenusFromPrefDict:prefDict];191 [self updateMenusOfBadgeableIconsFromPrefDict:prefDict]; 193 192 [self updateUserIconMenuFromPrefDict:prefDict]; 194 193 195 194 [self configureControlDimming]; … … 219 218 forKey:KEY_LIST_LAYOUT_SERVICE_ICON_POSITION 220 219 group:PREF_GROUP_LIST_LAYOUT]; 221 220 221 } else if (sender == popUp_blockedIconPosition) { 222 [[adium preferenceController] setPreference:[NSNumber numberWithInt:[[sender selectedItem] tag]] 223 forKey:KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION 224 group:PREF_GROUP_LIST_LAYOUT]; 225 222 226 } else if (sender == popUp_extendedStatusStyle) { 223 227 [[adium preferenceController] setPreference:[NSNumber numberWithInt:[[sender selectedItem] tag]] 224 228 forKey:KEY_LIST_LAYOUT_EXTENDED_STATUS_STYLE … … 250 254 group:PREF_GROUP_LIST_LAYOUT]; 251 255 252 256 prefDict = [[adium preferenceController] preferencesForGroup:PREF_GROUP_LIST_LAYOUT]; 253 //Update the status and service icon menus to show/hide the badge options254 [self update StatusAndServiceIconMenusFromPrefDict:prefDict];257 //Update the status, blocked and service icon menus to show/hide the badge options 258 [self updateMenusOfBadgeableIconsFromPrefDict:prefDict]; 255 259 [self configureControlDimming]; 256 260 257 261 } else if (sender == checkBox_extendedStatusVisible) { … … 272 276 group:PREF_GROUP_LIST_LAYOUT]; 273 277 [self configureControlDimming]; 274 278 279 } else if (sender == checkBox_blockedIconsVisible) { 280 [[adium preferenceController] setPreference:[NSNumber numberWithBool:[sender state]] 281 forKey:KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS 282 group:PREF_GROUP_LIST_LAYOUT]; 283 [self configureControlDimming]; 284 275 285 } else if (sender == checkBox_outlineBubbles) { 276 286 [[adium preferenceController] setPreference:[NSNumber numberWithBool:[sender state]] 277 287 forKey:KEY_LIST_LAYOUT_OUTLINE_BUBBLE … … 383 393 [checkBox_serviceIconsVisible setEnabled:YES]; 384 394 [checkBox_serviceIconsVisible setState:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS] boolValue]]; 385 395 396 [checkBox_blockedIconsVisible setEnabled:YES]; 397 [checkBox_blockedIconsVisible setState:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS] boolValue]]; 398 386 399 } else { 387 400 //For fitted and centered, disable and set to NO 388 401 [checkBox_userIconVisible setEnabled:NO]; … … 393 406 394 407 [checkBox_serviceIconsVisible setEnabled:NO]; 395 408 [checkBox_serviceIconsVisible setState:NO]; 409 410 [checkBox_blockedIconsVisible setEnabled:NO]; 411 [checkBox_blockedIconsVisible setState:NO]; 396 412 } 397 413 398 414 … … 415 431 [popUp_serviceIconPosition setEnabled:([checkBox_serviceIconsVisible state] && 416 432 [checkBox_serviceIconsVisible isEnabled] && 417 433 ([popUp_serviceIconPosition numberOfItems] > 0))]; 434 [popUp_blockedIconPosition setEnabled:([checkBox_blockedIconsVisible state] && 435 [checkBox_blockedIconsVisible isEnabled] && 436 ([popUp_blockedIconPosition numberOfItems] > 0))]; 418 437 [popUp_userIconPosition setEnabled:([checkBox_userIconVisible state] && 419 438 [checkBox_userIconVisible isEnabled] && 420 439 ([popUp_userIconPosition numberOfItems] > 0))]; … … 429 448 [slider_outlineWidth setEnabled:[checkBox_outlineBubbles state]]; 430 449 } 431 450 432 - (void)updateStatusAndServiceIconMenusFromPrefDict:(NSDictionary *)prefDict 451 /*! 452 * @brief Update menus of icons that are badgeable 453 */ 454 - (void)updateMenusOfBadgeableIconsFromPrefDict:(NSDictionary *)prefDict 433 455 { 434 int statusAndServicePositionChoices[7];456 int choices[7]; 435 457 BOOL showUserIcon = [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_ICON] boolValue]; 436 458 int indexForFinishingChoices = 0; 437 459 438 460 if ([[[adium preferenceController] preferenceForKey:KEY_LIST_LAYOUT_WINDOW_STYLE group:PREF_GROUP_APPEARANCE] intValue] != WINDOW_STYLE_PILLOWS_FITTED) { 439 statusAndServicePositionChoices[0] = LIST_POSITION_FAR_LEFT;440 statusAndServicePositionChoices[1] = LIST_POSITION_LEFT;441 statusAndServicePositionChoices[2] = LIST_POSITION_RIGHT;442 statusAndServicePositionChoices[3] = LIST_POSITION_FAR_RIGHT;461 choices[0] = LIST_POSITION_FAR_LEFT; 462 choices[1] = LIST_POSITION_LEFT; 463 choices[2] = LIST_POSITION_RIGHT; 464 choices[3] = LIST_POSITION_FAR_RIGHT; 443 465 444 466 indexForFinishingChoices = 4; 445 467 … … 447 469 //For fitted pillows, only show the options which correspond to the text alignment 448 470 switch ([[prefDict objectForKey:KEY_LIST_LAYOUT_ALIGNMENT] intValue]) { 449 471 case NSLeftTextAlignment: 450 statusAndServicePositionChoices[0] = LIST_POSITION_FAR_LEFT;451 statusAndServicePositionChoices[1] = LIST_POSITION_LEFT;472 choices[0] = LIST_POSITION_FAR_LEFT; 473 choices[1] = LIST_POSITION_LEFT; 452 474 indexForFinishingChoices = 2; 453 475 break; 454 476 455 477 case NSRightTextAlignment: 456 statusAndServicePositionChoices[0] = LIST_POSITION_RIGHT;457 statusAndServicePositionChoices[1] = LIST_POSITION_FAR_RIGHT;478 choices[0] = LIST_POSITION_RIGHT; 479 choices[1] = LIST_POSITION_FAR_RIGHT; 458 480 indexForFinishingChoices = 2; 459 481 460 482 break; … … 466 488 467 489 //Only show the badge choices if we are showing the user icon 468 490 if (showUserIcon && (indexForFinishingChoices != 0)) { 469 statusAndServicePositionChoices[indexForFinishingChoices] = LIST_POSITION_BADGE_LEFT;470 statusAndServicePositionChoices[indexForFinishingChoices + 1] = LIST_POSITION_BADGE_RIGHT;471 statusAndServicePositionChoices[indexForFinishingChoices + 2] = -1;491 choices[indexForFinishingChoices] = LIST_POSITION_BADGE_LEFT; 492 choices[indexForFinishingChoices + 1] = LIST_POSITION_BADGE_RIGHT; 493 choices[indexForFinishingChoices + 2] = -1; 472 494 473 495 } else { 474 statusAndServicePositionChoices[indexForFinishingChoices] = -1;496 choices[indexForFinishingChoices] = -1; 475 497 476 498 } 477 499 478 [popUp_statusIconPosition setMenu:[self positionMenuWithChoices:statusAndServicePositionChoices]]; 500 //update status icon positions in menu 501 [popUp_statusIconPosition setMenu:[self positionMenuWithChoices:choices]]; 479 502 [popUp_statusIconPosition compatibleSelectItemWithTag:[[prefDict objectForKey:KEY_LIST_LAYOUT_STATUS_ICON_POSITION] intValue]]; 480 503 481 [popUp_serviceIconPosition setMenu:[self positionMenuWithChoices:statusAndServicePositionChoices]]; 482 [popUp_serviceIconPosition compatibleSelectItemWithTag:[[prefDict objectForKey:KEY_LIST_LAYOUT_SERVICE_ICON_POSITION] intValue]]; 504 //update service icon positions in menu 505 [popUp_serviceIconPosition setMenu:[self positionMenuWithChoices:choices]]; 506 [popUp_serviceIconPosition compatibleSelectItemWithTag:[[prefDict objectForKey:KEY_LIST_LAYOUT_SERVICE_ICON_POSITION] intValue]]; 507 508 //update blocked icon positions in menu 509 [popUp_blockedIconPosition setMenu:[self positionMenuWithChoices:choices]]; 510 [popUp_blockedIconPosition compatibleSelectItemWithTag:[[prefDict objectForKey:KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION] intValue]]; 483 511 } 484 512 485 513 - (void)updateUserIconMenuFromPrefDict:(NSDictionary *)prefDict -
Plugins/Gaim
old new 36 36 { 37 37 [super awakeFromNib]; 38 38 39 NSScrollView *scrollView = [textView_textProfile enclosingScrollView];39 /*NSScrollView *scrollView = [textView_textProfile enclosingScrollView]; 40 40 if (scrollView && [scrollView isKindOfClass:[AIAutoScrollView class]]) { 41 41 [(AIAutoScrollView *)scrollView setAlwaysDrawFocusRingIfFocused:YES]; 42 42 } 43 43 44 44 if ([textView_textProfile isKindOfClass:[AIMessageEntryTextView class]]) { 45 / *We use the AIMessageEntryTextView to get nifty features for our text view, but we don't want to attempt46 *to 'send' to a target on Enter or Return.47 */45 // We use the AIMessageEntryTextView to get nifty features for our text view, but we don't want to attempt 46 // to 'send' to a target on Enter or Return. 47 // 48 48 [(AIMessageEntryTextView *)textView_textProfile setSendingEnabled:NO]; 49 } 49 }*/ 50 50 } 51 51 52 52 /*! -
Plugins/Gaim
old new 972 972 #pragma mark Privacy 973 973 - (BOOL)addListObject:(AIListObject *)inObject toPrivacyList:(PRIVACY_TYPE)type 974 974 { 975 if (type == PRIVACY_PERMIT) 976 return (gaim_privacy_permit_add(account,[[inObject UID] UTF8String],FALSE)); 977 else 978 return (gaim_privacy_deny_add(account,[[inObject UID] UTF8String],FALSE)); 975 BOOL result; 976 977 if (type == PRIVACY_PERMIT) { 978 result = (gaim_privacy_permit_add(account,[[inObject UID] UTF8String],FALSE)); 979 } else { 980 result = (gaim_privacy_deny_add(account,[[inObject UID] UTF8String],FALSE)); 981 } 982 983 return result; 979 984 } 980 985 981 986 - (BOOL)removeListObject:(AIListObject *)inObject fromPrivacyList:(PRIVACY_TYPE)type 982 987 { 983 if (type == PRIVACY_PERMIT) 984 return (gaim_privacy_permit_remove(account,[[inObject UID] UTF8String],FALSE)); 985 else 986 return (gaim_privacy_deny_remove(account,[[inObject UID] UTF8String],FALSE)); 988 BOOL result; 989 990 if (type == PRIVACY_PERMIT) { 991 result = (gaim_privacy_permit_remove(account,[[inObject UID] UTF8String],FALSE)); 992 } else { 993 result = (gaim_privacy_deny_remove(account,[[inObject UID] UTF8String],FALSE)); 994 } 995 996 return result; 987 997 } 988 998 989 999 - (NSArray *)listObjectsOnPrivacyList:(PRIVACY_TYPE)type … … 1021 1031 if ([sourceUID length]) { 1022 1032 //Get our contact 1023 1033 AIListContact *contact = [self contactWithUID:sourceUID]; 1024 1025 1034 [(type == PRIVACY_PERMIT ? permittedContactsArray : deniedContactsArray) addObject:contact]; 1035 //contacts remember for themselves if they're blocked 1036 [contact setIsBlocked:(type == PRIVACY_DENY)]; 1026 1037 } 1027 1038 } 1028 1039 … … 1051 1062 1052 1063 if (contact) { 1053 1064 [(type == PRIVACY_PERMIT ? permittedContactsArray : deniedContactsArray) removeObject:contact]; 1065 //contacts should remember if they're blocked 1066 [contact setIsBlocked:(type == PRIVACY_PERMIT)]; 1054 1067 } 1055 1068 } 1056 1069 } -
Adium.xcodeproj/project.pbxproj
old new 1131 1131 9E6A9BF80732CB500032C9F6 /* adiumOffline.png in Resources */ = {isa = PBXBuildFile; fileRef = 9E6A9BF60732CB500032C9F6 /* adiumOffline.png */; }; 1132 1132 9EA125E9055B630900ECF349 /* CBGaimOscarAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EA125E8055B630900ECF349 /* CBGaimOscarAccount.m */; }; 1133 1133 9EA125EF055B633000ECF349 /* CBGaimOscarAccount.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EA125EE055B633000ECF349 /* CBGaimOscarAccount.h */; }; 1134 9EFF7CEB0922E32A00B9AC0C /* KGContactServicePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EFF7CE70922E32900B9AC0C /* KGContactServicePlugin.h */; }; 1135 9EFF7CEC0922E32A00B9AC0C /* KGContactServicePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EFF7CE80922E32900B9AC0C /* KGContactServicePlugin.m */; }; 1136 9EFF7CED0922E32A00B9AC0C /* KGContactUIDPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EFF7CE90922E32900B9AC0C /* KGContactUIDPlugin.h */; }; 1137 9EFF7CEE0922E32A00B9AC0C /* KGContactUIDPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EFF7CEA0922E32A00B9AC0C /* KGContactUIDPlugin.m */; }; 1134 1138 A3C042D208D7483100B48CE1 /* GaimDefaultsGTalk.plist in Resources */ = {isa = PBXBuildFile; fileRef = A3C042D108D7483100B48CE1 /* GaimDefaultsGTalk.plist */; }; 1135 1139 A3C0432108D74D3100B48CE1 /* AIGaimGTalkAccount.h in Headers */ = {isa = PBXBuildFile; fileRef = A3C0431B08D74D3100B48CE1 /* AIGaimGTalkAccount.h */; }; 1136 1140 A3C0432208D74D3100B48CE1 /* AIGaimGTalkAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = A3C0431C08D74D3100B48CE1 /* AIGaimGTalkAccount.m */; }; … … 3004 3008 9EB3C52E04F94F24001D1F74 /* MainMenu.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = MainMenu.nib; sourceTree = "<group>"; }; 3005 3009 9EB3C53304F94FAE001D1F74 /* CBOldPrefsImporterAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CBOldPrefsImporterAppController.h; sourceTree = "<group>"; }; 3006 3010 9EB3C53404F94FAE001D1F74 /* CBOldPrefsImporterAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CBOldPrefsImporterAppController.m; sourceTree = "<group>"; }; 3011 9EFF7CE70922E32900B9AC0C /* KGContactServicePlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KGContactServicePlugin.h; sourceTree = "<group>"; }; 3012 9EFF7CE80922E32900B9AC0C /* KGContactServicePlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KGContactServicePlugin.m; sourceTree = "<group>"; }; 3013 9EFF7CE90922E32900B9AC0C /* KGContactUIDPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KGContactUIDPlugin.h; sourceTree = "<group>"; }; 3014 9EFF7CEA0922E32A00B9AC0C /* KGContactUIDPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KGContactUIDPlugin.m; sourceTree = "<group>"; }; 3007 3015 A3C042D108D7483100B48CE1 /* GaimDefaultsGTalk.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; name = GaimDefaultsGTalk.plist; path = "Plugins/Gaim Service/GaimDefaultsGTalk.plist"; sourceTree = "<group>"; }; 3008 3016 A3C0431B08D74D3100B48CE1 /* AIGaimGTalkAccount.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIGaimGTalkAccount.h; path = "Plugins/Gaim Service/AIGaimGTalkAccount.h"; sourceTree = "<group>"; }; 3009 3017 A3C0431C08D74D3100B48CE1 /* AIGaimGTalkAccount.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AIGaimGTalkAccount.m; path = "Plugins/Gaim Service/AIGaimGTalkAccount.m"; sourceTree = "<group>"; }; … … 3817 3825 347E7ACD07CAF98400350507 /* ESMetaContactContentsPlugin.m */, 3818 3826 347E7AA907CAF8EE00350507 /* SAContactOnlineForPlugin.h */, 3819 3827 347E7AA807CAF8EE00350507 /* SAContactOnlineForPlugin.m */, 3828 9EFF7CE70922E32900B9AC0C /* KGContactServicePlugin.h */, 3829 9EFF7CE80922E32900B9AC0C /* KGContactServicePlugin.m */, 3830 9EFF7CE90922E32900B9AC0C /* KGContactUIDPlugin.h */, 3831 9EFF7CEA0922E32A00B9AC0C /* KGContactUIDPlugin.m */, 3820 3832 ); 3821 3833 name = Tooltips; 3822 3834 sourceTree = "<group>"; … … 6334 6346 9E44248808E11F380015D4DD /* AdiumURLHandling.h in Headers */, 6335 6347 633F175A08F905A700C76383 /* AIXtraInfo.h in Headers */, 6336 6348 633F175C08F905A700C76383 /* AIXtrasManager.h in Headers */, 6349 9EFF7CEB0922E32A00B9AC0C /* KGContactServicePlugin.h in Headers */, 6350 9EFF7CED0922E32A00B9AC0C /* KGContactUIDPlugin.h in Headers */, 6337 6351 ); 6338 6352 runOnlyForDeploymentPostprocessing = 0; 6339 6353 }; … … 7945 7959 9E44248908E11F380015D4DD /* AdiumURLHandling.m in Sources */, 7946 7960 633F175B08F905A700C76383 /* AIXtraInfo.m in Sources */, 7947 7961 633F175D08F905A800C76383 /* AIXtrasManager.m in Sources */, 7962 9EFF7CEC0922E32A00B9AC0C /* KGContactServicePlugin.m in Sources */, 7963 9EFF7CEE0922E32A00B9AC0C /* KGContactUIDPlugin.m in Sources */, 7948 7964 ); 7949 7965 runOnlyForDeploymentPostprocessing = 0; 7950 7966 }; -
Source/KGContactUIDPlugin.h
old new 1 /* 2 * Adium is the legal property of its developers, whose names are listed in the copyright file included 3 * with this source distribution. 4 * 5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU 6 * General Public License as published by the Free Software Foundation; either version 2 of the License, 7 * or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even 10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 11 * Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License along with this program; if not, 14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 */ 16 // 17 // KGContactUIDPlugin.h 18 // Adium 19 // 20 // Created by Kiel Gillard on 8/09/05. 21 // 22 23 #import <Adium/AIPlugin.h> 24 25 @protocol AIContactListTooltipEntry; 26 27 @interface KGContactUIDPlugin : AIPlugin <AIContactListTooltipEntry> { 28 } 29 30 @end -
Source/KGContactUIDPlugin.m
old new 1 // 2 // KGContactUIDPlugin.m 3 // Adium 4 // 5 // Created by Kiel Gillard on 8/09/05. 6 // 7 8 #import "KGContactUIDPlugin.h" 9 #import "AIInterfaceController.h" 10 #import <Adium/AIListObject.h> 11 #import <Adium/AIListContact.h> 12 #import <Adium/AIMetaContact.h> 13 #import <AIUtilities/AIAttributedStringAdditions.h> 14 #import <AIUtilities/AIStringAdditions.h> 15 16 @interface KGContactUIDPlugin (PRIVATE) 17 - (NSAttributedString *)entryForListContact:(AIListObject *)contact; 18 @end 19 20 @implementation KGContactUIDPlugin 21 /*! 22 * @class KGContactUIDPlugin 23 * @brief Adds a "User ID: <contact formattedUID>" to List contact tooltips. 24 */ 25 - (void)installPlugin 26 { 27 //Install our tooltip entry 28 [[adium interfaceController] registerContactListTooltipEntry:self secondaryEntry:NO]; 29 } 30 31 /*! 32 * @brief Tooltip entry 33 * 34 * @result An entry for the User ID label, or nil if no tooltip label and entry should be shown 35 */ 36 - (NSAttributedString *)entryForObject:(AIListObject *)inObject 37 { 38 NSAttributedString *entry = nil; 39 40 //do this for ListContacts only 41 if (![inObject isKindOfClass:[AIMetaContact class]] && [inObject isKindOfClass:[AIListContact class]]) { 42 entry = [self entryForListContact:inObject]; 43 } else if ([inObject isKindOfClass:[AIMetaContact class]]) { 44 45 if ([(AIMetaContact *)inObject containsOnlyOneUniqueContact]) { 46 entry = [self entryForListContact:[[(AIMetaContact *)inObject listContacts] lastObject]]; 47 } 48 } 49 50 return entry; 51 } 52 53 /*! 54 * @brief Tooltip entry 55 * 56 * @result The tooltip "User ID" label 57 */ 58 - (NSString *)labelForObject:(AIListObject *)inObject 59 { 60 NSString *label = nil; 61 62 if ([inObject isKindOfClass:[AIListContact class]] && (![inObject isKindOfClass:[AIMetaContact class]])) { 63 label = AILocalizedString(@"User ID", @"Tooltip entry label to show a contact's formatted user ID"); 64 } else if ([inObject isKindOfClass:[AIMetaContact class]]) { 65 if ([(AIMetaContact *)inObject containsOnlyOneUniqueContact]) { 66 label = AILocalizedString(@"User ID", @"Tooltip entry label to show a contact's formatted user ID"); 67 } 68 } 69 70 return label; 71 } 72 73 /*! 74 * @brief Provides a Tooltip entry for the contact argument 75 * 76 * @result The formattedUID of the contact if it's different from the displayName 77 */ 78 - (NSAttributedString *)entryForListContact:(AIListObject *)contact 79 { 80 NSAttributedString *entry = nil; 81 NSString *formattedUID = [(AIListObject *)contact formattedUID]; 82 NSString *displayName = [(AIListObject *)contact displayName]; 83