Changeset 10404


Ignore:
Timestamp:
Mar 20, 2010, 2:53:08 PM (12 years ago)
Author:
charles
Message:

(trunk gtk) tinker with compact mode a little bit

Location:
trunk/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/torrent-cell-renderer.c

    r10383 r10404  
    148148
    149149    if( haveDown && haveUp )
    150         /* Translators: "speed|" is here for disambiguation.
    151          * Please remove it from your translation.
    152          * %1$s is the download speed
    153            %2$s is the upload speed */
    154         g_snprintf( buf, buflen, Q_( "speed|Down: %1$s, Up: %2$s" ), downStr, upStr );
     150        /* 1==down speed, 2==down arrow, 3==up speed, 4==down arrow */
     151        g_snprintf( buf, buflen, _( "%1$s %2$s, %3$s %4$s" ),
     152                    gtr_get_unicode_string( GTR_UNICODE_DOWN ), downStr,
     153                    gtr_get_unicode_string( GTR_UNICODE_UP ), upStr );
    155154    else if( haveDown )
    156         /* download speed */
    157         g_snprintf( buf, buflen, _( "Down: %s" ), downStr );
     155        /* bandwidth speed + unicode arrow */
     156        g_snprintf( buf, buflen, _( "%1$s %2$s" ),
     157                    gtr_get_unicode_string( GTR_UNICODE_DOWN ), downStr );
    158158    else if( haveUp )
    159         /* upload speed */
    160         g_snprintf( buf, buflen, _( "Up: %s" ), upStr );
     159        /* bandwidth speed + unicode arrow */
     160        g_snprintf( buf, buflen, _( "%1$s %2$s" ),
     161                    gtr_get_unicode_string( GTR_UNICODE_UP ), upStr );
    161162    else if( tr_torrentHasMetadata( tor ) )
    162163        /* the torrent isn't uploading or downloading */
     
    199200            {
    200201                tr_strlratio( buf, torStat->ratio, sizeof( buf ) );
    201                 g_string_append_printf( gstr, _( "Ratio: %s" ), buf );
     202                g_string_append_printf( gstr, _( "Ratio %s" ), buf );
    202203                g_string_append( gstr, ", " );
    203204            }
  • trunk/gtk/util.c

    r10390 r10404  
    8989***/
    9090
     91const char*
     92gtr_get_unicode_string( int i )
     93{
     94    switch( i ) {
     95        case GTR_UNICODE_UP:   return "\xE2\x86\x91";
     96        case GTR_UNICODE_DOWN: return "\xE2\x86\x93";
     97        case GTR_UNICODE_INF:  return "\xE2\x88\x9E";
     98        default:               return "err";
     99    }
     100}
    91101
    92102char*
    93103tr_strlratio( char * buf, double ratio, size_t buflen )
    94104{
    95     return tr_strratio( buf, buflen, ratio, "\xE2\x88\x9E" );
     105    return tr_strratio( buf, buflen, ratio, gtr_get_unicode_string( GTR_UNICODE_INF ) );
    96106}
    97107
  • trunk/gtk/util.h

    r10101 r10404  
    2121 #define UNUSED G_GNUC_UNUSED
    2222#endif
     23
     24enum
     25{
     26    GTR_UNICODE_UP,
     27    GTR_UNICODE_DOWN,
     28    GTR_UNICODE_INF
     29};
     30const char * gtr_get_unicode_string( int );
     31
    2332
    2433/* return a human-readable string for the size given in bytes. */
Note: See TracChangeset for help on using the changeset viewer.