Changeset 1572
- Timestamp:
- 09/06/04 19:50:06 (4 years ago)
- Files:
-
- WiredClient/trunk/WCChat.h (modified) (4 diffs)
- WiredClient/trunk/WCChat.m (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/WCChat.h
r1413 r1572 1 /* $Id: WCChat.h,v 1.2 0 2004/08/03 19:28:27morris Exp $ */1 /* $Id: WCChat.h,v 1.21 2004/09/06 17:50:06 morris Exp $ */ 2 2 3 3 /* … … 38 38 39 39 40 @class WCConnection, WCSplitView, WCTextView, WCTableView ;40 @class WCConnection, WCSplitView, WCTextView, WCTableView, WCTopic; 41 41 42 42 @interface WCChat : WCWindowController <WCGetInfoValidation> { … … 76 76 77 77 NSDate *_timestamp; 78 WCTopic *_topic; 78 79 } 79 80 … … 101 102 - (void) update; 102 103 - (void) updateButtons; 104 - (void) updateTopic; 105 103 106 - (void) showSetTopic; 104 107 - (void) saveChatToURL:(NSURL *)url; WiredClient/trunk/WCChat.m
r1550 r1572 1 /* $Id: WCChat.m,v 1.6 7 2004/08/28 15:59:11morris Exp $ */1 /* $Id: WCChat.m,v 1.68 2004/09/06 17:50:06 morris Exp $ */ 2 2 3 3 /* … … 50 50 #import "WCTableView.h" 51 51 #import "WCTextView.h" 52 #import "WCTopic.h" 52 53 #import "WCUser.h" 53 54 #import "WCUserInfo.h" … … 93 94 [[NSNotificationCenter defaultCenter] 94 95 addObserver:self 96 selector:@selector(dateDidChange:) 97 name:WCDateDidChange 98 object:NULL]; 99 100 [[NSNotificationCenter defaultCenter] 101 addObserver:self 95 102 selector:@selector(chatShouldAddUser:) 96 103 name:WCChatShouldAddUser … … 178 185 179 186 [_timestamp release]; 187 [_topic release]; 180 188 181 189 [super dealloc]; … … 224 232 [_chatOutputTextView scrollRangeToVisible: 225 233 NSMakeRange([[_chatOutputTextView textStorage] length], 0)]; 234 } 235 236 237 238 - (void)dateDidChange:(NSNotification *)notification { 239 // --- update topic 240 [self updateTopic]; 226 241 } 227 242 … … 881 896 882 897 - (void)chatShouldShowTopic:(NSNotification *)notification { 883 NSString *argument, *cid, *nick, * date, *topic;898 NSString *argument, *cid, *nick, *login, *address, *date, *message; 884 899 NSArray *fields; 885 900 WCConnection *connection; … … 896 911 cid = [fields objectAtIndex:0]; 897 912 nick = [fields objectAtIndex:1]; 913 login = [fields objectAtIndex:2]; 914 address = [fields objectAtIndex:3]; 898 915 date = [fields objectAtIndex:4]; 899 topic= [fields objectAtIndex:5];916 message = [fields objectAtIndex:5]; 900 917 901 918 if([cid unsignedIntValue] != _cid) … … 905 922 return; 906 923 924 // --- create new topic 925 [_topic release]; 926 _topic = [[WCTopic alloc] init]; 927 [_topic setCid:_cid]; 928 [_topic setNick:nick]; 929 [_topic setLogin:login]; 930 [_topic setAddress:address]; 931 [_topic setTime:[NSDate dateWithISO8601String:date]]; 932 [_topic setTopic:message]; 933 934 // --- update 935 [self updateTopic]; 936 907 937 // --- set text fields 908 [_topicTextField setToolTip:topic];938 /* [_topicTextField setToolTip:topic]; 909 939 [_topicTextField setStringValue:topic]; 910 940 [_topicNickTextField setStringValue:[NSString stringWithFormat: … … 913 943 0x2014, 914 944 [[NSDate dateWithISO8601String:date] 915 commonDateStringWithRelative:YES capitalized:YES seconds:NO]]]; 945 commonDateStringWithRelative:YES capitalized:YES seconds:NO]]];*/ 916 946 } 917 947 … … 1305 1335 1306 1336 - (void)updateButtons { 1307 int row;1337 int row; 1308 1338 1309 1339 // --- get row … … 1320 1350 1321 1351 1352 1353 - (void)updateTopic { 1354 // --- set text fields 1355 [_topicTextField setToolTip:[_topic topic]]; 1356 [_topicTextField setStringValue:[_topic topic]]; 1357 [_topicNickTextField setStringValue:[NSString stringWithFormat: 1358 NSLocalizedString(@"%@ %C %@", @"Chat topic set by (nick, time)"), 1359 [_topic nick], 1360 0x2014, 1361 [[_topic time] commonDateStringWithRelative:YES capitalized:YES seconds:NO]]]; 1362 } 1363 1364 1365 1366 #pragma mark - 1322 1367 1323 1368 - (void)showSetTopic {
