Changeset 4974

Show
Ignore:
Timestamp:
10/18/07 21:34:14 (1 year ago)
Author:
morris
Message:

Update for WA

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCAccounts.m

    r4799 r4974  
    525525 
    526526        if(tableColumn == _nameTableColumn) { 
    527                 NSImage         *icon = NULL; 
    528  
    529                 switch([account type]) { 
    530                         case WCAccountUser: 
    531                                 icon = _userImage; 
    532                                 break; 
    533  
    534                         case WCAccountGroup: 
    535                                 icon = _groupImage; 
    536                                 break; 
    537                 } 
    538  
    539                 return [NSDictionary dictionaryWithObjectsAndKeys: 
    540                         [account name],         WIIconCellTitleKey, 
    541                         icon,                           WIIconCellIconKey, 
    542                         NULL]; 
     527                return [account name]; 
    543528        } 
    544529        else if(tableColumn == _typeTableColumn) { 
     
    559544 
    560545 
     546- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 
     547        if(tableColumn == _nameTableColumn) { 
     548                if([[self _accountAtIndex:row] type] == WCAccountUser) 
     549                        [cell setImage:_userImage]; 
     550                else 
     551                        [cell setImage:_groupImage]; 
     552        } 
     553} 
     554 
     555 
    561556- (NSString *)tableView:(NSTableView *)tableView stringValueForRow:(NSInteger)row { 
    562557        return [[self _accountAtIndex:row] name]; 
  • WiredClient/trunk/WCDock.m

    r4799 r4974  
    223223         
    224224        iconCell = [[WIIconCell alloc] init]; 
    225       [iconCell setImageWidth:14.0]; 
     225//    [iconCell setImageWidth:14.0]; 
    226226        [_nameTableColumn setDataCell:iconCell]; 
    227227        [iconCell release]; 
     
    602602                        image = [image tintedImageWithColor:[NSColor colorWithDeviceWhite:1.0 alpha:0.5]]; 
    603603                 
    604                 return [NSDictionary dictionaryWithObjectsAndKeys: 
    605                         [connection name],      WIIconCellTitleKey, 
    606                         image,                          WIIconCellIconKey, 
    607                         NULL]; 
     604                return [connection name]; 
    608605        } 
    609606        else if(tableColumn == _usersTableColumn) { 
     
    644641 
    645642- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 
     643        WCServerConnection      *connection; 
     644        NSImage                         *image; 
     645         
     646        connection = [self _connectionAtIndex:row]; 
     647 
     648        if(tableColumn == _nameTableColumn) { 
     649                image = [connection isConnected] ? _connectedImage : _disconnectedImage; 
     650 
     651                if([connection isHidden]) 
     652                        image = [image tintedImageWithColor:[NSColor colorWithDeviceWhite:1.0 alpha:0.5]]; 
     653                 
     654                [cell setImage:image]; 
     655        } 
     656 
    646657        if([cell respondsToSelector:@selector(setTextColor:)]) { 
    647                 [cell setTextColor:[[self _connectionAtIndex:row] isHidden] 
     658                [cell setTextColor:[connection isHidden] 
    648659                        ? [NSColor grayColor] 
    649660                        : [NSColor blackColor]]; 
  • WiredClient/trunk/WCFilesController.m

    r4965 r4974  
    293293        file = [self fileAtIndex:row]; 
    294294 
    295         if(tableColumn == _nameTableColumn) { 
    296                 return [NSDictionary dictionaryWithObjectsAndKeys: 
    297                         [file name],                            WIIconCellTitleKey, 
    298                         [file iconWithWidth:16.0],      WIIconCellIconKey, 
    299                         NULL]; 
    300         } 
     295        if(tableColumn == _nameTableColumn) 
     296                return [file name]; 
    301297        else if(tableColumn == _kindTableColumn) 
    302298                return [file kind]; 
     
    322318 
    323319 
     320- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 
     321        if(tableColumn == _nameTableColumn) 
     322                [cell setImage:[[self fileAtIndex:row] iconWithWidth:16.0]]; 
     323} 
     324 
     325 
    324326- (NSString *)tableView:(NSTableView *)tableView stringValueForRow:(NSInteger)row { 
    325327        return [[self fileAtIndex:row] name]; 
  • WiredClient/trunk/WCMessages.m

    r4965 r4974  
    10161016 
    10171017- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { 
    1018         NSString                        *name = NULL; 
    1019         NSImage                         *image = NULL; 
     1018        NSString                        *name; 
    10201019        WCConversation          *conversation; 
    10211020        NSUInteger                      count = 0; 
     
    10231022        if([item isKindOfClass:[NSString class]]) { 
    10241023                name = item; 
    1025                 image = _conversationIcon; 
    10261024 
    10271025                if([_titles indexOfObject:item] == 0) 
     
    10331031                conversation = item; 
    10341032                name = [conversation userNick]; 
    1035                 image = NULL; 
    10361033                count = [[self _messagesForConversation:conversation unreadOnly:YES] count]; 
    10371034        } 
     
    10401037                name = [name stringByAppendingFormat:@" (%lu)", count]; 
    10411038         
    1042         return [NSDictionary dictionaryWithObjectsAndKeys: 
    1043                 [[NSAttributedString attributedStringWithString:name] attributedStringByApplyingFilter:_userFilter], 
    1044                         WIIconCellAttributedTitleKey, 
    1045                 image, 
    1046                         WIIconCellIconKey, 
    1047                 NULL]; 
     1039        return [[NSAttributedString attributedStringWithString:name] attributedStringByApplyingFilter:_userFilter]; 
    10481040} 
    10491041 
     
    10511043 
    10521044- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { 
     1045        NSImage                 *image; 
    10531046        NSUInteger              count = 0; 
    10541047         
    10551048        if([item isKindOfClass:[NSString class]]) { 
     1049                image = _conversationIcon; 
     1050 
    10561051                if([_titles indexOfObject:item] == 0) 
    10571052                        count = [[self _unreadMessagesForType:WCMessagePrivateMessage] count]; 
     
    10611056        else if([item isKindOfClass:[WCConversation class]]) { 
    10621057                count = [[self _messagesForConversation:item unreadOnly:YES] count]; 
     1058                image = NULL; 
    10631059        }        
    10641060 
     
    10671063        else 
    10681064                [cell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; 
     1065         
     1066        [cell setImage:image]; 
    10691067} 
    10701068 
  • WiredClient/trunk/WCTrackers.m

    r4963 r4974  
    558558        tracker = item; 
    559559         
    560         if(tableColumn == _nameTableColumn) { 
    561                 return [NSDictionary dictionaryWithObjectsAndKeys: 
    562                         [tracker nameWithNumberOfServersMatchingFilter:_filter], 
    563                                 WIIconCellTitleKey, 
    564                         [tracker icon], 
    565                                 WIIconCellIconKey, 
    566                         NULL]; 
    567         } 
     560        if(tableColumn == _nameTableColumn) 
     561                return [tracker nameWithNumberOfServersMatchingFilter:_filter]; 
    568562         
    569563        if([tracker type] == WCTrackerServer && ![tracker netService]) { 
     
    589583 
    590584 
     585- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { 
     586        WCTracker       *tracker; 
     587         
     588        tracker = item; 
     589         
     590        if(tableColumn == _nameTableColumn) 
     591                [cell setImage:[tracker icon]]; 
     592} 
     593 
     594 
     595 
    591596- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item { 
    592597        if([(WCTracker *) item type] != WCTrackerServer)