Changeset 9487


Ignore:
Timestamp:
Nov 7, 2009, 2:22:57 AM (12 years ago)
Author:
livings124
Message:

the new way of determining the unwanted width of the progress bar wasn't cutting it, so use the old way

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.h

    r9461 r9487  
    145145- (CGFloat) progress;
    146146- (CGFloat) progressDone;
     147- (CGFloat) progressLeft;
    147148- (CGFloat) checkingProgress;
    148149
  • trunk/macosx/Torrent.m

    r9473 r9487  
    617617   
    618618    NSInteger newCount = 0;
    619     for (NSInteger oldIndex = 0; oldIndex < oldTrackerCount; ++newCount, ++oldIndex)
     619    for (NSInteger oldIndex = 0; oldIndex < oldTrackerCount; ++oldIndex)
    620620    {
    621621        if (![trackers member: [NSString stringWithUTF8String: fInfo->trackers[oldIndex].announce]])
    622             trackerStructs[newCount] = fInfo->trackers[oldIndex];
    623         else
    624             --newCount;
     622            trackerStructs[newCount++] = fInfo->trackers[oldIndex];
    625623    }
    626624   
     
    729727{
    730728    return fStat->percentDone;
     729}
     730
     731- (CGFloat) progressLeft
     732{
     733    return (CGFloat)[self sizeLeft] / [self size];
    731734}
    732735
     
    10391042
    10401043        case TR_STATUS_CHECK:
    1041             string = [NSString localizedStringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)",
    1042                                     "Torrent -> status string"), 100.0 * [self checkingProgress]];
     1044            string = [NSString localizedStringWithFormat: @"%@ (%.2f%%)",
     1045                        NSLocalizedString(@"Checking existing data", "Torrent -> status string"), 100.0 * [self checkingProgress]];
    10431046            break;
    10441047       
     
    10741077
    10751078        case TR_STATUS_CHECK:
    1076             return [NSString localizedStringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)",
    1077                                     "Torrent -> status string"), 100.0 * [self checkingProgress]];
     1079            return [NSString localizedStringWithFormat: @"%@ (%.2f%%)",
     1080                    NSLocalizedString(@"Checking existing data", "Torrent -> status string"), 100.0 * [self checkingProgress]];
    10781081       
    10791082        case TR_STATUS_CHECK_WAIT:
  • trunk/macosx/TorrentCell.m

    r9475 r9487  
    634634        if (![torrent allDownloaded])
    635635        {
    636             //the ratio of total progress to total width equals ratio of progress of amount wanted to wanted width
    637             const CGFloat widthRemaining = floorf(NSWidth(barRect) * (1.0 - [torrent progressDone]) / [torrent progress]);
     636            const CGFloat widthRemaining = floorf(NSWidth(barRect) * [torrent progressLeft]);
    638637           
    639638            NSRect wantedRect;
  • trunk/macosx/TorrentTableView.m

    r9478 r9487  
    568568    NSRect rect = [fTorrentCell iconRectForBounds: [self rectOfRow: row]];
    569569    NSPoint location = rect.origin;
    570     location.y += rect.size.height + 5.0f;
     570    location.y += rect.size.height + 5.0;
    571571   
    572572    if ([NSApp isOnSnowLeopardOrBetter])
Note: See TracChangeset for help on using the changeset viewer.