Changeset 8753


Ignore:
Timestamp:
Jun 28, 2009, 4:21:47 PM (13 years ago)
Author:
charles
Message:

(trunk gtk,qt) add a little symmetry to the info tab's fields

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r8736 r8753  
    791791            str = none;
    792792        else {
    793             char pct[16], ver[64];
    794             double n = 100.0 * ( sizeWhenDone - leftUntilDone );
    795             g_snprintf( pct, sizeof( pct ), _( "%.1f%%" ), n/sizeWhenDone );
    796             tr_strlsize( ver, haveValid, sizeof( ver ) );
    797             if( !haveUnchecked )
    798                 g_snprintf( buf, sizeof(buf), _( "%1$s (%2$s verified)" ), pct, ver );
    799             else {
    800                 char u[64];
    801                 tr_strlsize( u, haveUnchecked, sizeof( u ) );
    802                 g_snprintf( buf, sizeof(buf), _( "%1$s (%2$s verified, %3$s unverified)" ), pct, ver, u );
    803             }
     793            char unver[64], total[64];
     794            const double ratio = ( 100.0 * ( haveValid + haveUnchecked ) )  / leftUntilDone;
     795            tr_strlsize( total, haveUnchecked + haveValid, sizeof( total ) );
     796            tr_strlsize( unver, haveUnchecked,             sizeof( unver ) );
     797            if( haveUnchecked )
     798                g_snprintf( buf, sizeof( buf ), _( "%1$s (%2$.1f%%); %3$s Unverified" ), total, ratio, unver );
     799            else
     800                g_snprintf( buf, sizeof( buf ), _( "%1$s (%2$.1f%%)" ), total, ratio );
    804801            str = buf;
    805802        }
  • trunk/qt/details.cc

    r8734 r8753  
    270270        QString pct = locale.toString( 100.0*((sizeWhenDone-leftUntilDone)/sizeWhenDone), 'f', 2 );
    271271        if( !haveUnverified )
    272             string = tr( "%1 (%2 verified)" )
    273                      .arg( pct )
    274                      .arg( Utils :: sizeToString( haveVerified ) );
     272            string = tr( "%1 (%2%)" )
     273                         .arg( Utils :: sizeToString( haveVerified + haveUnverified ) )
     274                         .arg( pct );
    275275        else
    276             string = tr( "%1 (%2 verified, %3 unverified)" )
    277                      .arg( pct )
    278                      .arg( Utils :: sizeToString( haveVerified ) )
    279                      .arg( Utils :: sizeToString( haveUnverified ) );
     276            string = tr( "%1 (%2%); %3 Unverified" )
     277                         .arg( Utils :: sizeToString( haveVerified + haveUnverified ) )
     278                         .arg( pct )
     279                         .arg( Utils :: sizeToString( haveUnverified ) );
    280280    }
    281281    myHaveLabel->setText( string );
Note: See TracChangeset for help on using the changeset viewer.