1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

(trunk qt) #3706 "improve torrent details" -- committed patch from Longinus00

This commit is contained in:
Charles Kerr 2010-11-27 22:42:47 +00:00
parent 0a64fd4b40
commit 2087241a62

View file

@ -373,32 +373,25 @@ Details :: refresh( )
{ {
const double d = 100.0 * ( sizeWhenDone ? ( sizeWhenDone - leftUntilDone ) / sizeWhenDone : 1 ); const double d = 100.0 * ( sizeWhenDone ? ( sizeWhenDone - leftUntilDone ) / sizeWhenDone : 1 );
QString pct = Formatter::percentToString( d ); QString pct = Formatter::percentToString( d );
QString astr;
if( sizeWhenDone )
astr = Formatter::percentToString( ( 100.0 * available ) / sizeWhenDone );
else
astr = "100";
if( !haveUnverified && !leftUntilDone ) if( !haveUnverified && !leftUntilDone )
{ {
string = tr( "%1 (%2%)" ) string = tr( "%1 (100%)" )
.arg( Formatter::sizeToString( haveVerified + haveUnverified ) ) .arg( Formatter::sizeToString( haveVerified ) );
.arg( pct );
} }
else if( !haveUnverified ) else if( !haveUnverified )
{ {
string = tr( "%1 (%2% of %3% Available)" ) string = tr( "%1 of %2 (%3%)" )
.arg( Formatter::sizeToString( haveVerified + haveUnverified ) ) .arg( Formatter::sizeToString( haveVerified ) )
.arg( pct ) .arg( Formatter::sizeToString( sizeWhenDone ) )
.arg( astr ); .arg( pct );
} }
else else
{ {
string = tr( "%1 (%2% of %3% Available) + %4 Unverified" ) string = tr( "%1 of %2% (%3%), %4 Unverified" )
.arg( Formatter::sizeToString( haveVerified + haveUnverified ) ) .arg( Formatter::sizeToString( haveVerified + haveUnverified ) )
.arg( Formatter::sizeToString( sizeWhenDone ) )
.arg( pct ) .arg( pct )
.arg( astr )
.arg( Formatter::sizeToString( haveUnverified ) ); .arg( Formatter::sizeToString( haveUnverified ) );
} }
} }
@ -428,7 +421,7 @@ Details :: refresh( )
const QString dstr = Formatter::sizeToString( d ); const QString dstr = Formatter::sizeToString( d );
const QString fstr = Formatter::sizeToString( f ); const QString fstr = Formatter::sizeToString( f );
if( f ) if( f )
string = tr( "%1 (+%2 corrupt)" ).arg( dstr ).arg( fstr ); string = tr( "%1 (%2 corrupt)" ).arg( dstr ).arg( fstr );
else else
string = dstr; string = dstr;
} }
@ -846,7 +839,6 @@ Details :: createInfoTab( )
HIG * hig = new HIG( this ); HIG * hig = new HIG( this );
hig->addSectionTitle( tr( "Activity" ) ); hig->addSectionTitle( tr( "Activity" ) );
hig->addRow( tr( "Torrent size:" ), mySizeLabel = new SqueezeLabel );
hig->addRow( tr( "Have:" ), myHaveLabel = new SqueezeLabel ); hig->addRow( tr( "Have:" ), myHaveLabel = new SqueezeLabel );
hig->addRow( tr( "Availability:" ), myAvailabilityLabel = new SqueezeLabel ); hig->addRow( tr( "Availability:" ), myAvailabilityLabel = new SqueezeLabel );
hig->addRow( tr( "Downloaded:" ), myDownloadedLabel = new SqueezeLabel ); hig->addRow( tr( "Downloaded:" ), myDownloadedLabel = new SqueezeLabel );
@ -860,6 +852,7 @@ Details :: createInfoTab( )
hig->addSectionDivider( ); hig->addSectionDivider( );
hig->addSectionTitle( tr( "Details" ) ); hig->addSectionTitle( tr( "Details" ) );
hig->addRow( tr( "Size:" ), mySizeLabel = new SqueezeLabel );
hig->addRow( tr( "Location:" ), myLocationLabel = new SqueezeLabel ); hig->addRow( tr( "Location:" ), myLocationLabel = new SqueezeLabel );
hig->addRow( tr( "Hash:" ), myHashLabel = new SqueezeLabel ); hig->addRow( tr( "Hash:" ), myHashLabel = new SqueezeLabel );
hig->addRow( tr( "Privacy:" ), myPrivacyLabel = new SqueezeLabel ); hig->addRow( tr( "Privacy:" ), myPrivacyLabel = new SqueezeLabel );