Changeset 1786


Ignore:
Timestamp:
Apr 23, 2007, 8:14:07 PM (15 years ago)
Author:
titer
Message:

Backport [1757], [1759] and [1764] to [1777]

Location:
branches/0.7x
Files:
14 edited
23 copied

Legend:

Unmodified
Added
Removed
  • branches/0.7x/NEWS

    r1744 r1786  
    11NEWS file for Transmission <http://transmission.m0k.org/>
    22
    3 Note: From 0.7 on, Transmission for Mac OS X requires 10.4 Tiger or newer.
     30.71 ()
     4 - Send port info when sending requests
     5 - Calculate ratio differently when seeding without ever downloading
     6 - Add additional error messages and debug info
     7 - OS X:
     8   + Fix error when using default incomplete folder
     9   + Disable the stop ratio once it is reached (while seeding)
     10   + Small interface adjustments
    411
    5 0.7 (2007/04/18)
     120.70 (2007/04/18)
    613 - New icon
    714 - Automatic port mapping (NAT-PMP and UPnP IGD)
     
    1421 - Many miscellaneous bugfixes and small improvements
    1522 - OS X:
     23   + Requires 10.4 Tiger or newer
    1624   + Download and seeding queues that can be user-ordered
    1725   + Speed Limit: Second set of bandwidth limits that can be toggled or
  • branches/0.7x/cli/transmissioncli.c

    r1576 r1786  
    7171    if( ratio == TR_RATIO_NA )
    7272        return "n/a";
    73     if( ratio == TR_RATIO_INF )
    74         return "inf";
    7573    snprintf( string, sizeof string, "%.3f", ratio );
    7674    return string;
  • branches/0.7x/libtransmission/clients.c

    r1675 r1786  
    7474        else if( !memcmp( &id[1], "BOW", 3 ) )
    7575        {
    76             asprintf( &ret, "Bits on Wheels (%c%c%c)",
    77                       id[4], id[5], id[6] );
     76            if( !memcmp( &id[4], "A0C", 3 ) )
     77            {
     78                asprintf( &ret, "Bits on Wheels 1.0.6" );
     79            }
     80            else if( !memcmp( &id[4], "A0B", 3 ) )
     81            {
     82                asprintf( &ret, "Bits on Wheels 1.0.5" );
     83            }
     84            else
     85            {
     86                asprintf( &ret, "Bits on Wheels (%c%c%c)",
     87                        id[4], id[5], id[6] );
     88            }
    7889        }
    7990        else if( !memcmp( &id[1], "BR", 2 ) )
  • branches/0.7x/libtransmission/http.c

    r1678 r1786  
    449449
    450450    if( tr_sprintf( EXPANDBUF( http->header ), " HTTP/1.1" CR LF
    451                     "Host: %s" CR LF
     451                    "Host: %s:%d" CR LF
    452452                    "User-Agent: %s/%d.%d%d" CR LF
    453453                    "Connection: close" CR LF,
    454                     http->host, TR_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_MAINTENANCE ) )
     454                    http->host, http->port, TR_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_MAINTENANCE ) )
    455455    {
    456456        goto err;
  • branches/0.7x/libtransmission/torrent.c

    r1655 r1786  
    453453    else
    454454    {
    455         s->eta = ( 1.0 - s->progress ) *
    456             (float) inf->totalSize / s->rateDownload / 1024.0;
     455        s->eta = (float) s->left / s->rateDownload / 1024.0;
    457456    }
    458457
     
    460459    s->uploaded   = tor->uploadedCur   + tor->uploadedPrev;
    461460   
    462     if( s->downloaded == 0 )
    463     {
    464         s->ratio = s->uploaded == 0 ? TR_RATIO_NA : TR_RATIO_INF;
     461    if( s->downloaded == 0 && s->progress == 0.0 )
     462    {
     463        s->ratio = TR_RATIO_NA;
    465464    }
    466465    else
    467466    {
    468         s->ratio = (float)s->uploaded / (float)s->downloaded;
     467        s->ratio = (float)s->uploaded / (float)MAX(s->downloaded, inf->totalSize - s->left);
    469468    }
    470469   
  • branches/0.7x/libtransmission/transmission.h

    r1655 r1786  
    447447
    448448#define TR_RATIO_NA  -1
    449 #define TR_RATIO_INF -2
    450449    float               ratio;
    451450};
  • branches/0.7x/macosx/Controller.m

    r1714 r1786  
    17771777    [self updateTorrentsInQueue];
    17781778    [fInfoController updateInfoStats];
     1779    [fInfoController updateRatioForTorrent: torrent];
    17791780   
    17801781    if ([fDefaults boolForKey: @"PlaySeedingSound"])
     
    26292630            //resume sleeping transfers after we wake up
    26302631            [fTorrents makeObjectsPerformSelector: @selector(wakeUp)];
     2632            [self autoSpeedLimitChange: nil];
    26312633            break;
    26322634    }
  • branches/0.7x/macosx/English.lproj/PrefsWindow.nib/info.nib

    r1588 r1786  
    1010                <string>294 445 563 268 0 0 1152 842 </string>
    1111                <key>28</key>
    12                 <string>92 421 563 320 0 0 1152 842 </string>
     12                <string>294 425 563 306 0 0 1152 842 </string>
    1313                <key>41</key>
    1414                <string>189 445 563 305 0 0 1152 842 </string>
    1515                <key>66</key>
    16                 <string>294 507 563 144 0 0 1152 842 </string>
     16                <string>294 506 563 144 0 0 1152 842 </string>
    1717        </dict>
    1818        <key>IBFramework Version</key>
     
    2424        <key>IBOpenObjects</key>
    2525        <array>
    26                 <integer>28</integer>
     26                <integer>66</integer>
    2727        </array>
    2828        <key>IBSystem Version</key>
  • branches/0.7x/macosx/InfoWindowController.h

    r1645 r1786  
    6565- (void) updateInfoStats;
    6666
     67- (void) updateRatioForTorrent: (Torrent *) torrent;
     68
    6769- (void) setNextTab;
    6870- (void) setPreviousTab;
  • branches/0.7x/macosx/InfoWindowController.m

    r1785 r1786  
    434434- (void) updateInfoSettings
    435435{
    436     int numberSelected = [fTorrents count];
    437 
    438     if (numberSelected > 0)
     436    if ([fTorrents count] > 0)
    439437    {
    440438        Torrent * torrent;
     
    555553}
    556554
     555- (void) updateRatioForTorrent: (Torrent *) torrent
     556{
     557    if ([fTorrents containsObject: torrent])
     558        [self updateInfoSettings];
     559}
     560
    557561- (int) stateSettingToPopUpIndex: (int) index
    558562{
  • branches/0.7x/macosx/PrefsController.m

    r1724 r1786  
    590590   
    591591    NSRect windowRect = [window frame];
    592     int difference = [view frame].size.height - [[window contentView] frame].size.height;
     592    float difference = [view frame].size.height - [[window contentView] frame].size.height;
    593593    windowRect.origin.y -= difference;
    594594    windowRect.size.height += difference;
  • branches/0.7x/macosx/StringAdditions.m

    r1645 r1786  
    106106    if (ratio == TR_RATIO_NA)
    107107        return NSLocalizedString(@"N/A", "No Ratio");
    108     else if (ratio == TR_RATIO_INF)
    109         return [NSString stringWithUTF8String: "\xE2\x88\x9E"];
    110108    else if (ratio < 0)
    111109        return NSLocalizedString(@"error", "Ratio invalid");
     110    else;
    112111   
    113112    if (ratio < 10.0)
  • branches/0.7x/macosx/Torrent.m

    r1785 r1786  
    290290   
    291291    //check to stop for ratio
    292     float stopRatio, ratio;
     292    float stopRatio;
    293293    if ([self isSeeding] && (stopRatio = [self actualStopRatio]) != INVALID
    294                         && ((ratio = [self ratio]) >= stopRatio || ratio == TR_RATIO_INF))
     294                        && [self ratio] >= stopRatio)
    295295    {
    296296        [self stopTransfer];
     
    299299        fFinishedSeeding = YES;
    300300       
     301        [self setRatioSetting: NSOffState];
    301302        [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentStoppedForRatio" object: self];
    302303    }
     
    415416        [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self];
    416417   
    417     if (fStat->error)
     418    if ([self isError])
    418419    {
    419420        [statusString setString: [NSLocalizedString(@"Error: ", "Torrent -> status string") stringByAppendingString:
     
    951952- (BOOL) isError
    952953{
    953     return fStat->error;
     954    return fStat->error != 0;
    954955}
    955956
     
    12561257- (NSNumber *) ratioSortKey
    12571258{
    1258     float ratio = [self ratio];
    1259     if (ratio == TR_RATIO_INF)
    1260         return [NSNumber numberWithInt: 999999999]; //this should hopefully be big enough
    1261     else
    1262         return [NSNumber numberWithFloat: [self ratio]];
     1259    return [NSNumber numberWithFloat: [self ratio]];
    12631260}
    12641261
Note: See TracChangeset for help on using the changeset viewer.