Changeset 15748
- Timestamp:
- 04/12/2006 12:47:20 PM (3 years ago)
- Files:
-
- trunk/Plugins/Emoticons/AIEmoticonPreferences.h (modified) (1 diff)
- trunk/Plugins/Emoticons/AIEmoticonPreferences.m (modified) (7 diffs)
- trunk/Source/AIAppearancePreferencesPlugin.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Plugins/Emoticons/AIEmoticonPreferences.h
r11978 r15748 33 33 NSButtonCell *checkCell; 34 34 AIEmoticonPack *selectedEmoticonPack; 35 NSMutableDictionary *emoticonImageCache; 35 36 36 37 NSArray *dragRows; trunk/Plugins/Emoticons/AIEmoticonPreferences.m
r15730 r15748 25 25 #import <AIUtilities/AIGenericViewCell.h> 26 26 #import <AIUtilities/AIImageAdditions.h> 27 #import <AIUtilities/AIVerticallyCenteredTextCell.h> 28 27 29 #import <Adium/AIListObject.h> 28 30 #import "AIPreferenceController.h" … … 30 32 #define EMOTICON_PACK_DRAG_TYPE @"AIEmoticonPack" 31 33 #define EMOTICON_MIN_ROW_HEIGHT 17 34 #define EMOTICON_MAX_ROW_HEIGHT 64 32 35 #define EMOTICON_PACKS_TOOLTIP AILocalizedString(@"Reorder emoticon packs by dragging. Packs are used in the order listed.",nil) 33 36 … … 105 108 [checkCell setRefusesFirstResponder:YES]; 106 109 [[table_emoticons tableColumnWithIdentifier:@"Enabled"] setDataCell:checkCell]; 107 108 NSImageCell *imageCell = [[[NSImageCell alloc] init] autorelease]; 110 [checkCell release]; 111 112 NSImageCell *imageCell = [[NSImageCell alloc] initImageCell:nil]; 109 113 if ([imageCell respondsToSelector:@selector(_setAnimates:)]) [imageCell _setAnimates:NO]; 110 111 [[table_emoticons tableColumnWithIdentifier:@"Image"] setDataCell:imageCell]; 114 [[table_emoticons tableColumnWithIdentifier:@"Image"] setDataCell:imageCell]; 115 [imageCell release]; 116 117 AIVerticallyCenteredTextCell *textCell = [[AIVerticallyCenteredTextCell alloc] init]; 118 [textCell setLineBreakMode:NSLineBreakByTruncatingTail]; 119 [[table_emoticons tableColumnWithIdentifier:@"Name"] setDataCell:textCell]; 120 [textCell release]; 121 122 textCell = [[AIVerticallyCenteredTextCell alloc] init]; 123 [textCell setLineBreakMode:NSLineBreakByTruncatingTail]; 124 [[table_emoticons tableColumnWithIdentifier:@"String"] setDataCell:textCell]; 125 [textCell release]; 126 112 127 [table_emoticons setDrawsAlternatingRows:YES]; 113 128 … … 119 134 120 135 [button_OK setLocalizedString:AILocalizedString(@"CloseSheet",nil)]; 121 136 122 137 //Redisplay the emoticons after an small delay so the sample emoticons line up properly 123 138 //since the desired width isn't known by AIEmoticonPackCell until once through the list of packs … … 135 150 [emoticonPackPreviewControllers release]; emoticonPackPreviewControllers = nil; 136 151 [[adium preferenceController] unregisterPreferenceObserver:self]; 152 [emoticonImageCache release]; emoticonImageCache = nil; 137 153 138 154 //Flush all the images we loaded … … 197 213 rowHeight = totalHeight / [[selectedEmoticonPack emoticons] count]; 198 214 if (rowHeight < EMOTICON_MIN_ROW_HEIGHT) rowHeight = EMOTICON_MIN_ROW_HEIGHT; 215 if (rowHeight > EMOTICON_MAX_ROW_HEIGHT) rowHeight = EMOTICON_MAX_ROW_HEIGHT; 199 216 } 200 217 218 [emoticonImageCache release]; 219 emoticonImageCache = [[NSMutableDictionary alloc] init]; 220 201 221 //Update the table 202 222 [table_emoticons reloadData]; … … 270 290 271 291 } else if ([identifier isEqualToString:@"Image"]) { 272 return [emoticon image]; 273 274 } else if ([identifier isEqualToString:@"Name"]) { 292 NSNumber *key = [NSNumber numberWithUnsignedInt:[emoticon hash]]; 293 NSImage *image = [emoticonImageCache objectForKey:key]; 294 if (!image) { 295 image = [emoticon image]; 296 [emoticonImageCache setObject:image 297 forKey:key]; 298 } 299 300 return image; 301 302 } else if ([identifier isEqualToString:@"Name"]) { 275 303 if ([selectedEmoticonPack isEnabled] && [emoticon isEnabled]) { 276 304 return [emoticon name]; trunk/Source/AIAppearancePreferencesPlugin.m
r15574 r15748 329 329 330 330 name = [[filePath lastPathComponent] stringByDeletingPathExtension]; 331 NSLog(@"Name is %@",name); 331 332 332 if((xtraBundle = [NSBundle bundleWithPath:filePath]) && 333 333 ([[xtraBundle objectForInfoDictionaryKey:@"XtraBundleVersion"] intValue] == 1)) { … … 346 346 [alreadyAddedArray addObject:name]; 347 347 } else { 348 NSLog(@"Already added");348 //NSLog(@"Already added"); 349 349 } 350 350 }