Changeset 10955
- Timestamp:
- Jul 6, 2010, 8:25:54 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/cli.c
r10937 r10955 41 41 42 42 #define MEM_K 1024 43 #define MEM_B_STR "B"44 43 #define MEM_K_STR "KiB" 45 44 #define MEM_M_STR "MiB" 46 45 #define MEM_G_STR "GiB" 46 #define MEM_T_STR "TiB" 47 47 48 48 #define DISK_K 1000 … … 51 51 #define DISK_M_STR "MB" 52 52 #define DISK_G_STR "GB" 53 #define DISK_T_STR "TB" 53 54 54 55 #define SPEED_K 1000 … … 57 58 #define SPEED_M_STR "MB/s" 58 59 #define SPEED_G_STR "GB/s" 60 #define SPEED_T_STR "TB/s" 59 61 60 62 /*** … … 222 224 size_t fileLength; 223 225 224 tr_formatter_mem_init( MEM_K, MEM_ B_STR, MEM_K_STR, MEM_M_STR, MEM_G_STR );225 tr_formatter_size_init( DISK_K,DISK_ B_STR, DISK_K_STR, DISK_M_STR, DISK_G_STR );226 tr_formatter_speed_init( SPEED_K, SPEED_ B_STR, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR );226 tr_formatter_mem_init( MEM_K, MEM_K_STR, MEM_M_STR, MEM_G_STR, MEM_T_STR ); 227 tr_formatter_size_init( DISK_K,DISK_K_STR, DISK_M_STR, DISK_G_STR, DISK_T_STR ); 228 tr_formatter_speed_init( SPEED_K, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR, SPEED_T_STR ); 227 229 228 230 printf( "Transmission %s - http://www.transmissionbt.com/\n", -
trunk/daemon/daemon.c
r10947 r10955 42 42 43 43 #define MEM_K 1024 44 #define MEM_B_STR "B"45 44 #define MEM_K_STR "KiB" 46 45 #define MEM_M_STR "MiB" 47 46 #define MEM_G_STR "GiB" 47 #define MEM_T_STR "TiB" 48 48 49 49 #define DISK_K 1000 … … 52 52 #define DISK_M_STR "MB" 53 53 #define DISK_G_STR "GB" 54 #define DISK_T_STR "TB" 54 55 55 56 #define SPEED_K 1000 … … 58 59 #define SPEED_M_STR "MB/s" 59 60 #define SPEED_G_STR "GB/s" 61 #define SPEED_T_STR "TB/s" 60 62 61 63 static tr_bool paused = FALSE; … … 464 466 465 467 /* start the session */ 466 tr_formatter_mem_init( MEM_K, MEM_ B_STR, MEM_K_STR, MEM_M_STR, MEM_G_STR );467 tr_formatter_size_init( DISK_K, DISK_B_STR, DISK_K_STR, DISK_M_STR, DISK_G_STR );468 tr_formatter_speed_init( SPEED_K, SPEED_ B_STR, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR );468 tr_formatter_mem_init( MEM_K, MEM_K_STR, MEM_M_STR, MEM_G_STR, MEM_T_STR ); 469 tr_formatter_size_init( DISK_K, DISK_K_STR, DISK_M_STR, DISK_G_STR, DISK_T_STR ); 470 tr_formatter_speed_init( SPEED_K, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR, SPEED_T_STR ); 469 471 mySession = tr_sessionInit( "daemon", configDir, TRUE, &settings ); 470 472 tr_ninf( NULL, "Using settings from \"%s\"", configDir ); -
trunk/daemon/remote.c
r10937 r10955 45 45 46 46 #define MEM_K 1024 47 #define MEM_B_STR "B"48 47 #define MEM_K_STR "KiB" 49 48 #define MEM_M_STR "MiB" 50 49 #define MEM_G_STR "GiB" 50 #define MEM_T_STR "TiB" 51 51 52 52 #define DISK_K 1000 … … 55 55 #define DISK_M_STR "MB" 56 56 #define DISK_G_STR "GB" 57 #define DISK_T_STR "TB" 57 58 58 59 #define SPEED_K 1000 … … 61 62 #define SPEED_M_STR "MB/s" 62 63 #define SPEED_G_STR "GB/s" 64 #define SPEED_T_STR "TB/s" 63 65 64 66 /*** … … 2200 2202 } 2201 2203 2202 tr_formatter_mem_init( MEM_K, MEM_ B_STR, MEM_K_STR, MEM_M_STR, MEM_G_STR );2203 tr_formatter_size_init( DISK_K,DISK_ B_STR, DISK_K_STR, DISK_M_STR, DISK_G_STR );2204 tr_formatter_speed_init( SPEED_K, SPEED_ B_STR, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR );2204 tr_formatter_mem_init( MEM_K, MEM_K_STR, MEM_M_STR, MEM_G_STR, MEM_T_STR ); 2205 tr_formatter_size_init( DISK_K,DISK_K_STR, DISK_M_STR, DISK_G_STR, DISK_T_STR ); 2206 tr_formatter_speed_init( SPEED_K, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR, SPEED_T_STR ); 2205 2207 2206 2208 getHostAndPort( &argc, argv, &host, &port ); -
trunk/gtk/main.c
r10937 r10955 533 533 textdomain( domain ); 534 534 g_set_application_name( _( "Transmission" ) ); 535 tr_formatter_mem_init( mem_K, _(mem_ B_str), _(mem_K_str), _(mem_M_str), _(mem_G_str) );536 tr_formatter_size_init( disk_K, _(disk_ B_str), _(disk_K_str), _(disk_M_str), _(disk_G_str) );537 tr_formatter_speed_init( speed_K, _(speed_ B_str), _(speed_K_str), _(speed_M_str), _(speed_G_str) );535 tr_formatter_mem_init( mem_K, _(mem_K_str), _(mem_M_str), _(mem_G_str), _(mem_T_str) ); 536 tr_formatter_size_init( disk_K, _(disk_K_str), _(disk_M_str), _(disk_G_str), _(disk_T_str) ); 537 tr_formatter_speed_init( speed_K, _(speed_K_str), _(speed_M_str), _(speed_G_str), _(speed_T_str) ); 538 538 539 539 /* initialize gtk */ -
trunk/gtk/util.c
r10937 r10955 48 48 49 49 const int mem_K = 1024; 50 /* abbreviation for bytes */51 const char * mem_B_str = N_("B");52 /* abbreviation IEC base 2 units kilobyte */53 50 const char * mem_K_str = N_("KiB"); 54 /* abbreviation IEC base 2 units megabyte */55 51 const char * mem_M_str = N_("MiB"); 56 /* abbreviation IEC base 2 units gigabyte */57 52 const char * mem_G_str = N_("GiB"); 53 const char * mem_T_str = N_("TiB"); 58 54 59 55 const int disk_K = 1000; 60 /* abbreviation for bytes */61 const char * disk_B_str = N_("B");62 /* abbreviation for SI base 10 kilobyte */63 56 const char * disk_K_str = N_("kB"); 64 /* abbreviation for SI base 10 megabyte */65 57 const char * disk_M_str = N_("MB"); 66 /* abbreviation for SI base 10 gigabyte */67 58 const char * disk_G_str = N_("GB"); 59 const char * disk_T_str = N_("TB"); 68 60 69 61 const int speed_K = 1000; 70 /* abbreviation for bytes per second */71 const char * speed_B_str = N_("B/s");72 /* abbreviation for kilobytes per second */73 62 const char * speed_K_str = N_("kB/s"); 74 /* abbreviation for megabytes per second */75 63 const char * speed_M_str = N_("MB/s"); 76 /* abbreviation for gigabytes per second */77 64 const char * speed_G_str = N_("GB/s"); 65 const char * speed_T_str = N_("TB/s"); 78 66 79 67 /*** -
trunk/gtk/util.h
r10937 r10955 21 21 22 22 extern const int mem_K; 23 extern const char * mem_B_str;24 23 extern const char * mem_K_str; 25 24 extern const char * mem_M_str; 26 25 extern const char * mem_G_str; 26 extern const char * mem_T_str; 27 27 28 28 extern const int disk_K; 29 extern const char * disk_B_str;30 29 extern const char * disk_K_str; 31 30 extern const char * disk_M_str; 32 31 extern const char * disk_G_str; 32 extern const char * disk_T_str; 33 33 34 34 extern const int speed_K; 35 extern const char * speed_B_str;36 35 extern const char * speed_K_str; 37 36 extern const char * speed_M_str; 38 37 extern const char * speed_G_str; 38 extern const char * speed_T_str; 39 39 40 40 /* portability wrapper around g_warn_if_fail() for older versions of glib */ -
trunk/libtransmission/utils.c
r10937 r10955 1517 1517 { 1518 1518 char * name; 1519 unsigned intvalue;1519 unsigned long value; 1520 1520 }; 1521 1521 … … 1525 1525 }; 1526 1526 1527 enum { TR_FMT_ B, TR_FMT_KB, TR_FMT_MB, TR_FMT_GB };1527 enum { TR_FMT_KB, TR_FMT_MB, TR_FMT_GB, TR_FMT_TB }; 1528 1528 1529 1529 static void 1530 1530 formatter_init( struct formatter_units * units, 1531 1531 unsigned int kilo, 1532 const char * b, const char * kb, 1533 const char * mb, const char * gb ) 1534 { 1535 units->units[TR_FMT_B].name = tr_strdup( b ); 1536 units->units[TR_FMT_B].value = 1; 1537 1532 const char * kb, const char * mb, 1533 const char * gb, const char * tb ) 1534 { 1535 unsigned long value = kilo; 1538 1536 units->units[TR_FMT_KB].name = tr_strdup( kb ); 1539 units->units[TR_FMT_KB].value = kilo; 1540 1537 units->units[TR_FMT_KB].value = value; 1538 1539 value *= kilo; 1541 1540 units->units[TR_FMT_MB].name = tr_strdup( mb ); 1542 units->units[TR_FMT_MB].value = kilo * kilo; 1543 1541 units->units[TR_FMT_MB].value = value; 1542 1543 value *= kilo; 1544 1544 units->units[TR_FMT_GB].name = tr_strdup( gb ); 1545 units->units[TR_FMT_GB].value = kilo * kilo * kilo; 1545 units->units[TR_FMT_GB].value = value; 1546 1547 value *= kilo; 1548 units->units[TR_FMT_TB].name = tr_strdup( tb ); 1549 units->units[TR_FMT_TB].value = value; 1546 1550 } 1547 1551 -
trunk/macosx/Controller.m
r10948 r10955 338 338 339 339 #warning localize and make consistent 340 tr_formatter_size_init(1024, " bytes", "KB", "MB", "GB");341 tr_formatter_speed_init(1024, "B/s", "KB/s", "MB/s", "GB/s" );342 tr_formatter_mem_init(1024, " bytes", "KB", "MB", "GB");340 tr_formatter_size_init(1024, "KB", "MB", "GB", "TB"); 341 tr_formatter_speed_init(1024, "B/s", "KB/s", "MB/s", "GB/s", "TB/s"); 342 tr_formatter_mem_init(1024, "KB", "MB", "GB", "TB"); 343 343 344 344 [NSApp setDelegate: self]; -
trunk/qt/app.cc
r10933 r10955 102 102 // initialize the units formatter 103 103 tr_formatter_mem_init( Formatter::mem_K, 104 qPrintable( Formatter::mem_B_str ),105 104 qPrintable( Formatter::mem_K_str ), 106 105 qPrintable( Formatter::mem_M_str ), 107 qPrintable( Formatter::mem_G_str ) ); 106 qPrintable( Formatter::mem_G_str ), 107 qPrintable( Formatter::mem_T_str ) ); 108 108 tr_formatter_size_init( Formatter::size_K, 109 qPrintable( Formatter::size_B_str ),110 109 qPrintable( Formatter::size_K_str ), 111 110 qPrintable( Formatter::size_M_str ), 112 qPrintable( Formatter::size_G_str ) ); 111 qPrintable( Formatter::size_G_str ), 112 qPrintable( Formatter::size_T_str ) ); 113 113 tr_formatter_speed_init( Formatter::speed_K, 114 qPrintable( Formatter::speed_B_str ),115 114 qPrintable( Formatter::speed_K_str ), 116 115 qPrintable( Formatter::speed_M_str ), 117 qPrintable( Formatter::speed_G_str ) ); 116 qPrintable( Formatter::speed_G_str ), 117 qPrintable( Formatter::speed_T_str ) ); 118 118 119 119 // set the default icon -
trunk/qt/formatter.cc
r10937 r10955 24 24 25 25 const int Formatter :: speed_K = 1000; 26 const QString Formatter :: speed_B_str = "B/s";27 26 const QString Formatter :: speed_K_str = "kB/s"; 28 27 const QString Formatter :: speed_M_str = "MB/s"; 29 28 const QString Formatter :: speed_G_str = "GB/s"; 29 const QString Formatter :: speed_T_str = "TB/s"; 30 30 31 31 const int Formatter :: size_K = 1000; 32 const QString Formatter :: size_B_str = "B";33 32 const QString Formatter :: size_K_str = "kB"; 34 33 const QString Formatter :: size_M_str = "MB"; 35 34 const QString Formatter :: size_G_str = "GB"; 35 const QString Formatter :: size_T_str = "TB"; 36 36 37 37 const int Formatter :: mem_K = 1024; 38 const QString Formatter :: mem_B_str = "B";39 38 const QString Formatter :: mem_K_str = "KiB"; 40 39 const QString Formatter :: mem_M_str = "MiB"; 41 40 const QString Formatter :: mem_G_str = "GiB"; 41 const QString Formatter :: mem_T_str = "TiB"; 42 42 43 43 /*** -
trunk/qt/formatter.h
r10933 r10955 41 41 42 42 static const int speed_K; 43 static const QString speed_B_str;44 43 static const QString speed_K_str; 45 44 static const QString speed_M_str; 46 45 static const QString speed_G_str; 46 static const QString speed_T_str; 47 47 48 48 static const int size_K; 49 static const QString size_B_str;50 49 static const QString size_K_str; 51 50 static const QString size_M_str; 52 51 static const QString size_G_str; 52 static const QString size_T_str; 53 53 54 54 static const int mem_K; 55 static const QString mem_B_str;56 55 static const QString mem_K_str; 57 56 static const QString mem_M_str; 58 57 static const QString mem_G_str; 58 static const QString mem_T_str; 59 59 }; 60 60 -
trunk/utils/show.c
r10937 r10955 30 30 31 31 #define MEM_K 1024 32 #define MEM_B_STR "B"33 32 #define MEM_K_STR "KiB" 34 33 #define MEM_M_STR "MiB" 35 34 #define MEM_G_STR "GiB" 35 #define MEM_T_STR "TiB" 36 36 37 37 #define DISK_K 1000 … … 40 40 #define DISK_M_STR "MB" 41 41 #define DISK_G_STR "GB" 42 #define DISK_T_STR "TB" 42 43 43 44 #define SPEED_K 1000 … … 46 47 #define SPEED_M_STR "MB/s" 47 48 #define SPEED_G_STR "GB/s" 49 #define SPEED_T_STR "TB/s" 48 50 49 51 static tr_option options[] = … … 250 252 251 253 tr_setMessageLevel( TR_MSG_ERR ); 252 tr_formatter_mem_init ( MEM_K, MEM_ B_STR, MEM_K_STR, MEM_M_STR, MEM_G_STR );253 tr_formatter_size_init ( DISK_K, DISK_ B_STR, DISK_K_STR, DISK_M_STR, DISK_G_STR );254 tr_formatter_size_init ( SPEED_K, SPEED_ B_STR, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR );254 tr_formatter_mem_init ( MEM_K, MEM_K_STR, MEM_M_STR, MEM_G_STR, MEM_T_STR ); 255 tr_formatter_size_init ( DISK_K, DISK_K_STR, DISK_M_STR, DISK_G_STR, DISK_T_STR ); 256 tr_formatter_size_init ( SPEED_K, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR, SPEED_T_STR ); 255 257 256 258 if( parseCommandLine( argc, (const char**)argv ) )
Note: See TracChangeset
for help on using the changeset viewer.