Changeset 9253 for trunk/gtk/details.c


Ignore:
Timestamp:
Oct 9, 2009, 9:30:34 PM (13 years ago)
Author:
charles
Message:

(trunk) #2463: 'Mac Client shows huge "next announce in" timer'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r9242 r9253  
    16361636    }
    16371637
    1638     if( st->isActive && ( st->isAnnouncing || st->willAnnounce ) ) {
    1639         g_string_append_c( gstr, '\n' );
    1640         if( !st->isAnnouncing ) {
     1638    if( st->isActive ) switch( st->announceState ) {
     1639        case TR_TRACKER_INACTIVE:
     1640            if( !st->hasAnnounced ) {
     1641                g_string_append_c( gstr, '\n' );
     1642                g_string_append( gstr, _( "No updates scheduled" ) );
     1643            }
     1644            break;
     1645        case TR_TRACKER_WAITING:
    16411646            tr_strltime_rounded( timebuf, st->nextAnnounceTime - now, sizeof( timebuf ) );
     1647            g_string_append_c( gstr, '\n' );
    16421648            g_string_append_printf( gstr, _( "Asking for more peers in %s" ), timebuf );
    1643         } else {
     1649            break;
     1650        case TR_TRACKER_QUEUED:
     1651            g_string_append_c( gstr, '\n' );
     1652            g_string_append( gstr, _( "Queued to ask for more peers" ) );
     1653            break;
     1654        case TR_TRACKER_ACTIVE:
    16441655            tr_strltime_rounded( timebuf, now - st->lastAnnounceStartTime, sizeof( timebuf ) );
    16451656            g_string_append_printf( gstr, _( "Asking for more peers now... <small>%s</small>" ), timebuf );
    1646         }
    1647     }
    1648 
    1649     if( !st->hasAnnounced && !st->isAnnouncing && !st->willAnnounce ) {
    1650         g_string_append_c( gstr, '\n' );
    1651         g_string_append( gstr, _( "No updates scheduled" ) );
     1657            break;
    16521658    }
    16531659
     
    16651671        }
    16661672
    1667         if( st->isScraping || st->willScrape ) {
    1668             g_string_append_c( gstr, '\n' );
    1669             if( !st->isScraping ) {
     1673        switch( st->scrapeState )
     1674        {
     1675            case TR_TRACKER_INACTIVE:
     1676                break;
     1677            case TR_TRACKER_WAITING:
     1678                g_string_append_c( gstr, '\n' );
     1679                tr_strltime_rounded( timebuf, now - st->lastScrapeStartTime, sizeof( timebuf ) );
     1680                g_string_append_printf( gstr, _( "Asking for peer counts now... <small>%s</small>" ), timebuf );
     1681                break;
     1682            case TR_TRACKER_QUEUED:
     1683                g_string_append_c( gstr, '\n' );
     1684                g_string_append( gstr, _( "Queued to ask for peer counts" ) );
     1685                break;
     1686            case TR_TRACKER_ACTIVE:
     1687                g_string_append_c( gstr, '\n' );
    16701688                tr_strltime_rounded( timebuf, st->nextScrapeTime - now, sizeof( timebuf ) );
    16711689                g_string_append_printf( gstr, _( "Asking for peer counts in %s" ), timebuf );
    1672             } else {
    1673                 tr_strltime_rounded( timebuf, now - st->lastScrapeStartTime, sizeof( timebuf ) );
    1674                 g_string_append_printf( gstr, _( "Asking for peer counts now... <small>%s</small>" ), timebuf );
    1675             }
    1676         }
    1677     }
    1678      
     1690                break;
     1691        }
     1692    }
     1693
    16791694    return g_string_free( gstr, FALSE );
    16801695}
Note: See TracChangeset for help on using the changeset viewer.