Changeset 5336


Ignore:
Timestamp:
Mar 23, 2008, 1:04:30 AM (14 years ago)
Author:
charles
Message:

(gtk) "Details" dialog minor tweak

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r5321 r5336  
    408408  } else {
    409409    char str[16];
    410     g_snprintf( str, sizeof str, "%i", count );
     410    g_snprintf( str, sizeof str, "%'d", count );
    411411    gtk_label_set_text( GTK_LABEL(l), str );
    412412  }
     
    756756refresh_activity (GtkWidget * top)
    757757{
    758   Activity * a = (Activity*) g_object_get_data (G_OBJECT(top), "activity-data");
    759   const tr_stat * stat = tr_torrent_stat( a->gtor );
     758  Activity * a = g_object_get_data (G_OBJECT(top), "activity-data");
    760759  char *pch;
    761760  char sizeStr[64];
    762761  char sizeStr2[64];
    763762  char buf[128];
     763  const tr_stat * stat = tr_torrent_stat( a->gtor );
     764  const double complete = stat->percentComplete * 100.0;
     765  const double done = stat->percentDone * 100.0;
    764766
    765767  pch = tr_torrent_status_str( a->gtor );
     
    767769  g_free (pch);
    768770
    769   /* %1$.1f is percent of how much of what we want's been downloaded,
    770      %2$.1f is percent of how much of the whole torrent we've downloaded */
    771   pch = g_strdup_printf( _( "%1$.1f%% (%2$.1f%% selected)" ), stat->percentComplete*100.0, stat->percentDone*100.0 );
     771  if( (int)complete == (int)done )
     772    pch = g_strdup_printf( _( "%.1f%%" ), complete );
     773  else
     774    /* %1$.1f is percent of how much of what we want's been downloaded,
     775       %2$.1f is percent of how much of the whole torrent we've downloaded */
     776    pch = g_strdup_printf( _( "%1$.1f%% (%2$.1f%% selected)" ), complete, done );
    772777  gtk_label_set_text (GTK_LABEL(a->progress_lb), pch);
    773778  g_free (pch);
Note: See TracChangeset for help on using the changeset viewer.