(gtk) #1289: duplicate of progress info in torrent activity tab

This commit is contained in:
Charles Kerr 2008-09-23 20:06:26 +00:00
parent cc89872dd4
commit 15ae0d49ad
1 changed files with 7 additions and 15 deletions

View File

@ -249,41 +249,33 @@ tr_torrent_status_str( TrTorrent * gtor )
const int tpeers = MAX ( st->peersConnected, 0 ); const int tpeers = MAX ( st->peersConnected, 0 );
const int upeers = MAX ( st->peersGettingFromUs, 0 ); const int upeers = MAX ( st->peersGettingFromUs, 0 );
const int eta = st->eta; const int eta = st->eta;
double prog = st->percentDone * 100.0; /* [0...100] */
switch( st->status ) switch( st->status )
{ {
case TR_STATUS_CHECK_WAIT: case TR_STATUS_CHECK_WAIT:
prog = st->recheckProgress * 100.0; /* [0...100] */
top = top =
g_strdup_printf( _( g_strdup_printf( _(
"Waiting to verify local data (%.1f%% tested)" ), "Waiting to verify local data (%.1f%% tested)" ),
prog ); st->recheckProgress * 100.0 );
break; break;
case TR_STATUS_CHECK: case TR_STATUS_CHECK:
prog = st->recheckProgress * 100.0; /* [0...100] */
top = top =
g_strdup_printf( _( g_strdup_printf( _(
"Verifying local data (%.1f%% tested)" ), "Verifying local data (%.1f%% tested)" ),
prog ); st->recheckProgress * 100.0 );
break; break;
case TR_STATUS_DOWNLOAD: case TR_STATUS_DOWNLOAD:
if( eta < 0 ) if( eta < 0 )
top = g_strdup_printf( _( top = g_strdup_printf( _( "Remaining time unknown" ) );
"Remaining time unknown (%.1f%%)" ),
prog );
else else
{ {
char timestr[128]; char timestr[128];
tr_strltime( timestr, eta, sizeof( timestr ) ); tr_strltime( timestr, eta, sizeof( timestr ) );
/* %1$s is # of minutes /* %s is # of minutes */
%2$.1f is a percentage of how much of the torrent is done */ top = g_strdup_printf( _( "%1$s remaining" ), timestr );
top = g_strdup_printf( _(
"%1$s remaining (%2$.1f%%)" ),
timestr, prog );
} }
break; break;
@ -296,11 +288,11 @@ tr_torrent_status_str( TrTorrent * gtor )
break; break;
case TR_STATUS_STOPPED: case TR_STATUS_STOPPED:
top = g_strdup_printf( _( "Stopped (%.1f%%)" ), prog ); top = g_strdup( _( "Stopped" ) );
break; break;
default: default:
top = g_strdup_printf( "???" ); top = g_strdup( "???" );
break; break;
} }