Changeset 4071


Ignore:
Timestamp:
Dec 5, 2007, 5:32:39 PM (14 years ago)
Author:
livings124
Message:

clean peer status tooltip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r4005 r4071  
    868868        else
    869869        {
    870             NSString * firstString;
     870            NSMutableArray * peerStatusArray = [NSMutableArray arrayWithCapacity: 2];
     871           
    871872            if (status & TR_PEER_STATUS_CLIENT_IS_SENDING)
    872                 firstString = NSLocalizedString(@"Uploading to peer", "Inspector -> peer -> status");
     873                [peerStatusArray addObject: NSLocalizedString(@"Uploading to peer", "Inspector -> peer -> status")];
    873874            else if (status & TR_PEER_STATUS_PEER_IS_INTERESTED)
    874                 firstString = NSLocalizedString(@"Peer wants our data", "Inspector -> peer -> status");
     875                [peerStatusArray addObject: NSLocalizedString(@"Peer wants our data", "Inspector -> peer -> status")];
    875876            else if (status & TR_PEER_STATUS_PEER_IS_CHOKED)
    876                 firstString = NSLocalizedString(@"Refusing to send data to peer", "Inspector -> peer -> status");
    877             else
    878                 firstString = @"";
     877                [peerStatusArray addObject: NSLocalizedString(@"Refusing to send data to peer", "Inspector -> peer -> status")];
     878            else;
    879879           
    880             NSString * secondString;
    881880            if (status & TR_PEER_STATUS_PEER_IS_SENDING)
    882                 secondString = NSLocalizedString(@"Downloading from peer", "Inspector -> peer -> status");
     881                [peerStatusArray addObject: NSLocalizedString(@"Downloading from peer", "Inspector -> peer -> status")];
    883882            else if (status & TR_PEER_STATUS_CLIENT_SENT_REQUEST)
    884                 secondString = NSLocalizedString(@"Requesting data from peer", "Inspector -> peer -> status");
     883                [peerStatusArray addObject: NSLocalizedString(@"Requesting data from peer", "Inspector -> peer -> status")];
    885884            else if (status & TR_PEER_STATUS_CLIENT_IS_INTERESTED)
    886                 secondString = NSLocalizedString(@"Waiting to request data from peer", "Inspector -> peer -> status");
     885                [peerStatusArray addObject: NSLocalizedString(@"Waiting to request data from peer", "Inspector -> peer -> status")];
    887886            else if (status & TR_PEER_STATUS_CLIENT_IS_CHOKED)
    888                 secondString = NSLocalizedString(@"Peer will not send us data", "Inspector -> peer -> status");
    889             else
    890                 secondString = @"";
     887                [peerStatusArray addObject: NSLocalizedString(@"Peer will not send us data", "Inspector -> peer -> status")];
     888            else;
    891889           
    892             [components addObject: [NSString stringWithFormat: @"%@ - %@", firstString, secondString]];
     890            if ([peerStatusArray count] > 0)
     891                [components addObject: [peerStatusArray componentsJoinedByString: @" - "]];
    893892        }
    894893               
Note: See TracChangeset for help on using the changeset viewer.