Changeset 4121
- Timestamp:
- 05/11/06 09:45:09 (3 years ago)
- Files:
-
- WiredClient/trunk/English.lproj/MainMenu.nib/classes.nib (modified) (1 diff)
- WiredClient/trunk/English.lproj/MainMenu.nib/info.nib (modified) (2 diffs)
- WiredClient/trunk/English.lproj/MainMenu.nib/keyedobjects.nib (modified) (previous)
- WiredClient/trunk/English.lproj/MainMenu.nib/objects.nib (modified) (previous)
- WiredClient/trunk/English.lproj/Preferences.nib/classes.nib (modified) (1 diff)
- WiredClient/trunk/English.lproj/Preferences.nib/info.nib (modified) (1 diff)
- WiredClient/trunk/English.lproj/Preferences.nib/keyedobjects.nib (modified) (previous)
- WiredClient/trunk/English.lproj/Preferences.nib/objects.nib (modified) (previous)
- WiredClient/trunk/English.lproj/PublicChat.nib/info.nib (modified) (2 diffs)
- WiredClient/trunk/English.lproj/PublicChat.nib/keyedobjects.nib (modified) (previous)
- WiredClient/trunk/English.lproj/PublicChat.nib/objects.nib (modified) (previous)
- WiredClient/trunk/English.lproj/ReleaseNotes.rtf (modified) (1 diff)
- WiredClient/trunk/NSString-WCAdditions.m (modified) (4 diffs)
- WiredClient/trunk/Smilies (added)
- WiredClient/trunk/Smilies/Angry.tiff (added)
- WiredClient/trunk/Smilies/Cool.tiff (added)
- WiredClient/trunk/Smilies/Cry.tiff (added)
- WiredClient/trunk/Smilies/Embarrassed.tiff (added)
- WiredClient/trunk/Smilies/Footinmouth.tiff (added)
- WiredClient/trunk/Smilies/Frown.tiff (added)
- WiredClient/trunk/Smilies/Gasp.tiff (added)
- WiredClient/trunk/Smilies/Innocent.tiff (added)
- WiredClient/trunk/Smilies/Kiss.tiff (added)
- WiredClient/trunk/Smilies/Laugh.tiff (added)
- WiredClient/trunk/Smilies/Moneymouth.tiff (added)
- WiredClient/trunk/Smilies/Sealed.tiff (added)
- WiredClient/trunk/Smilies/Slant.tiff (added)
- WiredClient/trunk/Smilies/Smile.tiff (added)
- WiredClient/trunk/Smilies/SmileyNames.plist (added)
- WiredClient/trunk/Smilies/Smileys.plist (added)
- WiredClient/trunk/Smilies/Wink.tiff (added)
- WiredClient/trunk/Smilies/Yuck.tiff (added)
- WiredClient/trunk/WCApplicationController.h (modified) (2 diffs)
- WiredClient/trunk/WCApplicationController.m (modified) (5 diffs)
- WiredClient/trunk/WCChat.h (modified) (1 diff)
- WiredClient/trunk/WCChat.m (modified) (9 diffs)
- WiredClient/trunk/WCMessages.h (modified) (1 diff)
- WiredClient/trunk/WCMessages.m (modified) (6 diffs)
- WiredClient/trunk/WCNews.m (modified) (8 diffs)
- WiredClient/trunk/WCPreferences.h (modified) (1 diff)
- WiredClient/trunk/WCPreferences.m (modified) (2 diffs)
- WiredClient/trunk/WCSettings.h (modified) (1 diff)
- WiredClient/trunk/WCSettings.m (modified) (1 diff)
- WiredClient/trunk/WCUserCell.h (modified) (1 diff)
- WiredClient/trunk/WCUserCell.m (modified) (5 diffs)
- WiredClient/trunk/WiredClient.xcodeproj/project.pbxproj (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/English.lproj/MainMenu.nib/classes.nib
r3996 r4121 61 61 "_deleteMenuItem" = NSMenuItem; 62 62 "_disconnectMenuItem" = NSMenuItem; 63 "_insertSmileyMenu" = NSMenu; 63 64 }; 64 65 SUPERCLASS = WIObject; WiredClient/trunk/English.lproj/MainMenu.nib/info.nib
r3963 r4121 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string> 271 132412 357 0 0 1280 1002 </string>6 <string>344 140 412 357 0 0 1280 1002 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> 9 9 <key>29</key> 10 <string>1 28 723 614 44 0 0 1280 1002 </string>10 <string>158 773 614 44 0 0 1280 1002 </string> 11 11 </dict> 12 12 <key>IBFramework Version</key> … … 23 23 </array> 24 24 <key>IBSystem Version</key> 25 <string>8 H14</string>25 <string>8I127</string> 26 26 </dict> 27 27 </plist> WiredClient/trunk/English.lproj/Preferences.nib/classes.nib
r4084 r4121 104 104 "_showDialogButton" = NSButton; 105 105 "_showDockAtStartupButton" = NSButton; 106 "_showSmileysButton" = NSButton; 106 107 "_showTrackersAtStartupButton" = NSButton; 107 108 "_soundsPopUpButton" = NSPopUpButton; WiredClient/trunk/English.lproj/Preferences.nib/info.nib
r4084 r4121 6 6 <string>344 47 481 528 0 0 1280 1002 </string> 7 7 <key>IBFramework Version</key> 8 <string>44 3.0</string>8 <string>446.0</string> 9 9 <key>IBLockedObjects</key> 10 10 <array/> WiredClient/trunk/English.lproj/PublicChat.nib/info.nib
r3620 r4121 8 8 <dict> 9 9 <key>105</key> 10 <string> 1171 269 196 187 0 0 1920 1178</string>10 <string>736 221 196 187 0 0 1280 1002 </string> 11 11 </dict> 12 12 <key>IBFramework Version</key> … … 24 24 </array> 25 25 <key>IBSystem Version</key> 26 <string>8 G32</string>26 <string>8I127</string> 27 27 </dict> 28 28 </plist> WiredClient/trunk/English.lproj/ReleaseNotes.rtf
r4114 r4121 30 30 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 31 31 32 \f1\b0 \cf0 - Can now save chat as RTF, and select encoding when saving as plain text\ 32 \f1\b0 \cf0 - Can use graphical smileys in chat\ 33 - Can now save chat as RTF, and select encoding when saving as plain text\ 33 34 - Add option to show a dialog for messages and broadcasts\ 34 35 - Show tooltips in user list\ 36 - Make sure find panel is enabled for all relevant text views\ 35 37 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 36 38 WiredClient/trunk/NSString-WCAdditions.m
r3712 r4121 28 28 29 29 #import "NSString-WCAdditions.h" 30 #import "WCApplicationController.h" 30 31 31 32 @implementation NSMutableAttributedString(WCAdditions) … … 45 46 46 47 if(!whitespaceSet) { 47 whitespaceSet = [[NSCharacterSet whitespaceAndNewlineCharacterSet] retain];48 nonwhitespaceSet = [[whitespaceSet invertedSet] retain];49 50 characterSet = [[NSMutableCharacterSet decimalDigitCharacterSet] mutableCopy];48 whitespaceSet = [[NSCharacterSet whitespaceAndNewlineCharacterSet] retain]; 49 nonwhitespaceSet = [[whitespaceSet invertedSet] retain]; 50 51 characterSet = [[NSMutableCharacterSet decimalDigitCharacterSet] mutableCopy]; 51 52 [characterSet addCharactersInString:@":."]; 52 53 [characterSet invert]; 53 nontimestampSet = [characterSet copy];54 nontimestampSet = [characterSet copy]; 54 55 [characterSet release]; 55 56 } 56 57 57 eventsTextColor = [WCSettings objectForKey:WCChatEventsColor];58 timestampEveryLineColor = [WCSettings objectForKey:WCTimestampEveryLineColor];59 60 highlightPatterns = [NSMutableArray array];61 highlightStrings = [NSMutableArray array];62 highlightColors = [NSMutableArray array];63 enumerator = [[WCSettings objectForKey:WCHighlights] objectEnumerator];58 eventsTextColor = [WCSettings objectForKey:WCChatEventsColor]; 59 timestampEveryLineColor = [WCSettings objectForKey:WCTimestampEveryLineColor]; 60 61 highlightPatterns = [NSMutableArray array]; 62 highlightStrings = [NSMutableArray array]; 63 highlightColors = [NSMutableArray array]; 64 enumerator = [[WCSettings objectForKey:WCHighlights] objectEnumerator]; 64 65 65 66 while((highlight = [enumerator nextObject])) { … … 176 177 #pragma mark - 177 178 179 - (void)_filterWiredSmilies:(WITextFilter *)filter small:(BOOL)small { 180 WCApplicationController *controller; 181 NSDictionary *attributes; 182 NSMutableString *string; 183 NSAttributedString *attributedString; 184 NSFileWrapper *wrapper; 185 NSTextAttachment *attachment; 186 NSEnumerator *enumerator; 187 NSString *key, *substring, *smiley, *character; 188 NSRange range, searchRange; 189 unsigned int length; 190 191 if(![WCSettings boolForKey:WCShowSmileys]) 192 return; 193 194 controller = [WCApplicationController sharedController]; 195 string = [self mutableString]; 196 length = [self length]; 197 enumerator = [[controller allSmileys] objectEnumerator]; 198 199 while((key = [enumerator nextObject])) { 200 searchRange.location = 0; 201 searchRange.length = length; 202 203 while((range = [string rangeOfString:key options:NSCaseInsensitiveSearch range:searchRange]).location != NSNotFound) { 204 substring = [string substringWithRange:range]; 205 smiley = [controller pathForSmiley:substring]; 206 207 if(smiley) { 208 attributes = [self attributesAtIndex:range.location effectiveRange:NULL]; 209 210 if(![attributes objectForKey:NSLinkAttributeName]) { 211 wrapper = [[NSFileWrapper alloc] initWithPath:smiley]; 212 attachment = [[NSTextAttachment alloc] initWithFileWrapper:wrapper]; 213 214 if(small) 215 [[(NSTextAttachmentCell *) [attachment attachmentCell] image] setSize:NSMakeSize(14.0, 14.0)]; 216 217 attributedString = [NSAttributedString attributedStringWithAttachment:attachment]; 218 219 [self replaceCharactersInRange:range withAttributedString:attributedString]; 220 221 length -= range.length - 1; 222 searchRange.location = range.location + 1; 223 searchRange.length = length - searchRange.location; 224 225 range.length = 1; 226 character = [substring substringFromIndex:[substring length] - 1]; 227 228 while((range = [string rangeOfString:character options:NSCaseInsensitiveSearch | NSAnchoredSearch range:searchRange]).location != NSNotFound) { 229 [self replaceCharactersInRange:range withAttributedString:attributedString]; 230 231 searchRange.location++; 232 searchRange.length--; 233 } 234 235 [attachment release]; 236 [wrapper release]; 237 } else { 238 searchRange.location = range.location + range.length; 239 searchRange.length = length - searchRange.location; 240 } 241 } 242 } 243 } 244 } 245 246 247 248 - (void)filterWiredSmallSmilies:(WITextFilter *)filter { 249 [self _filterWiredSmilies:filter small:YES]; 250 } 251 252 253 254 - (void)filterWiredSmilies:(WITextFilter *)filter { 255 [self _filterWiredSmilies:filter small:NO]; 256 } 257 258 259 260 #pragma mark - 261 178 262 #define _WCURLFilterInterestingLength 8 179 263 … … 210 294 211 295 if(!whitespaceSet) { 212 whitespaceSet = [[NSCharacterSet whitespaceAndNewlineCharacterSet] retain];213 nonWhitespaceSet = [[whitespaceSet invertedSet] retain];214 skipSet = [[NSCharacterSet characterSetWithCharactersInString:@",.?()[]{}<>"] retain];296 whitespaceSet = [[NSCharacterSet whitespaceAndNewlineCharacterSet] retain]; 297 nonWhitespaceSet = [[whitespaceSet invertedSet] retain]; 298 skipSet = [[NSCharacterSet characterSetWithCharactersInString:@",.?()[]{}<>"] retain]; 215 299 } 216 300 WiredClient/trunk/WCApplicationController.h
r3996 r4121 29 29 @interface WCApplicationController : WIObject { 30 30 IBOutlet NSMenu *_bookmarksMenu; 31 IBOutlet NSMenu *_insertSmileyMenu; 31 32 IBOutlet NSMenu *_debugMenu; 32 33 33 34 IBOutlet NSMenuItem *_disconnectMenuItem; 34 35 IBOutlet NSMenuItem *_deleteMenuItem; 35 36 36 37 NSString *_clientVersion; 38 NSMutableDictionary *_smileys; 39 NSArray *_sortedSmileys; 37 40 unsigned int _unread; 38 41 } … … 47 50 48 51 - (NSString *)clientVersion; 52 53 - (NSArray *)allSmileys; 54 - (NSString *)pathForSmiley:(NSString *)smiley; 49 55 50 56 - (IBAction)about:(id)sender; WiredClient/trunk/WCApplicationController.m
r4084 r4121 44 44 - (void)_update; 45 45 - (void)_updateApplicationIcon; 46 - (void)_updateSmileysMenu; 46 47 - (void)_updateBookmarksMenu; 48 49 - (void)_loadSmileys; 47 50 48 51 @end … … 65 68 [NSApp setApplicationIconImage: 66 69 [[NSImage imageNamed:@"NSApplicationIcon"] badgedImageWithInt:_unread]]; 70 } 71 72 73 74 - (void)_updateSmileysMenu { 67 75 } 68 76 … … 100 108 i++; 101 109 } 110 } 111 112 113 114 #pragma mark - 115 116 static int _WCCompareSmileyLength(id object1, id object2, void *context) { 117 unsigned int length1 = [object1 length]; 118 unsigned int length2 = [object2 length]; 119 120 if(length1 > length2) 121 return -1; 122 else if(length1 < length2) 123 return 1; 124 125 return 0; 126 } 127 128 129 130 - (void)_loadSmileys { 131 NSBundle *bundle; 132 NSMenuItem *item; 133 NSMutableArray *array; 134 NSDictionary *dictionary, *list, *map, *names; 135 NSEnumerator *enumerator; 136 NSString *path, *file, *name, *smiley, *title; 137 138 bundle = [self bundle]; 139 path = [bundle pathForResource:@"Smileys" ofType:@"plist"]; 140 dictionary = [NSDictionary dictionaryWithContentsOfFile:path]; 141 list = [dictionary objectForKey:@"List"]; 142 map = [dictionary objectForKey:@"Map"]; 143 enumerator = [map keyEnumerator]; 144 _smileys = [[NSMutableDictionary alloc] initWithCapacity:[map count]]; 145 146 while((smiley = [enumerator nextObject])) { 147 file = [map objectForKey:smiley]; 148 path = [bundle pathForResource:file ofType:NULL]; 149 150 if(path) 151 [_smileys setObject:path forKey:[smiley lowercaseString]]; 152 else 153 NSLog(@"*** -[%@ %@]: could not find image \"%@\"", [self class], NSStringFromSelector(_cmd), file); 154 } 155 156 157 array = [NSMutableArray arrayWithObjects: 158 @"Smile.tiff", 159 @"Wink.tiff", 160 @"Frown.tiff", 161 @"Slant.tiff", 162 @"Gasp.tiff", 163 @"Laugh.tiff", 164 @"Kiss.tiff", 165 @"Yuck.tiff", 166 @"Embarrassed.tiff", 167 @"Footinmouth.tiff", 168 @"Cool.tiff", 169 @"Angry.tiff", 170 @"Innocent.tiff", 171 @"Cry.tiff", 172 @"Sealed.tiff", 173 @"Moneymouth.tiff", 174 NULL]; 175 176 names = [NSDictionary dictionaryWithObjectsAndKeys: 177 NSLS(@"Smile", @"Smiley"), @"Smile.tiff", 178 NSLS(@"Wink", @"Smiley"), @"Wink.tiff", 179 NSLS(@"Frown", @"Smiley"), @"Frown.tiff", 180 NSLS(@"Undecided", @"Smiley"), @"Slant.tiff", 181 NSLS(@"Gasp", @"Smiley"), @"Gasp.tiff", 182 NSLS(@"Laugh", @"Smiley"), @"Laugh.tiff", 183 NSLS(@"Kiss", @"Smiley"), @"Kiss.tiff", 184 NSLS(@"Sticking out tongue", @"Smiley"), @"Yuck.tiff", 185 NSLS(@"Embarrassed", @"Smiley"), @"Embarrassed.tiff", 186 NSLS(@"Foot in mouth", @"Smiley"), @"Footinmouth.tiff", 187 NSLS(@"Cool", @"Smiley"), @"Cool.tiff", 188 NSLS(@"Angry", @"Smiley"), @"Angry.tiff", 189 NSLS(@"Innocent", @"Smiley"), @"Innocent.tiff", 190 NSLS(@"Cry", @"Smiley"), @"Cry.tiff", 191 NSLS(@"Lips are sealed", @"Smiley"), @"Sealed.tiff", 192 NSLS(@"Money-mouth", @"Smiley"), @"Moneymouth.tiff", 193 NULL]; 194 195 [array addObjectsFromArray:[[[[NSSet setWithArray:[list allKeys]] setByMinusingSet:[NSSet setWithArray:array]] allObjects] sortedArrayUsingSelector:@selector(compare:)]]; 196 197 enumerator = [array objectEnumerator]; 198 199 while((name = [enumerator nextObject])) { 200 smiley = [list objectForKey:name]; 201 path = [_smileys objectForKey:[smiley lowercaseString]]; 202 title = [names objectForKey:name]; 203 204 if(!title) 205 title = [name stringByDeletingPathExtension]; 206 207 item = [NSMenuItem itemWithTitle:title]; 208 [item setRepresentedObject:path]; 209 [item setImage:[[[NSImage alloc] initWithContentsOfFile:path] autorelease]]; 210 [item setAction:@selector(insertSmiley:)]; 211 [item setToolTip:smiley]; 212 [_insertSmileyMenu addItem:item]; 213 } 214 215 _sortedSmileys = [[[_smileys allKeys] sortedArrayUsingFunction:_WCCompareSmileyLength context:NULL] retain]; 102 216 } 103 217 … … 201 315 [_deleteMenuItem setKeyEquivalentModifierMask:NSCommandKeyMask]; 202 316 317 [self _loadSmileys]; 318 203 319 [self _update]; 320 [self _updateSmileysMenu]; 204 321 [self _updateBookmarksMenu]; 205 322 … … 385 502 386 503 504 #pragma mark - 505 506 - (NSArray *)allSmileys { 507 return _sortedSmileys; 508 } 509 510 511 512 - (NSString *)pathForSmiley:(NSString *)smiley { 513 return [_smileys objectForKey:[smiley lowercaseString]]; 514 } 515 516 387 517 388 518 #pragma mark - WiredClient/trunk/WCChat.h
r4114 r4121 68 68 69 69 WITextFilter *_chatFilter; 70 WITextFilter *_topicFilter; 70 71 NSDate *_timestamp; 71 72 WCTopic *_topic; WiredClient/trunk/WCChat.m
r4114 r4121 74 74 - (BOOL)_runCommand:(NSString *)command; 75 75 76 - (NSString *)_completeString:(NSString *)string; 76 - (NSString *)_stringByCompletingString:(NSString *)string; 77 - (NSString *)_stringByDecomposingAttributedString:(NSAttributedString *)attributedString; 77 78 78 79 @end … … 144 145 145 146 - (void)_updateTopic { 147 NSMutableAttributedString *string; 148 146 149 if(_topic) { 150 string = [NSMutableAttributedString attributedStringWithString:[_topic topic]]; 151 147 152 [_topicTextField setToolTip:[_topic topic]]; 148 [_topicTextField set StringValue:[_topic topic]];153 [_topicTextField setAttributedStringValue:[string attributedStringByApplyingFilter:_topicFilter]]; 149 154 [_topicNickTextField setStringValue:[NSSWF: 150 155 NSLS(@"%@ %C %@", @"Chat topic set by (nick, time)"), … … 509 514 #pragma mark - 510 515 511 - (NSString *)_ completeString:(NSString *)string {516 - (NSString *)_stringByCompletingString:(NSString *)string { 512 517 NSEnumerator *enumerator, *setEnumerator; 513 518 NSArray *nicks, *commands, *set, *matchingSet = NULL; … … 551 556 } 552 557 558 559 560 - (NSString *)_stringByDecomposingAttributedString:(NSAttributedString *)attributedString { 561 if(![attributedString containsAttachments]) 562 return [attributedString string]; 563 564 return [[attributedString attributedStringByReplacingAttachmentsWithStrings] string]; 565 } 566 553 567 @end 554 568 … … 655 669 656 670 [_chatFilter release]; 671 [_topicFilter release]; 657 672 [_timestamp release]; 658 673 [_topic release]; … … 678 693 679 694 [_chatOutputTextView setEditable:NO]; 695 [_chatOutputTextView setUsesFindPanel:YES]; 680 696 [_userListTableView setDoubleAction:@selector(sendPrivateMessage:)]; 681 697 682 _chatFilter = [[WITextFilter alloc] initWithSelectors:@selector(filterWiredChat:), @selector(filterURLs:), 0]; 698 _chatFilter = [[WITextFilter alloc] initWithSelectors:@selector(filterWiredChat:), @selector(filterURLs:), @selector(filterWiredSmilies:), 0]; 699 _topicFilter = [[WITextFilter alloc] initWithSelectors:@selector(filterURLs:), @selector(filterWiredSmallSmilies:), 0]; 683 700 684 701 [self _update]; … … 1124 1141 unsigned int length; 1125 1142 1126 string = [_chatInputTextView string];1143 string = [self _stringByDecomposingAttributedString:[_chatInputTextView textStorage]]; 1127 1144 length = [string length]; 1128 1145 … … 1162 1179 else if(selector == @selector(insertTab:)) { 1163 1180 if([WCSettings boolForKey:WCTabCompleteNicks]) { 1164 [_chatInputTextView setString:[self _ completeString:[_chatInputTextView string]]];1181 [_chatInputTextView setString:[self _stringByCompletingString:[_chatInputTextView string]]]; 1165 1182 1166 1183 return YES; … … 1630 1647 #pragma mark - 1631 1648 1649 - (void)insertSmiley:(id)sender { 1650 NSFileWrapper *wrapper; 1651 NSTextAttachment *attachment; 1652 NSAttributedString *attributedString; 1653 1654 wrapper = [[NSFileWrapper alloc] initWithPath:[sender representedObject]]; 1655 attachment = [[WITextAttachment alloc] initWithFileWrapper:wrapper string:[sender toolTip]]; 1656 attributedString = [NSAttributedString attributedStringWithAttachment:attachment]; 1657 1658 [_chatInputTextView insertText:attributedString]; 1659 1660 [attachment release]; 1661 [wrapper release]; 1662 } 1663 1664 1665 1666 #pragma mark - 1667 1632 1668 - (int)numberOfRowsInTableView:(NSTableView *)sender { 1633 1669 return [_shownUsers count]; WiredClient/trunk/WCMessages.h
r3655 r4121 62 62 63 63 WITextFilter *_messageFilter; 64 WITextFilter *_userFilter; 64 65 NSImage *_conversationIcon; 65 66 unsigned int _unread; WiredClient/trunk/WCMessages.m
r4084 r4121 91 91 [_titles addObject:NSLS(@"Broadcasts", @"Messages item")]; 92 92 93 _conversations = [[NSMutableArray alloc] init]; 94 _allMessages = [[NSMutableArray alloc] init]; 95 _shownMessages = [[NSMutableArray alloc] init]; 96 _conversationIcon = [[NSImage imageNamed:@"Conversation"] retain]; 97 98 _messageFilter = [[WITextFilter alloc] initWithSelectors:@selector(filterURLs:), 0]; 93 _conversations = [[NSMutableArray alloc] init]; 94 _allMessages = [[NSMutableArray alloc] init]; 95 _shownMessages = [[NSMutableArray alloc] init]; 96 _conversationIcon = [[NSImage imageNamed:@"Conversation"] retain]; 97 98 _messageFilter = [[WITextFilter alloc] initWithSelectors:@selector(filterURLs:), @selector(filterWiredSmilies:), 0]; 99 _userFilter = [[WITextFilter alloc] initWithSelectors:@selector(filterWiredSmallSmilies:), 0]; 99 100 100 101 [self window]; … … 493 494 494 495 [_messageFilter release]; 496 [_userFilter release]; 495 497 [_conversationIcon release]; 496 498 … … 517 519 518 520 [_messageTextView setEditable:NO]; 521 [_messageTextView setUsesFindPanel:YES]; 519 522 520 523 [self _update]; … … 976 979 if(count > 0) 977 980 name = [name stringByAppendingFormat:@" (%u)", count]; 978 981 979 982 return [NSDictionary dictionaryWithObjectsAndKeys: 980 name, WIIconCellTitleKey, 981 image, WIIconCellIconKey, 983 [[NSAttributedString attributedStringWithString:name] attributedStringByApplyingFilter:_userFilter], 984 WIIconCellAttributedTitleKey, 985 image, 986 WIIconCellIconKey, 982 987 NULL]; 983 988 } … … 1057 1062 1058 1063 - (id)tableView:(NSTableView *)sender objectValueForTableColumn:(NSTableColumn *)column row:(int)row { 1059 WCMessage *message; 1064 NSString *string; 1065 WCMessage *message; 1060 1066 1061 1067 message = [self _messageAtIndex:row]; … … 1063 1069 if(column == _userTableColumn) { 1064 1070 if([message direction] == WCMessageTo) 1065 return[NSSWF:NSLS(@"To: %@", @"Message to (nick)"), [[message user] nick]];1071 string = [NSSWF:NSLS(@"To: %@", @"Message to (nick)"), [[message user] nick]]; 1066 1072 else 1067 return [NSSWF:NSLS(@"From: %@", @"Message from (nick)"), [[message user] nick]]; 1073 string = [NSSWF:NSLS(@"From: %@", @"Message from (nick)"), [[message user] nick]]; 1074 1075 return [[NSAttributedString attributedStringWithString:string] attributedStringByApplyingFilter:_userFilter]; 1068 1076 } 1069 1077 else if(column == _timeTableColumn) { WiredClient/trunk/WCNews.m
r3996 r4121 37 37 - (void)_validate; 38 38 39 - (NS MutableAttributedString *)_postWithNick:(NSString *)nick date:(NSDate *)date message:(NSString *)message;39 - (NSAttributedString *)_postWithNick:(NSString *)nick date:(NSDate *)date message:(NSString *)message; 40 40 41 41 @end … … 50 50 51 51 _news = [[NSMutableAttributedString alloc] init]; 52 _newsFilter = [[WITextFilter alloc] initWithSelectors:@selector(filterURLs:), 0];52 _newsFilter = [[WITextFilter alloc] initWithSelectors:@selector(filterURLs:), @selector(filterWiredSmilies:), 0]; 53 53 54 54 [self window]; … … 109 109 #pragma mark - 110 110 111 - (NS MutableAttributedString *)_postWithNick:(NSString *)nick date:(NSDate *)date message:(NSString *)message {111 - (NSAttributedString *)_postWithNick:(NSString *)nick date:(NSDate *)date message:(NSString *)message { 112 112 NSMutableAttributedString *post; 113 113 NSAttributedString *header, *entry; … … 161 161 - (void)windowDidLoad { 162 162 [_newsTextView setEditable:NO]; 163 [_newsTextView setUsesFindPanel:YES]; 163 164 164 165 [self _update]; … … 228 229 229 230 - (void)newsShouldAddNews:(NSNotification *)notification { 230 NSArray *fields;231 NSString *nick, *date, *message;232 NS MutableAttributedString*post;231 NSArray *fields; 232 NSString *nick, *date, *message; 233 NSAttributedString *post; 233 234 234 235 fields = [[notification userInfo] objectForKey:WCArgumentsKey]; … … 256 257 } 257 258 258 [_newsFilter filter:_news]; 259 [[_newsTextView textStorage] setAttributedString:_news]; 259 [[_newsTextView textStorage] setAttributedString:[_news attributedStringByApplyingFilter:_newsFilter]]; 260 260 [_progressIndicator stopAnimation:self]; 261 261 } … … 264 264 265 265 - (void)newsShouldAddNewNews:(NSNotification *)notification { 266 NSArray *fields;267 NSString *nick, *date, *message;268 NS MutableAttributedString*post;266 NSArray *fields; 267 NSString *nick, *date, *message; 268 NSAttributedString *post; 269 269 270 270 fields = [[notification userInfo] objectForKey:WCArgumentsKey]; … … 274 274 275 275 post = [self _postWithNick:nick date:[NSDate dateWithISO8601String:date] message:message]; 276 [_newsFilter filter:post];277 276 [[_news mutableString] insertString:@"\n\n" atIndex:0]; 278 [_news insertAttributedString: postatIndex:0];277 [_news insertAttributedString:[post attributedStringByApplyingFilter:_newsFilter] atIndex:0]; 279 278 [[_newsTextView textStorage] setAttributedString:_news]; 280 279 WiredClient/trunk/WCPreferences.h
r4084 r4121 98 98 IBOutlet NSButton *_timestampEveryLineButton; 99 99 IBOutlet NSColorWell *_timestampEveryLineColorWell; 100 IBOutlet NSButton *_showSmileysButton; 100 101 101 102 IBOutlet NSTableView *_highlightsTableView; WiredClient/trunk/WCPreferences.m
r4103 r4121 394 394 [_timestampEveryLineButton setState:[WCSettings boolForKey:WCTimestampEveryLine]]; 395 395 [_timestampEveryLineColorWell setColor:[WCSettings objectForKey:WCTimestampEveryLineColor]]; 396 [_showSmileysButton setState:[WCSettings boolForKey:WCShowSmileys]]; 396 397 397 398 [_highlightsTableView reloadData]; … … 482 483 [WCSettings setBool:[_timestampEveryLineButton state] forKey:WCTimestampEveryLine]; 483 484 [WCSettings setObject:[_timestampEveryLineColorWell color] forKey:WCTimestampEveryLineColor]; 485 [WCSettings setBool:[_showSmileysButton state] forKey:WCShowSmileys]; 484 486 485 487 // --- events WiredClient/trunk/WCSettings.h
r4084 r4121 99 99 #define WCTimestampEveryLine  
