Ticket #344: KielBlocking.patch
| File KielBlocking.patch, 38.9 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 28 28 #import <AIUtilities/AIMutableOwnerArray.h> 29 29 #import <AIUtilities/AIMutableStringAdditions.h> 30 30 31 #define IS_BLOCKED_KEY @"isBlocked" 32 31 33 @implementation AIListContact 32 34 33 35 //Init with an account … … 456 458 notify:notify]; 457 459 } 458 460 461 /*! 462 * @brief Is this contact blocked? 463 */ 464 - (BOOL)isBlocked 465 { 466 return [self integerStatusObjectForKey:IS_BLOCKED_KEY]; 467 } 468 469 /*! 470 * @brief Set if this contact is blocked 471 */ 472 - (void)setIsBlocked:(BOOL)yesOrNo 473 { 474 [self setStatusObject:(yesOrNo ? [NSNumber numberWithBool:YES] : nil) 475 forKey:IS_BLOCKED_KEY 476 notify:NotifyNow]; 477 } 478 459 479 #pragma mark Status 460 480 461 481 /*! -
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 += [[self blockedImage] 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; … … 284 309 serviceIconPosition = inPosition; 285 310 } 286 311 312 /*! 313 * @brief Remember where a blocked icon should be drawn. 314 */ 315 - (void)setBlockedIconPosition:(LIST_POSITION)inPosition 316 { 317 blockedIconPosition = inPosition; 318 } 319 287 320 //Opacity 288 321 - (void)setBackgroundOpacity:(float)inOpacity 289 322 { … … 320 353 //Far Left 321 354 if (statusIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_LEFT]; 322 355 if (serviceIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_LEFT]; 356 if (blockedIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_LEFT]; 323 357 324 358 //User Icon [Left] 325 359 if (userIconPosition == LIST_POSITION_LEFT) rect = [self drawUserIconInRect:rect position:IMAGE_POSITION_LEFT]; … … 327 361 //Left 328 362 if (statusIconPosition == LIST_POSITION_LEFT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_LEFT]; 329 363 if (serviceIconPosition == LIST_POSITION_LEFT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_LEFT]; 364 if (blockedIconPosition == LIST_POSITION_LEFT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_LEFT]; 365 330 366 331 367 //Far Right 332 368 if (statusIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_RIGHT]; 333 369 if (serviceIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_RIGHT]; 370 if (blockedIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_RIGHT]; 334 371 335 372 //User Icon [Right] 336 373 if (userIconPosition == LIST_POSITION_RIGHT) rect = [self drawUserIconInRect:rect position:IMAGE_POSITION_RIGHT]; … … 338 375 //Right 339 376 if (statusIconPosition == LIST_POSITION_RIGHT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_RIGHT]; 340 377 if (serviceIconPosition == LIST_POSITION_RIGHT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_RIGHT]; 378 if (blockedIconPosition == LIST_POSITION_RIGHT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_RIGHT]; 341 379 342 380 //Extended Status 343 381 if (extendedStatusIsBelowName) rect = [self drawUserExtendedStatusInRect:rect drawUnder:YES]; … … 392 430 [self drawServiceIconInRect:drawRect position:IMAGE_POSITION_LOWER_RIGHT]; 393 431 } 394 432 433 //badge the user icon with the status pack's blocked icon 434 if (blockedIconPosition == LIST_POSITION_BADGE_LEFT) { 435 [self drawBlockedIconInRect:drawRect position:IMAGE_POSITION_LOWER_LEFT]; 436 } else if (blockedIconPosition == LIST_POSITION_BADGE_RIGHT) { 437 [self drawBlockedIconInRect:drawRect position:IMAGE_POSITION_LOWER_RIGHT]; 438 } 439 395 440 //If we're using space on the right, shrink the width so we won't be overlapped 396 441 // if (position == IMAGE_POSITION_RIGHT) rect.size.width -= USER_ICON_RIGHT_PAD; 397 442 if (position == IMAGE_POSITION_LEFT) rect.origin.x += USER_ICON_RIGHT_PAD; … … 459 504 return rect; 460 505 } 461 506 507 /*! 508 * @brief Draw the Blocked icon in the contact's rect 509 */ 510 - (NSRect)drawBlockedIconInRect:(NSRect)rect position:(IMAGE_POSITION)position 511 { 512 513 if ([self blockedIconVisible] && [(AIListContact *)listObject isBlocked]) { 514 BOOL isBadge = (position == IMAGE_POSITION_LOWER_LEFT || position == IMAGE_POSITION_LOWER_RIGHT); 515 516 if (!isBadge) { 517 if (position == IMAGE_POSITION_LEFT) rect.origin.x += BLOCKED_ICON_LEFT_PAD; 518 rect.size.width -= BLOCKED_ICON_LEFT_PAD; 519 } 520 521 /* 522 Draw the blocked icon if (it is not a badge), or if (it is a badge and there is a userIconImage) 523 (We have already drawn the blocked icon if there is no userIconImage, in drawUserIconInRect:position:) 524 */ 525 if (!isBadge || ([self userIconImage] != nil)) { 526 NSImage *image = [self blockedImage]; 527 [image setFlipped:![image isFlipped]]; 528 rect = [image drawInRect:rect 529 atSize:NSMakeSize(0, 0) 530 position:position 531 fraction:1.0]; 532 [image setFlipped:![image isFlipped]]; 533 } 534 535 if (!isBadge) { 536 if (position == IMAGE_POSITION_LEFT) rect.origin.x += BLOCKED_ICON_RIGHT_PAD; 537 rect.size.width -= BLOCKED_ICON_RIGHT_PAD; 538 } 539 } 540 return rect; 541 } 542 462 543 //User Extended Status 463 544 - (NSRect)drawUserExtendedStatusInRect:(NSRect)rect drawUnder:(BOOL)drawUnder 464 545 { … … 582 663 return [AIServiceIcons serviceIconForObject:listObject type:AIServiceIconList direction:AIIconFlipped]; 583 664 } 584 665 666 /*! 667 * @brief Return blocked icon image from current status pack 668 */ 669 - (NSImage *)blockedImage 670 { 671 return [AIStatusIcons statusIconForStatusName:@"Blocked" 672 statusType:AIAwayStatus 673 iconType:AIStatusIconList 674 direction:AIIconNormal]; 675 } 676 585 677 //No need to the grid if we have a status color to draw 586 678 - (BOOL)drawGridBehindCell 587 679 { -
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 183 183 return NO; 184 184 } 185 185 186 /*! 187 * @brief Are all the contacts in this meta blocked? 188 */ 189 - (BOOL)isBlocked 190 { 191 BOOL allContactsBlocked = YES; 192 NSEnumerator *enumerator = [self listContactsEnumerator]; 193 AIListContact *currentContact = nil; 194 195 while ((currentContact = [enumerator nextObject])) { 196 if (![currentContact isBlocked]) { 197 allContactsBlocked = NO; 198 break; 199 } 200 } 201 202 return allContactsBlocked; 203 } 204 186 205 //Object Storage ------------------------------------------------------------------------------------------------------- 187 206 #pragma mark Object Storage 188 207 /*! -
Source/ESBlockingPlugin.m
old new 56 56 [blockContactContextualMenuItem release]; 57 57 } 58 58 59 60 59 - (IBAction)blockContact:(id)sender 61 60 { 62 61 AIListObject *object; … … 78 77 79 78 if (NSRunAlertPanel([NSString stringWithFormat:format, [contact displayName]], 80 79 @"", 81 AILocalizedString(@"OK", nil),80 [sender title], 82 81 AILocalizedString(@"Cancel", nil), 83 82 nil) == NSAlertDefaultReturn) { 84 83 … … 198 197 AIAccount <AIAccount_Privacy> *privacyAccount = (AIAccount <AIAccount_Privacy> *)account; 199 198 if (unblock) { 200 199 if ([[privacyAccount listObjectIDsOnPrivacyList:PRIVACY_DENY] containsObject:[contact UID]]) { 201 [privacyAccount removeListObject:contact fromPrivacyList:PRIVACY_DENY]; 200 if ([privacyAccount removeListObject:contact fromPrivacyList:PRIVACY_DENY]) { 201 [contact setIsBlocked:NO]; 202 } 202 203 } 203 204 } else { 204 205 if (![[privacyAccount listObjectIDsOnPrivacyList:PRIVACY_DENY] containsObject:[contact UID]]) { 205 [privacyAccount addListObject:contact toPrivacyList:PRIVACY_DENY]; 206 if ([privacyAccount addListObject:contact toPrivacyList:PRIVACY_DENY]) { 207 [contact setIsBlocked:YES]; 208 } 206 209 } 207 210 } 208 211 } -
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/Status
old new 97 97 //If any accounts are online, set our state to ONLINE. 98 98 NSEnumerator *accountsEnumerator = [[[adium accountController] accounts] objectEnumerator]; 99 99 AIAccount *account = nil; 100 while (account = [ enumerator nextObject]) {100 while (account = [accountsEnumerator nextObject]) { 101 101 if ([account statusForKey:@"Online"]) { 102 102 [self setIconState:ONLINE]; 103 103 } -
Plugins/Gaim
old new 1043 1043 AIListContact *contact = [self contactWithUID:sourceUID]; 1044 1044 1045 1045 [(type == PRIVACY_PERMIT ? permittedContactsArray : deniedContactsArray) addObject:contact]; 1046 [contact setIsBlocked:(type == PRIVACY_DENY)]; 1046 1047 } 1047 1048 } 1048 1049 -
Resources/Status
old new 20 20 <string>offline.png</string> 21 21 <key>Unknown</key> 22 22 <string>unknown.png</string> 23 <key>Blocked</key> 24 <string>blocked.png</string> 23 25 <key>content</key> 24 26 <string>content.png</string> 25 27 <key>enteredtext</key>