Changeset 3546
- Timestamp:
- 01/20/06 20:05:00 (3 years ago)
- Files:
-
- WiredClient/trunk/NSAlert-WCAdditions.m (modified) (2 diffs)
- WiredClient/trunk/NSNotificationCenter-WCAdditions.h (added)
- WiredClient/trunk/NSNotificationCenter-WCAdditions.m (added)
- WiredClient/trunk/WCApplicationController.m (modified) (2 diffs)
- WiredClient/trunk/WCChat.m (modified) (11 diffs)
- WiredClient/trunk/WCConversation.h (modified) (2 diffs)
- WiredClient/trunk/WCConversation.m (modified) (2 diffs)
- WiredClient/trunk/WCDock.m (modified) (3 diffs)
- WiredClient/trunk/WCMessages.m (modified) (13 diffs)
- WiredClient/trunk/WCNews.m (modified) (1 diff)
- WiredClient/trunk/WCServerConnection.h (modified) (2 diffs)
- WiredClient/trunk/WCServerConnection.m (modified) (4 diffs)
- WiredClient/trunk/WCSettings.h (modified) (1 diff)
- WiredClient/trunk/WCSettings.m (modified) (2 diffs)
- WiredClient/trunk/WCTrackers.m (modified) (16 diffs)
- WiredClient/trunk/WCTransfer.h (modified) (1 diff)
- WiredClient/trunk/WCTransfer.m (modified) (5 diffs)
- WiredClient/trunk/WCTransfers.m (modified) (34 diffs)
- WiredClient/trunk/WiredClient.xcodeproj/project.pbxproj (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/NSAlert-WCAdditions.m
r3541 r3546 51 51 [button setAction:@selector(_closeAlert:)]; 52 52 53 [[NSNotificationCenter defaultCenter] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsError]; 54 53 55 [[self window] makeKeyAndOrderFront:self]; 54 56 55 57 [self retain]; 56 58 } … … 67 69 68 70 - (void)beginSheetModalForWindow:(NSWindow *)window { 71 [[NSNotificationCenter defaultCenter] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsError]; 72 69 73 [self beginSheetModalForWindow:window modalDelegate:NULL didEndSelector:NULL contextInfo:NULL]; 70 74 } WiredClient/trunk/WCApplicationController.m
r3545 r3546 152 152 selector:@selector(newsDidReadPost:) 153 153 name:WCNewsDidReadPost]; 154 155 [[NSNotificationCenter defaultCenter] 156 addObserver:self 157 selector:@selector(serverConnectionTriggeredEvent:) 158 name:WCServerConnectionTriggeredEvent]; 154 159 155 160 [[NSAppleEventManager sharedAppleEventManager] … … 263 268 264 269 [self performSelector:@selector(_updateApplicationIcon) withObject:NULL afterDelay:0.0]; 270 } 271 272 273 274 - (void)serverConnectionTriggeredEvent:(NSNotification *)notification { 275 NSDictionary *event; 276 277 event = [notification object]; 278 279 if([event boolForKey:WCEventsPlaySound]) 280 [NSSound playSoundNamed:[event objectForKey:WCEventsSound]]; 281 282 if([event boolForKey:WCEventsBounceInDock]) 283 [NSApp requestUserAttention:NSInformationalRequest]; 265 284 } 266 285 WiredClient/trunk/WCChat.m
r3545 r3546 493 493 494 494 [[self connection] addObserver:self 495 selector:@selector(chatUsersDidChange:) 496 name:WCChatUsersDidChange]; 497 498 [[self connection] addObserver:self 495 499 selector:@selector(chatReceivedUser:) 496 500 name:WCChatReceivedUser]; … … 617 621 - (void)dateDidChange:(NSNotification *)notification { 618 622 [self _updateTopic]; 623 } 624 625 626 627 - (void)chatUsersDidChange:(NSNotification *)notification { 628 [_userListTableView reloadData]; 619 629 } 620 630 … … 680 690 681 691 [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 682 [_userListTableView reloadData];683 692 } 684 693 … … 730 739 731 740 [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 732 [_userListTableView reloadData]; 733 734 // [[self connection] postNotificationName:WCConnectionTriggeredEvent 735 // object:[NSNumber numberWithInt:WCEventsUserJoined]]; 741 742 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsUserJoined]; 736 743 } 737 744 … … 751 758 752 759 user = [self userWithUserID:[uid unsignedIntValue]]; 760 761 if(!user) 762 return; 753 763 754 764 if([[WCSettings eventForTag:WCEventsUserLeft] boolForKey:WCEventsPostInChat]) … … 759 769 760 770 [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 761 [_userListTableView reloadData]; 762 763 // [[self connection] postNotificationName:WCConnectionTriggeredEvent 764 // object:[NSNumber numberWithInt:WCEventsUserLeft]]; 771 772 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsUserLeft]; 765 773 } 766 774 … … 795 803 796 804 [_userListTableView setNeedsDisplay:YES]; 805 806 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsUserChangedNick]; 797 807 } 798 808 … … 847 857 848 858 [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 849 [_userListTableView reloadData];850 859 } 851 860 … … 874 883 875 884 [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 876 [_userListTableView reloadData];877 885 } 878 886 … … 902 910 [self _printChat:chat by:user]; 903 911 904 // [[self connection] postNotificationName:WCConnectionTriggeredEvent 905 // object:[NSNumber numberWithInt:WCEventsChatReceived]]; 912 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsChatReceived]; 906 913 } 907 914 … … 931 938 [self _printActionChat:chat by:user]; 932 939 933 // [[self connection] postNotificationName:WCConnectionTriggeredEvent 934 // object:[NSNumber numberWithInt:WCEventsChatReceived]]; 940 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsChatReceived]; 935 941 } 936 942 WiredClient/trunk/WCConversation.h
r3440 r3546 27 27 */ 28 28 29 enum WCConversationType {30 WCConversation TypeMessage,31 WCConversation TypeBroadcast29 enum _WCConversationType { 30 WCConversationMessage, 31 WCConversationBroadcast 32 32 }; 33 typedef enum WCConversationTypeWCConversationType;33 typedef enum _WCConversationType WCConversationType; 34 34 35 35 … … 42 42 43 43 44 - (id)initWithType:(WCConversationType)type;45 - (id)initWithType:(WCConversationType)type user:(WCUser *)user;44 + (id)messageConversationWithUser:(WCUser *)user; 45 + (id)broadcastConversationWithUser:(WCUser *)user; 46 46 47 47 - (WCConversationType)type; WiredClient/trunk/WCConversation.m
r3440 r3546 30 30 #import "WCUser.h" 31 31 32 @i mplementation WCConversation32 @interface WCConversation(Private) 33 33 34 - (id) initWithType:(WCConversationType)type {35 return [self initWithType:type user:NULL]; 36 } 34 - (id)_initWithType:(WCConversationType)type user:(WCUser *)user; 35 36 @end 37 37 38 38 39 @implementation WCConversation(Private) 39 40 40 - (id) initWithType:(WCConversationType)type user:(WCUser *)user {41 - (id)_initWithType:(WCConversationType)type user:(WCUser *)user { 41 42 self = [super init]; 42 43 … … 45 46 46 47 return self; 48 } 49 50 @end 51 52 53 @implementation WCConversation 54 55 + (id)messageConversationWithUser:(WCUser *)user { 56 return [[[self alloc] _initWithType:WCConversationMessage user:user] autorelease]; 57 } 58 59 60 61 + (id)broadcastConversationWithUser:(WCUser *)user { 62 return [[[self alloc] _initWithType:WCConversationBroadcast user:user] autorelease]; 47 63 } 48 64 WiredClient/trunk/WCDock.m
r3545 r3546 253 253 254 254 connection = [notification object]; 255 [_shownConnections addObject:connection]; 255 256 if(![_shownConnections containsObject:connection]) 257 [_shownConnections addObject:connection]; 256 258 257 259 if([WCSettings boolForKey:WCAutoHideOnSwitch]) { … … 355 357 int i; 356 358 357 if([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]) 359 if([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]) { 358 360 connection = [(WCConnectionController *) [[NSApp keyWindow] windowController] connection]; 359 else 360 connection = [_shownConnections lastObject]; 361 362 if(!connection) 363 return; 364 365 i = [_shownConnections indexOfObject:connection] + 1; 366 367 if((unsigned int) i >= [_shownConnections count]) 368 i = 0; 369 370 nextConnection = [self _connectionAtIndex:i]; 371 372 if(connection != nextConnection) 361 362 i = [_shownConnections indexOfObject:connection] + 1; 363 364 if((unsigned int) i >= [_shownConnections count]) 365 i = 0; 366 367 nextConnection = [self _connectionAtIndex:i]; 368 } else { 369 nextConnection = [self _connectionAtIndex:0]; 370 } 371 372 if(nextConnection && connection != nextConnection) 373 373 [self _openConnection:nextConnection]; 374 374 } … … 380 380 int i; 381 381 382 if([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]) 382 if([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]) { 383 383 connection = [(WCConnectionController *) [[NSApp keyWindow] windowController] connection]; 384 else 385 connection = [self _connectionAtIndex:0]; 386 387 if(!connection) 388 return; 389 390 i = [_shownConnections indexOfObject:connection] - 1; 391 392 if(i < 0) 393 i = [_shownConnections count] - 1; 394 395 previousConnection = [self _connectionAtIndex:i]; 396 397 if(connection != previousConnection) 384 385 i = [_shownConnections indexOfObject:connection] - 1; 386 387 if(i < 0) 388 i = [_shownConnections count] - 1; 389 390 previousConnection = [self _connectionAtIndex:i]; 391 } else { 392 previousConnection = [_shownConnections lastObject]; 393 } 394 395 if(previousConnection && connection != previousConnection) 398 396 [self _openConnection:previousConnection]; 399 397 } WiredClient/trunk/WCMessages.m
r3540 r3546 355 355 [_allMessages addObject:message]; 356 356 357 conversation = [[WCConversation alloc] initWithType:WCConversationTypeMessage user:user]; 357 conversation = [WCConversation messageConversationWithUser:user]; 358 358 359 if(![_conversations containsObject:conversation]) 359 360 [_conversations addObject:conversation]; 360 [conversation release];361 361 362 362 [_conversationsOutlineView reloadData]; … … 368 368 369 369 [[self connection] postNotificationName:WCMessagesDidAddMessage object:[self connection]]; 370 371 // [[self connection] postNotificationName:WCConnectionTriggeredEvent 372 // object:[NSNumber numberWithInt:WCEventsMessageReceived]]; 370 371 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsMessageReceived]; 373 372 } 374 373 … … 392 391 [_allMessages addObject:message]; 393 392 394 conversation = [[WCConversation alloc] initWithType:WCConversationTypeBroadcast user:user]; 393 conversation = [WCConversation messageConversationWithUser:user]; 394 395 395 if(![_conversations containsObject:conversation]) 396 396 [_conversations addObject:conversation]; 397 [conversation release];398 397 399 398 [_conversationsOutlineView reloadData]; … … 403 402 404 403 [[self connection] postNotificationName:WCMessagesDidAddMessage object:[self connection]]; 405 406 // [[self connection] postNotificationName:WCConnectionTriggeredEvent 407 // object:[NSNumber numberWithInt:WCEventsBroadcastReceived]]; 404 405 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsBroadcastReceived]; 408 406 } 409 407 … … 453 451 454 452 455 - (void)clearSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 456 if(returnCode == NSAlertDefaultReturn) 457 [self _deleteMessages]; 453 - (BOOL)textView:(NSTextView *)textView doCommandBySelector:(SEL)selector { 454 BOOL value = NO; 455 456 if(selector == @selector(insertNewline:)) { 457 if([[NSApp currentEvent] character] == NSEnterCharacter) { 458 [self submitSheet:textView]; 459 460 value = YES; 461 } 462 } 463 464 return value; 465 } 466 467 468 469 #pragma mark - 470 471 - (void)showNextUnreadMessage { 472 } 473 474 475 476 - (void)showPreviousUnreadMessage { 477 } 478 479 480 481 - (void)showPrivateMessageToUser:(WCUser *)user { 482 [_userTextField setStringValue:[user nick]]; 483 484 [self showWindow:self]; 485 486 [NSApp beginSheet:_replyPanel 487 modalForWindow:[self window] 488 modalDelegate:self 489 didEndSelector:@selector(replySheetDidEnd:returnCode:contextInfo:) 490 contextInfo:[user retain]]; 491 } 492 493 494 495 - (void)showPrivateMessageReplyWithString:(NSString *)string { 496 if([_replyButton isEnabled]) { 497 [_replyTextView setString:string]; 498 499 [self reply:self]; 500 } 501 } 502 503 504 505 - (unsigned int)numberOfUnreadMessages { 506 return _unread; 507 } 508 509 510 511 #pragma mark - 512 513 - (IBAction)broadcast:(id)sender { 514 [self showWindow:self]; 515 516 [NSApp beginSheet:_broadcastPanel 517 modalForWindow:[self window] 518 modalDelegate:self 519 didEndSelector:@selector(broadcastSheetDidEnd:returnCode:contextInfo:) 520 contextInfo:NULL]; 521 } 522 523 524 525 - (void)broadcastSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 526 if(returnCode == NSRunStoppedResponse) 527 [[self connection] sendCommand:WCBroadcastCommand withArgument:[_broadcastTextView string]]; 528 529 [_broadcastPanel close]; 530 [_broadcastTextView setString:@""]; 531 } 532 533 534 535 - (IBAction)reply:(id)sender { 536 WCMessage *message; 537 538 message = [self _selectedMessage]; 539 [_userTextField setStringValue:[[message user] nick]]; 540 541 [NSApp beginSheet:_replyPanel 542 modalForWindow:[self window] 543 modalDelegate:self 544 didEndSelector:@selector(replySheetDidEnd:returnCode:contextInfo:) 545 contextInfo:[[message user] retain]]; 458 546 } 459 547 … … 470 558 [_allMessages addObject:message]; 471 559 472 conversation = [[WCConversation alloc] initWithType:WCConversationTypeMessage user:user]; 560 conversation = [WCConversation messageConversationWithUser:user]; 561 473 562 if(![_conversations containsObject:conversation]) 474 563 [_conversations addObject:conversation]; 475 [conversation release];476 564 477 565 [[self connection] sendCommand:WCMessageCommand … … 491 579 [_replyPanel close]; 492 580 [_replyTextView setString:@""]; 493 }494 495 496 497 - (void)broadcastSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {498 if(returnCode == NSRunStoppedResponse)499 [[self connection] sendCommand:WCBroadcastCommand withArgument:[_broadcastTextView string]];500 501 [_broadcastPanel close];502 [_broadcastTextView setString:@""];503 }504 505 506 507 - (BOOL)textView:(NSTextView *)textView doCommandBySelector:(SEL)selector {508 BOOL value = NO;509 510 if(selector == @selector(insertNewline:)) {511 if([[NSApp currentEvent] character] == NSEnterCharacter) {512 [self submitSheet:textView];513 514 value = YES;515 }516 }517 518 return value;519 }520 521 522 523 #pragma mark -524 525 - (void)showNextUnreadMessage {526 }527 528 529 530 - (void)showPreviousUnreadMessage {531 }532 533 534 535 - (void)showPrivateMessageToUser:(WCUser *)user {536 [_userTextField setStringValue:[user nick]];537 538 [self showWindow:self];539 540 [NSApp beginSheet:_replyPanel541 modalForWindow:[self window]542 modalDelegate:self543 didEndSelector:@selector(replySheetDidEnd:returnCode:contextInfo:)544 contextInfo:[user retain]];545 }546 547 548 549 - (void)showPrivateMessageReplyWithString:(NSString *)string {550 if([_replyButton isEnabled]) {551 [_replyTextView setString:string];552 553 [self reply:self];554 }555 }556 557 558 559 - (unsigned int)numberOfUnreadMessages {560 return _unread;561 }562 563 564 565 #pragma mark -566 567 - (IBAction)broadcast:(id)sender {568 [self showWindow:self];569 570 [NSApp beginSheet:_broadcastPanel571 modalForWindow:[self window]572 modalDelegate:self573 didEndSelector:@selector(broadcastSheetDidEnd:returnCode:contextInfo:)574 contextInfo:NULL];575 }576 577 578 579 - (IBAction)reply:(id)sender {580 WCMessage *message;581 582 message = [self _selectedMessage];583 [_userTextField setStringValue:[[message user] nick]];584 585 [NSApp beginSheet:_replyPanel586 modalForWindow:[self window]587 modalDelegate:self588 didEndSelector:@selector(replySheetDidEnd:returnCode:contextInfo:)589 contextInfo:[[message user] retain]];590 581 } 591 582 … … 609 600 610 601 602 - (void)clearSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 603 if(returnCode == NSAlertDefaultReturn) 604 [self _deleteMessages]; 605 } 606 607 608 611 609 #pragma mark - 612 610 … … 616 614 617 615 if([_titles indexOfObject:item] == 0) 618 return [[self _conversationsForType:WCConversation TypeMessage] count];616 return [[self _conversationsForType:WCConversationMessage] count]; 619 617 else if([_titles indexOfObject:item] == 1) 620 return [[self _conversationsForType:WCConversation TypeBroadcast] count];618 return [[self _conversationsForType:WCConversationBroadcast] count]; 621 619 622 620 return 0; … … 630 628 631 629 if([_titles indexOfObject:item] == 0) 632 return [[self _conversationsForType:WCConversation TypeMessage] objectAtIndex:index];630 return [[self _conversationsForType:WCConversationMessage] objectAtIndex:index]; 633 631 else if([_titles indexOfObject:item] == 1) 634 return [[self _conversationsForType:WCConversation TypeBroadcast] objectAtIndex:index];632 return [[self _conversationsForType:WCConversationBroadcast] objectAtIndex:index]; 635 633 636 634 return NULL; … … 659 657 image = NULL; 660 658 661 if([(WCConversation *) item type] == WCConversation TypeMessage)659 if([(WCConversation *) item type] == WCConversationMessage) 662 660 count = [[self _messagesForTypes:WCMessageTo | WCMessageFrom fromUser:user unreadOnly:YES] count]; 663 else if([(WCConversation *) item type] == WCConversation TypeBroadcast)661 else if([(WCConversation *) item type] == WCConversationBroadcast) 664 662 count = [[self _messagesForTypes:WCMessageBroadcast fromUser:user unreadOnly:YES] count]; 665 663 } … … 689 687 user = [(WCConversation *) item user]; 690 688 691 if([(WCConversation *) item type] == WCConversation TypeMessage)689 if([(WCConversation *) item type] == WCConversationMessage) 692 690 count = [[self _messagesForTypes:WCMessageTo | WCMessageFrom fromUser:user unreadOnly:YES] count]; 693 else if([(WCConversation *) item type] == WCConversation TypeBroadcast)691 else if([(WCConversation *) item type] == WCConversationBroadcast) 694 692 count = [[self _messagesForTypes:WCMessageBroadcast fromUser:user unreadOnly:YES] count]; 695 693 } … … 729 727 user = [(WCConversation *) item user]; 730 728 731 if([(WCConversation *) item type] == WCConversation TypeMessage)729 if([(WCConversation *) item type] == WCConversationMessage) 732 730 messages = [self _messagesForTypes:WCMessageTo | WCMessageFrom fromUser:user unreadOnly:NO]; 733 else if([(WCConversation *) item type] == WCConversation TypeBroadcast)731 else if([(WCConversation *) item type] == WCConversationBroadcast) 734 732 messages = [self _messagesForTypes:WCMessageBroadcast fromUser:user unreadOnly:NO]; 735 733 } WiredClient/trunk/WCNews.m
r3413 r3546 234 234 } 235 235 236 // [[self connection] postNotificationName:WCConnectionTriggeredEvent 237 // object:[NSNumber numberWithInt:WCEventsNewsPosted]]; 236 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsNewsPosted]; 238 237 } 239 238 WiredClient/trunk/WCServerConnection.h
r3545 r3546 66 66 #define WCServerConnectionShouldHide @"WCServerConnectionShouldHide" 67 67 #define WCServerConnectionShouldUnhide @"WCServerConnectionShouldUnhide" 68 #define WCServerConnectionTriggeredEvent @"WCServerConnectionTriggeredEvent" 68 69 69 70 #define WCServerConnectionServerInfoDidChange @"WCServerConnectionServerInfoDidChange" … … 131 132 - (IBAction)connect:(id)sender; 132 133 134 - (void)postNotificationName:(NSString *)name eventTag:(int)tag; 135 133 136 - (void)reconnect; 134 137 - (void)hide; WiredClient/trunk/WCServerConnection.m
r3545 r3546 28 28 29 29 #import "NSAlert-WCAdditions.h" 30 #import "NSNotificationCenter-WCAdditions.h" 30 31 #import "WCAccount.h" 31 32 #import "WCAccounts.h" … … 308 309 [_link release]; 309 310 _link = NULL; 311 312 if(![[self window] isVisible]) 313 [self postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsServerDisconnected]; 310 314 } 311 315 … … 387 391 _reconnecting = NO; 388 392 393 [self postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsServerConnected]; 394 389 395 [self postNotificationName:WCServerConnectionLoggedIn object:self]; 390 396 } … … 468 474 469 475 [[NSNotificationCenter defaultCenter] mainThreadPostNotificationName:name object:object userInfo:userInfo]; 476 } 477 478 479 480 - (void)postNotificationName:(NSString *)name eventTag:(int)tag { 481 [_notificationCenter mainThreadPostNotificationName:name eventTag:tag]; 482 483 [[NSNotificationCenter defaultCenter] mainThreadPostNotificationName:name eventTag:tag]; 470 484 } 471 485 WiredClient/trunk/WCSettings.h
r3540 r3546 145 145 #define WCSSLNullTransferCiphers @"WCSSLNullTransferCiphers" 146 146 147 #define WCDebug @"WCDebug"148 149 147 150 148 + (NSDictionary *)eventForTag:(int)tag; WiredClient/trunk/WCSettings.m
r3540 r3546 234 234 235 235 // --- bookmarks 236 [NSArray arrayWithObject: 237 [NSDictionary dictionaryWithObjectsAndKeys: 238 @"Zanka Server", WCBookmarksName, 239 @"wired.zankasoftware.com", WCBookmarksAddress, 240 @"", WCBookmarksLogin, 241 @"", WCBookmarksPassword, 242 [NSString UUIDString], WCBookmarksIdentifier, 243 @"", WCBookmarksNick, 244 @"", WCBookmarksStatus, 245 NULL]], 236 [NSArray arrayWithObject:[NSDictionary dictionary]], 246 237 WCBookmarks, 247 238 … … 352 343 WCSSLNullTransferCiphers, 353 344 354 // --- internal355 [NSNumber numberWithBool:NO],356 WCDebug,357 358 345 NULL]; 359 346 } WiredClient/trunk/WCTrackers.m
r3542 r3546 36 36 - (void)_updateStatus; 37 37 - (void)_updateTrackers; 38 - (WCTracker *) trackerAtIndex:(int)index;39 - (WCTracker *) itemAtIndex:(int)index;40 - (WCTracker *) itemAtIndex:(int)index inTracker:(WCTracker *)tracker;41 - (WCTracker *) selectedItem;38 - (WCTracker *)_trackerAtIndex:(int)index; 39 - (WCTracker *)_itemAtIndex:(int)index; 40 - (WCTracker *)_itemAtIndex:(int)index inTracker:(WCTracker *)tracker; 41 - (WCTracker *)_selectedTracker; 42 42 - (void)_sortTrackers; 43 43 - (void)_openTracker:(WCTracker *)tracker; … … 49 49 50 50 - (void)_updateStatus { 51 WCTracker * item;51 WCTracker *tracker; 52 52 int count; 53 53 54 // --- get tracker 55 item = [self selectedItem]; 56 57 if(!item) { 54 tracker = [self _selectedTracker]; 55 56 if(!tracker) { 58 57 [_statusTextField setStringValue:@""]; 59 58 … … 61 60 } 62 61 63 // --- display status 64 count = [item numberOfServers]; 65 66 switch([item type]) { 62 count = [tracker numberOfServers]; 63 64 switch([tracker type]) { 67 65 case WCTrackerBonjour: 68 66 [_statusTextField setStringValue:[NSSWF: … … 78 76 [_statusTextField setStringValue:[NSSWF: 79 77 @"%@ %C %d %@", 80 [ itemname],78 [tracker name], 81 79 0x2014, 82 80 count, … … 89 87 [_statusTextField setStringValue:[NSSWF: 90 88 @"%@ %C %d %@", 91 [ itemname],89 [tracker name], 92 90 0x2014, 93 91 count, … … 100 98 [_statusTextField setStringValue:[NSSWF: 101 99 @"%@ %C %@", 102 [ itemname],100 [tracker name], 103 101 0x2014, 104 [ itemnetService]102 [tracker netService] 105 103 ? NSLS(@"Local server via Bonjour", @"Description of server via Bonjour tracker") 106 : [[ itemURL] string]]];104 : [[tracker URL] string]]]; 107 105 break; 108 106 } … … 115 113 NSDictionary *bookmark; 116 114 117 // --- reset trackers118 115 [_trackers removeAllObjects]; 119 116 [_trackers addObject:_bonjourTracker]; 120 117 121 // --- then add from bookmarks122 118 enumerator = [[WCSettings objectForKey:WCTrackerBookmarks] objectEnumerator]; 123 119 … … 125 121 [_trackers addObject:[WCTracker trackerWithBookmark:bookmark]]; 126 122 127 // --- reload table128 123 [_trackersOutlineView reloadData]; 129 124 } … … 131 126 132 127 133 - (WCTracker *) trackerAtIndex:(int)index {128 - (WCTracker *)_trackerAtIndex:(int)index { 134 129 return [_trackers objectAtIndex:index]; 135 130 } … … 137 132 138 133 139 - (WCTracker *) itemAtIndex:(int)index {134 - (WCTracker *)_itemAtIndex:(int)index { 140 135 return [_trackersOutlineView itemAtRow:index]; 141 136 } … … 143 138 144 139 145 - (WCTracker *) itemAtIndex:(int)index inTracker:(WCTracker *)tracker {140 - (WCTracker *)_itemAtIndex:(int)index inTracker:(WCTracker *)tracker { 146 141 NSArray *children; 147 142 int i; … … 157 152 158 153 159 - (WCTracker *) selectedItem{154 - (WCTracker *)_selectedTracker { 160 155 int row; 161 156 … … 430 425 WCServerConnection *connection; 431 426 432 tracker = [self selectedItem];427 tracker = [self _selectedTracker]; 433 428 url = [tracker URL]; 434 429 … … 522 517 - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item { 523 518 if(!item) 524 return [self trackerAtIndex:index];525 526 return [self itemAtIndex:index inTracker:item];519 return [self _trackerAtIndex:index]; 520 521 return [self _itemAtIndex:index inTracker:item]; 527 522 } 528 523 … … 607 602 NSPasteboard *pasteboard; 608 603 NSString *string; 609 WCTracker * item;610 611 item = [self selectedItem];612 613 if([ itemURL])614 string = [[ itemURL] string];604 WCTracker *tracker; 605 606 tracker = [self _selectedTracker]; 607 608 if([tracker URL]) 609 string = [[tracker URL] string]; 615 610 else 616 string = [ itemname];611 string = [tracker name]; 617 612 618 613 pasteboard = [NSPasteboard generalPasteboard]; … … 624 619 625 620 - (NSString *)tableView:(NSTableView *)tableView stringValueForRow:(int)row { 626 return [[self itemAtIndex:row] name];621 return [[self _itemAtIndex:row] name]; 627 622 } 628 623 WiredClient/trunk/WCTransfer.h
r3413 r3546 27 27 */ 28 28 29 enum WCTransferType {30 WCTransfer TypeDownload,31 WCTransfer TypeUpload29 enum _WCTransferType { 30 WCTransferDownload, 31 WCTransferUpload 32 32 };&nbs
