Changeset 3546

Show
Ignore:
Timestamp:
01/20/06 20:05:00 (3 years ago)
Author:
morris
Message:

Dock fixes for getting to next/previous connection when no connection is active


Make events work again


Cleanup, cleanup, cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/NSAlert-WCAdditions.m

    r3541 r3546  
    5151        [button setAction:@selector(_closeAlert:)]; 
    5252 
     53        [[NSNotificationCenter defaultCenter] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsError]; 
     54 
    5355        [[self window] makeKeyAndOrderFront:self]; 
    54          
     56 
    5557        [self retain]; 
    5658} 
     
    6769 
    6870- (void)beginSheetModalForWindow:(NSWindow *)window { 
     71        [[NSNotificationCenter defaultCenter] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsError]; 
     72 
    6973        [self beginSheetModalForWindow:window modalDelegate:NULL didEndSelector:NULL contextInfo:NULL]; 
    7074} 
  • WiredClient/trunk/WCApplicationController.m

    r3545 r3546  
    152152                   selector:@selector(newsDidReadPost:) 
    153153                           name:WCNewsDidReadPost]; 
     154 
     155        [[NSNotificationCenter defaultCenter] 
     156                addObserver:self 
     157                   selector:@selector(serverConnectionTriggeredEvent:) 
     158                           name:WCServerConnectionTriggeredEvent]; 
    154159         
    155160        [[NSAppleEventManager sharedAppleEventManager] 
     
    263268         
    264269        [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]; 
    265284} 
    266285 
  • WiredClient/trunk/WCChat.m

    r3545 r3546  
    493493 
    494494        [[self connection] addObserver:self 
     495                                                  selector:@selector(chatUsersDidChange:) 
     496                                                          name:WCChatUsersDidChange]; 
     497 
     498        [[self connection] addObserver:self 
    495499                                                  selector:@selector(chatReceivedUser:) 
    496500                                                          name:WCChatReceivedUser]; 
     
    617621- (void)dateDidChange:(NSNotification *)notification { 
    618622        [self _updateTopic]; 
     623} 
     624 
     625 
     626 
     627- (void)chatUsersDidChange:(NSNotification *)notification { 
     628        [_userListTableView reloadData]; 
    619629} 
    620630 
     
    680690 
    681691        [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 
    682         [_userListTableView reloadData]; 
    683692} 
    684693 
     
    730739         
    731740        [[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]; 
    736743} 
    737744 
     
    751758 
    752759        user = [self userWithUserID:[uid unsignedIntValue]]; 
     760         
     761        if(!user) 
     762                return; 
    753763 
    754764        if([[WCSettings eventForTag:WCEventsUserLeft] boolForKey:WCEventsPostInChat]) 
     
    759769         
    760770        [[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]; 
    765773} 
    766774 
     
    795803 
    796804        [_userListTableView setNeedsDisplay:YES]; 
     805 
     806        [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsUserChangedNick]; 
    797807} 
    798808 
     
    847857         
    848858        [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 
    849         [_userListTableView reloadData]; 
    850859} 
    851860 
     
    874883         
    875884        [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 
    876         [_userListTableView reloadData]; 
    877885} 
    878886 
     
    902910        [self _printChat:chat by:user]; 
    903911 
    904 //      [[self connection] postNotificationName:WCConnectionTriggeredEvent 
    905 //                                                                       object:[NSNumber numberWithInt:WCEventsChatReceived]]; 
     912        [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsChatReceived]; 
    906913} 
    907914 
     
    931938        [self _printActionChat:chat by:user]; 
    932939 
    933 //      [[self connection] postNotificationName:WCConnectionTriggeredEvent 
    934 //                                                                       object:[NSNumber numberWithInt:WCEventsChatReceived]]; 
     940        [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsChatReceived]; 
    935941} 
    936942 
  • WiredClient/trunk/WCConversation.h

    r3440 r3546  
    2727 */ 
    2828 
    29 enum WCConversationType { 
    30         WCConversationTypeMessage, 
    31         WCConversationTypeBroadcast 
     29enum _WCConversationType { 
     30        WCConversationMessage, 
     31        WCConversationBroadcast 
    3232}; 
    33 typedef enum WCConversationType               WCConversationType; 
     33typedef enum _WCConversationType      WCConversationType; 
    3434 
    3535 
     
    4242 
    4343 
    44 - (id)initWithType:(WCConversationType)type
    45 - (id)initWithType:(WCConversationType)type user:(WCUser *)user; 
     44+ (id)messageConversationWithUser:(WCUser *)user
     45+ (id)broadcastConversationWithUser:(WCUser *)user; 
    4646 
    4747- (WCConversationType)type; 
  • WiredClient/trunk/WCConversation.m

    r3440 r3546  
    3030#import "WCUser.h" 
    3131 
    32 @implementation WCConversation 
     32@interface WCConversation(Private) 
    3333 
    34 - (id)initWithType:(WCConversationType)type { 
    35         return [self initWithType:type user:NULL]; 
    36 
     34- (id)_initWithType:(WCConversationType)type user:(WCUser *)user; 
     35 
     36@end 
    3737 
    3838 
     39@implementation WCConversation(Private) 
    3940 
    40 - (id)initWithType:(WCConversationType)type user:(WCUser *)user { 
     41- (id)_initWithType:(WCConversationType)type user:(WCUser *)user { 
    4142        self = [super init]; 
    4243         
     
    4546         
    4647        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]; 
    4763} 
    4864 
  • WiredClient/trunk/WCDock.m

    r3545 r3546  
    253253         
    254254        connection = [notification object]; 
    255         [_shownConnections addObject:connection]; 
     255         
     256        if(![_shownConnections containsObject:connection]) 
     257                [_shownConnections addObject:connection]; 
    256258 
    257259        if([WCSettings boolForKey:WCAutoHideOnSwitch]) { 
     
    355357        int                                     i; 
    356358         
    357         if([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]) 
     359        if([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]) { 
    358360                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) 
    373373                [self _openConnection:nextConnection]; 
    374374} 
     
    380380        int                                     i; 
    381381         
    382         if([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]) 
     382        if([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]) { 
    383383                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) 
    398396                [self _openConnection:previousConnection]; 
    399397} 
  • WiredClient/trunk/WCMessages.m

    r3540 r3546  
    355355        [_allMessages addObject:message]; 
    356356         
    357         conversation = [[WCConversation alloc] initWithType:WCConversationTypeMessage user:user]; 
     357        conversation = [WCConversation messageConversationWithUser:user]; 
     358 
    358359        if(![_conversations containsObject:conversation]) 
    359360                [_conversations addObject:conversation]; 
    360         [conversation release]; 
    361361         
    362362        [_conversationsOutlineView reloadData]; 
     
    368368 
    369369        [[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]; 
    373372} 
    374373 
     
    392391        [_allMessages addObject:message]; 
    393392 
    394         conversation = [[WCConversation alloc] initWithType:WCConversationTypeBroadcast user:user]; 
     393        conversation = [WCConversation messageConversationWithUser:user]; 
     394 
    395395        if(![_conversations containsObject:conversation]) 
    396396                [_conversations addObject:conversation]; 
    397         [conversation release]; 
    398397         
    399398        [_conversationsOutlineView reloadData]; 
     
    403402 
    404403        [[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]; 
    408406} 
    409407 
     
    453451 
    454452 
    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]]; 
    458546} 
    459547 
     
    470558                        [_allMessages addObject:message]; 
    471559                         
    472                         conversation = [[WCConversation alloc] initWithType:WCConversationTypeMessage user:user]; 
     560                        conversation = [WCConversation messageConversationWithUser:user]; 
     561 
    473562                        if(![_conversations containsObject:conversation]) 
    474563                                [_conversations addObject:conversation]; 
    475                         [conversation release]; 
    476564                         
    477565                        [[self connection] sendCommand:WCMessageCommand 
     
    491579        [_replyPanel close]; 
    492580        [_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:_replyPanel 
    541            modalForWindow:[self window] 
    542                 modalDelegate:self 
    543            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:_broadcastPanel 
    571            modalForWindow:[self window] 
    572                 modalDelegate:self 
    573            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:_replyPanel 
    586            modalForWindow:[self window] 
    587                 modalDelegate:self 
    588            didEndSelector:@selector(replySheetDidEnd:returnCode:contextInfo:) 
    589                   contextInfo:[[message user] retain]]; 
    590581} 
    591582 
     
    609600 
    610601 
     602- (void)clearSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 
     603        if(returnCode == NSAlertDefaultReturn) 
     604                [self _deleteMessages]; 
     605} 
     606 
     607 
     608 
    611609#pragma mark - 
    612610 
     
    616614         
    617615        if([_titles indexOfObject:item] == 0) 
    618                 return [[self _conversationsForType:WCConversationTypeMessage] count]; 
     616                return [[self _conversationsForType:WCConversationMessage] count]; 
    619617        else if([_titles indexOfObject:item] == 1) 
    620                 return [[self _conversationsForType:WCConversationTypeBroadcast] count]; 
     618                return [[self _conversationsForType:WCConversationBroadcast] count]; 
    621619         
    622620        return 0; 
     
    630628         
    631629        if([_titles indexOfObject:item] == 0) 
    632                 return [[self _conversationsForType:WCConversationTypeMessage] objectAtIndex:index]; 
     630                return [[self _conversationsForType:WCConversationMessage] objectAtIndex:index]; 
    633631        else if([_titles indexOfObject:item] == 1) 
    634                 return [[self _conversationsForType:WCConversationTypeBroadcast] objectAtIndex:index]; 
     632                return [[self _conversationsForType:WCConversationBroadcast] objectAtIndex:index]; 
    635633         
    636634        return NULL; 
     
    659657                image = NULL; 
    660658                 
    661                 if([(WCConversation *) item type] == WCConversationTypeMessage) 
     659                if([(WCConversation *) item type] == WCConversationMessage) 
    662660                        count = [[self _messagesForTypes:WCMessageTo | WCMessageFrom fromUser:user unreadOnly:YES] count]; 
    663                 else if([(WCConversation *) item type] == WCConversationTypeBroadcast) 
     661                else if([(WCConversation *) item type] == WCConversationBroadcast) 
    664662                        count = [[self _messagesForTypes:WCMessageBroadcast fromUser:user unreadOnly:YES] count]; 
    665663        } 
     
    689687                user = [(WCConversation *) item user]; 
    690688 
    691                 if([(WCConversation *) item type] == WCConversationTypeMessage) 
     689                if([(WCConversation *) item type] == WCConversationMessage) 
    692690                        count = [[self _messagesForTypes:WCMessageTo | WCMessageFrom fromUser:user unreadOnly:YES] count]; 
    693                 else if([(WCConversation *) item type] == WCConversationTypeBroadcast) 
     691                else if([(WCConversation *) item type] == WCConversationBroadcast) 
    694692                        count = [[self _messagesForTypes:WCMessageBroadcast fromUser:user unreadOnly:YES] count]; 
    695693        }        
     
    729727                user = [(WCConversation *) item user]; 
    730728                 
    731                 if([(WCConversation *) item type] == WCConversationTypeMessage) 
     729                if([(WCConversation *) item type] == WCConversationMessage) 
    732730                        messages = [self _messagesForTypes:WCMessageTo | WCMessageFrom fromUser:user unreadOnly:NO]; 
    733                 else if([(WCConversation *) item type] == WCConversationTypeBroadcast) 
     731                else if([(WCConversation *) item type] == WCConversationBroadcast) 
    734732                        messages = [self _messagesForTypes:WCMessageBroadcast fromUser:user unreadOnly:NO]; 
    735733        } 
  • WiredClient/trunk/WCNews.m

    r3413 r3546  
    234234        } 
    235235 
    236 //      [[self connection] postNotificationName:WCConnectionTriggeredEvent 
    237 //                                                                       object:[NSNumber numberWithInt:WCEventsNewsPosted]]; 
     236        [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsNewsPosted]; 
    238237} 
    239238 
  • WiredClient/trunk/WCServerConnection.h

    r3545 r3546  
    6666#define WCServerConnectionShouldHide                    @"WCServerConnectionShouldHide" 
    6767#define WCServerConnectionShouldUnhide                  @"WCServerConnectionShouldUnhide" 
     68#define WCServerConnectionTriggeredEvent                @"WCServerConnectionTriggeredEvent" 
    6869 
    6970#define WCServerConnectionServerInfoDidChange   @"WCServerConnectionServerInfoDidChange" 
     
    131132- (IBAction)connect:(id)sender; 
    132133 
     134- (void)postNotificationName:(NSString *)name eventTag:(int)tag; 
     135 
    133136- (void)reconnect; 
    134137- (void)hide; 
  • WiredClient/trunk/WCServerConnection.m

    r3545 r3546  
    2828 
    2929#import "NSAlert-WCAdditions.h" 
     30#import "NSNotificationCenter-WCAdditions.h" 
    3031#import "WCAccount.h" 
    3132#import "WCAccounts.h" 
     
    308309        [_link release]; 
    309310        _link = NULL; 
     311 
     312        if(![[self window] isVisible]) 
     313                [self postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsServerDisconnected]; 
    310314} 
    311315 
     
    387391        _reconnecting = NO; 
    388392         
     393        [self postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsServerConnected]; 
     394         
    389395        [self postNotificationName:WCServerConnectionLoggedIn object:self]; 
    390396} 
     
    468474         
    469475        [[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]; 
    470484} 
    471485 
  • WiredClient/trunk/WCSettings.h

    r3540 r3546  
    145145#define WCSSLNullTransferCiphers                                @"WCSSLNullTransferCiphers" 
    146146 
    147 #define WCDebug                                                                 @"WCDebug" 
    148  
    149147 
    150148+ (NSDictionary *)eventForTag:(int)tag; 
  • WiredClient/trunk/WCSettings.m

    r3540 r3546  
    234234                 
    235235                // --- 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]], 
    246237                        WCBookmarks, 
    247238                 
     
    352343                        WCSSLNullTransferCiphers, 
    353344                 
    354                 // --- internal 
    355                 [NSNumber numberWithBool:NO], 
    356                         WCDebug, 
    357                  
    358345                NULL]; 
    359346} 
  • WiredClient/trunk/WCTrackers.m

    r3542 r3546  
    3636- (void)_updateStatus; 
    3737- (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
    4242- (void)_sortTrackers; 
    4343- (void)_openTracker:(WCTracker *)tracker; 
     
    4949 
    5050- (void)_updateStatus { 
    51         WCTracker       *item
     51        WCTracker       *tracker
    5252        int                     count; 
    5353 
    54         // --- get tracker 
    55         item = [self selectedItem]; 
    56          
    57         if(!item) { 
     54        tracker = [self _selectedTracker]; 
     55         
     56        if(!tracker) { 
    5857                [_statusTextField setStringValue:@""]; 
    5958                 
     
    6160        } 
    6261 
    63         // --- display status 
    64         count = [item numberOfServers]; 
    65  
    66         switch([item type]) { 
     62        count = [tracker numberOfServers]; 
     63 
     64        switch([tracker type]) { 
    6765                case WCTrackerBonjour: 
    6866                        [_statusTextField setStringValue:[NSSWF: 
     
    7876                        [_statusTextField setStringValue:[NSSWF: 
    7977                                @"%@ %C %d %@", 
    80                                 [item name], 
     78                                [tracker name], 
    8179                                0x2014, 
    8280                                count, 
     
    8987                        [_statusTextField setStringValue:[NSSWF: 
    9088                                @"%@ %C %d %@", 
    91                                 [item name], 
     89                                [tracker name], 
    9290                                0x2014, 
    9391                                count, 
     
    10098                        [_statusTextField setStringValue:[NSSWF: 
    10199                                @"%@ %C %@", 
    102                                 [item name], 
     100                                [tracker name], 
    103101                                0x2014, 
    104                                 [item netService] 
     102                                [tracker netService] 
    105103                                        ? NSLS(@"Local server via Bonjour", @"Description of server via Bonjour tracker") 
    106                                         : [[item URL] string]]]; 
     104                                        : [[tracker URL] string]]]; 
    107105                        break; 
    108106        } 
     
    115113        NSDictionary            *bookmark; 
    116114         
    117         // --- reset trackers 
    118115        [_trackers removeAllObjects]; 
    119116        [_trackers addObject:_bonjourTracker]; 
    120117         
    121         // --- then add from bookmarks 
    122118        enumerator = [[WCSettings objectForKey:WCTrackerBookmarks] objectEnumerator]; 
    123119         
     
    125121                [_trackers addObject:[WCTracker trackerWithBookmark:bookmark]]; 
    126122         
    127         // --- reload table 
    128123        [_trackersOutlineView reloadData]; 
    129124} 
     
    131126 
    132127 
    133 - (WCTracker *)trackerAtIndex:(int)index { 
     128- (WCTracker *)_trackerAtIndex:(int)index { 
    134129        return [_trackers objectAtIndex:index]; 
    135130} 
     
    137132 
    138133 
    139 - (WCTracker *)itemAtIndex:(int)index { 
     134- (WCTracker *)_itemAtIndex:(int)index { 
    140135        return [_trackersOutlineView itemAtRow:index]; 
    141136} 
     
    143138 
    144139 
    145 - (WCTracker *)itemAtIndex:(int)index inTracker:(WCTracker *)tracker { 
     140- (WCTracker *)_itemAtIndex:(int)index inTracker:(WCTracker *)tracker { 
    146141        NSArray         *children; 
    147142        int                     i; 
     
    157152 
    158153 
    159 - (WCTracker *)selectedItem
     154- (WCTracker *)_selectedTracker
    160155        int             row; 
    161156         
     
    430425        WCServerConnection      *connection; 
    431426 
    432         tracker = [self selectedItem]; 
     427        tracker = [self _selectedTracker]; 
    433428        url = [tracker URL]; 
    434429 
     
    522517- (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item { 
    523518        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]; 
    527522} 
    528523 
     
    607602        NSPasteboard    *pasteboard; 
    608603        NSString                *string; 
    609         WCTracker               *item
    610  
    611         item = [self selectedItem]; 
    612  
    613         if([item URL]) 
    614                 string = [[item URL] string]; 
     604        WCTracker               *tracker
     605 
     606        tracker = [self _selectedTracker]; 
     607 
     608        if([tracker URL]) 
     609                string = [[tracker URL] string]; 
    615610        else 
    616                 string = [item name]; 
     611                string = [tracker name]; 
    617612 
    618613        pasteboard = [NSPasteboard generalPasteboard]; 
     
    624619 
    625620- (NSString *)tableView:(NSTableView *)tableView stringValueForRow:(int)row { 
    626         return [[self itemAtIndex:row] name]; 
     621        return [[self _itemAtIndex:row] name]; 
    627622} 
    628623 
  • WiredClient/trunk/WCTransfer.h

    r3413 r3546  
    2727 */ 
    2828 
    29 enum WCTransferType { 
    30         WCTransferTypeDownload, 
    31         WCTransferTypeUpload 
     29enum _WCTransferType { 
     30        WCTransferDownload, 
     31        WCTransferUpload 
    3232};&nbs