Changeset 4143


Ignore:
Timestamp:
Dec 13, 2007, 4:31:38 AM (14 years ago)
Author:
livings124
Message:

display the infinity symbol in stats for ratio when there is upload but no download

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r4124 r4143  
    1212   + Pieces Bar (return of Advanced Bar)
    1313   + Availability Bar (overlay on regular bar)
    14    + Leopard: Time Machine will ignore incomplete downloads
    1514   + Display remaining time for seeding transfers
    1615   + Sort by total activity
     16   + Leopard: Time Machine will ignore incomplete downloads
    1717   + Leopard: Fix bug where text fields would reject localized decimal values
    1818- GTK+:
  • trunk/libtransmission/stats.c

    r3990 r4143  
    139139    const struct tr_stats_handle * stats = handle->sessionStats;
    140140    *setme = stats->single;
    141     setme->ratio = setme->downloadedBytes ? (double)setme->uploadedBytes / (double)setme->downloadedBytes : TR_RATIO_NA;
     141   
     142    setme->ratio = setme->downloadedBytes ? (double)setme->uploadedBytes / (double)setme->downloadedBytes
     143                                            : ( setme->uploadedBytes ? TR_RATIO_INF : TR_RATIO_NA );
     144   
    142145    setme->secondsActive += ( time(NULL) - stats->startTime );
    143146}
  • trunk/libtransmission/transmission.h

    r4092 r4143  
    700700
    701701#define TR_RATIO_NA  -1
     702#define TR_RATIO_INF -2
    702703    float               ratio;
    703704   
  • trunk/macosx/NSStringAdditions.m

    r3977 r4143  
    9898    if (ratio == TR_RATIO_NA)
    9999        return NSLocalizedString(@"N/A", "No Ratio");
     100    else if (ratio == TR_RATIO_INF)
     101        return [NSString stringWithUTF8String: "\xE2\x88\x9E"];
    100102    else if (ratio < 0)
    101103        return NSLocalizedString(@"error", "Ratio invalid");
  • trunk/macosx/StatusBarView.m

    r4135 r4143  
    5050- (void) setShowOnTiger: (BOOL) show
    5151{
    52     fShow = [NSApp isOnLeopardOrBetter] || show;
     52    fShow = show || [NSApp isOnLeopardOrBetter];
    5353}
    5454
Note: See TracChangeset for help on using the changeset viewer.