Changeset 96


Ignore:
Timestamp:
Feb 7, 2006, 5:15:16 PM (15 years ago)
Author:
joshe
Message:

Show seeders and leechers in properties window.
Show ratio instead of download rate when torrent is finished.

Location:
trunk/gtk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/dialogs.c

    r89 r96  
    381381  int ii;
    382382  char *str;
    383   const int rowcount = 12;
     383  const int rowcount = 14;
    384384  GtkWidget *table = gtk_table_new(rowcount, 2, FALSE);
    385385
     
    421421  INFOLINEF(table, ii, "%i", _("Pieces:"), sb[id].info.pieceCount);
    422422  INFOLINEA(table, ii, _("Total Size:"), readablesize(sb[id].info.totalSize, 1));
     423  INFOLINEF(table, ii, "%i", _("Seeders:"), sb[id].seeders);
     424  INFOLINEF(table, ii, "%i", _("Leechers:"), sb[id].leechers);
    423425
    424426  INFOSEP(table, ii);
  • trunk/gtk/main.c

    r91 r96  
    692692    prog = 1.0;
    693693
    694   dlstr = readablesize(dl * 1024.0, 2);
    695694  ulstr = readablesize(ul * 1024.0, 2);
    696   str = g_strdup_printf(_("DL: %s/s\nUL: %s/s"), dlstr, ulstr);
     695  if(1.0 == prog) {
     696    dlstr = ratiostr(dl, ul);
     697    str = g_strdup_printf(_("Ratio: %s\nUL: %s/s"), dlstr, ulstr);
     698  } else {
     699    dlstr = readablesize(dl * 1024.0, 2);
     700    str = g_strdup_printf(_("DL: %s/s\nUL: %s/s"), dlstr, ulstr);
     701  }
    697702  marked = g_markup_printf_escaped("<small>%s</small>", str);
    698703  g_object_set(rend, "text", str, "value", prog, NULL);
  • trunk/gtk/po/transmission-gtk.pot

    r89 r96  
    99"Project-Id-Version: PACKAGE VERSION\n"
    1010"Report-Msgid-Bugs-To: \n"
    11 "POT-Creation-Date: 2006-02-05 12:27-0500\n"
     11"POT-Creation-Date: 2006-02-07 12:08-0500\n"
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1414"Language-Team: LANGUAGE <LL@li.org>\n"
    1515"MIME-Version: 1.0\n"
    16 "Content-Type: text/plain; charset=CHARSET\n"
     16"Content-Type: text/plain; charset=UTF-8\n"
    1717"Content-Transfer-Encoding: 8bit\n"
    1818"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
     
    4444msgstr ""
    4545
    46 #: conf.c:115 dialogs.c:191 main.c:947
     46#: conf.c:115 dialogs.c:191 main.c:1014
    4747#, c-format
    4848msgid ""
     
    7070msgstr ""
    7171
    72 #: conf.c:233 conf.c:431
     72#: conf.c:233 conf.c:432
    7373#, c-format
    7474msgid ""
     
    7777msgstr ""
    7878
    79 #: conf.c:253 conf.c:471
     79#: conf.c:253 conf.c:472
    8080#, c-format
    8181msgid ""
     
    8484msgstr ""
    8585
    86 #: conf.c:260 conf.c:478
     86#: conf.c:260 conf.c:479
    8787#, c-format
    8888msgid ""
     
    168168msgstr ""
    169169
    170 #: dialogs.c:426
     170#: dialogs.c:423
     171msgid "Seeders:"
     172msgstr ""
     173
     174#: dialogs.c:424
     175msgid "Leechers:"
     176msgstr ""
     177
     178#: dialogs.c:428
    171179msgid "Directory:"
    172180msgstr ""
    173181
    174 #: dialogs.c:427
     182#: dialogs.c:429
    175183msgid "Downloaded:"
    176184msgstr ""
    177185
    178 #: dialogs.c:428
     186#: dialogs.c:430
    179187msgid "Uploaded:"
    180188msgstr ""
    181189
    182 #: main.c:149
     190#: main.c:154
    183191msgid "Add"
    184192msgstr ""
    185193
    186 #: main.c:150
     194#: main.c:155
    187195msgid "Add a new torrent"
    188196msgstr ""
    189197
    190 #: main.c:151
     198#: main.c:156
    191199msgid "Start"
    192200msgstr ""
    193201
    194 #: main.c:153
     202#: main.c:158
    195203msgid "Start a torrent that is not running"
    196204msgstr ""
    197205
    198 #: main.c:154
     206#: main.c:159
    199207msgid "Stop"
    200208msgstr ""
    201209
    202 #: main.c:156
     210#: main.c:161
    203211msgid "Stop a torrent that is running"
    204212msgstr ""
    205213
    206 #: main.c:157
     214#: main.c:162
    207215msgid "Remove"
    208216msgstr ""
    209217
    210 #: main.c:158
     218#: main.c:163
    211219msgid "Remove a torrent"
    212220msgstr ""
    213221
    214 #: main.c:159
     222#: main.c:164
    215223msgid "Properties"
    216224msgstr ""
    217225
    218 #: main.c:160
     226#: main.c:165
    219227msgid "Show additional information about a torrent"
    220228msgstr ""
    221229
    222 #: main.c:161
     230#: main.c:166
    223231msgid "Preferences"
    224232msgstr ""
    225233
    226 #: main.c:162
     234#: main.c:167
    227235msgid "Customize application behavior"
    228236msgstr ""
    229237
    230 #: main.c:180
     238#: main.c:185
    231239msgid "Transmission"
    232240msgstr ""
    233241
    234 #: main.c:308 main.c:959
     242#: main.c:315 main.c:1026
    235243#, c-format
    236244msgid "Failed to load the torrent file %s"
     
    241249msgstr[1] ""
    242250
    243 #: main.c:494
     251#: main.c:556
    244252msgid "Name"
    245253msgstr ""
    246254
    247255#. this string is only used to determing the size of the progress bar
    248 #: main.c:501
     256#: main.c:563
    249257msgid "  fnord    fnord  "
    250258msgstr ""
    251259
    252 #: main.c:504
     260#: main.c:566
    253261msgid "Progress"
    254262msgstr ""
    255263
    256 #: main.c:579
     264#: main.c:641
    257265#, c-format
    258266msgid "Checking existing files (%.1f%%)"
    259267msgstr ""
    260268
    261 #: main.c:581
     269#: main.c:643
    262270#, c-format
    263271msgid "Finishing in %02i:%02i:%02i (%.1f%%)"
    264272msgstr ""
    265273
    266 #: main.c:584
     274#: main.c:646
    267275#, c-format
    268276msgid "Seeding, uploading to %d of %d peer"
     
    271279msgstr[1] ""
    272280
    273 #: main.c:588
     281#: main.c:650
    274282msgid "Stopping..."
    275283msgstr ""
    276284
    277 #: main.c:590
     285#: main.c:652
    278286#, c-format
    279287msgid "Stopped (%.1f%%)"
    280288msgstr ""
    281289
    282 #: main.c:598
     290#: main.c:660
    283291msgid "Error: "
    284292msgstr ""
    285293
    286 #: main.c:602
     294#: main.c:664
    287295#, c-format
    288296msgid "Downloading from %i of %i peer"
     
    291299msgstr[1] ""
    292300
    293 #: main.c:634
     301#: main.c:697
     302#, c-format
     303msgid ""
     304"Ratio: %s\n"
     305"UL: %s/s"
     306msgstr ""
     307
     308#: main.c:700
    294309#, c-format
    295310msgid ""
     
    298313msgstr ""
    299314
    300 #: main.c:681
     315#: main.c:748
    301316#, c-format
    302317msgid "     Total DL: %s/s     Total UL: %s/s"
     
    330345msgid "EiB"
    331346msgstr ""
     347
     348#: util.c:87
     349msgid "N/A"
     350msgstr ""
     351
     352#. this is a UTF-8 infinity symbol
     353#: util.c:91
     354msgid "∞"
     355msgstr ""
  • trunk/gtk/util.c

    r91 r96  
    8080}
    8181
     82char *
     83ratiostr(guint64 down, guint64 up) {
     84  double ratio;
     85
     86  if(0 == up && 0 == down)
     87    return g_strdup(_("N/A"));
     88
     89  if(0 == down)
     90    /* this is a UTF-8 infinity symbol */
     91    return g_strdup(_("\xE2\x88\x9E"));
     92
     93  ratio = up / down;
     94
     95  return g_strdup_printf("%.*f", (10.0 > ratio ? 2 : (100.0 > ratio ? 1 : 0)),
     96                         ratio);
     97}
     98
    8299gboolean
    83100mkdir_p(const char *name, mode_t mode) {
  • trunk/gtk/util.h

    r91 r96  
    5454readablesize(guint64 size, int decimals);
    5555
     56/* returns a string representing the download ratio.
     57   the string must be g_free()d */
     58char *
     59ratiostr(guint64 down, guint64 up);
     60
    5661/* create a directory and any missing parent directories */
    5762gboolean
Note: See TracChangeset for help on using the changeset viewer.