Changeset 5227


Ignore:
Timestamp:
Mar 8, 2008, 4:10:13 PM (14 years ago)
Author:
charles
Message:

(gtk) plug a minor leak in the Statistics dialog.

Location:
trunk/gtk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r5226 r5227  
    12541254  gtk_notebook_append_page (GTK_NOTEBOOK(n),
    12551255                            info_page_new (tor),
    1256                             gtk_label_new (_("Info")));
     1256                            gtk_label_new (_("Information")));
    12571257
    12581258  w = file_list_new( gtor );
  • trunk/gtk/msgwin.c

    r5226 r5227  
    219219} trLevels[] = {
    220220  { N_("Error"), "error", "ERR", TR_MSG_ERR },
    221   { N_("Info"),  "info",  "INF", TR_MSG_INF },
     221  { N_("Information"),  "info",  "INF", TR_MSG_INF },
    222222  { N_("Debug"), "debug", "DBG", TR_MSG_DBG },
    223223};
  • trunk/gtk/stats.c

    r5226 r5227  
    5959    setLabel( ui->one_time_lb, tr_strltime( buf, one.secondsActive, sizeof(buf) ) );
    6060    setLabelFromRatio( ui->one_ratio_lb, one.ratio );
    61     setLabel( ui->all_sessions_lb, g_strdup_printf( _("Started %d times"), (int)all.sessionCount ) );
     61
     62    g_snprintf( buf, sizeof( buf ), _( "Started %d times" ), (int)all.sessionCount );
     63    setLabel( ui->all_sessions_lb, buf );
    6264    setLabel( ui->all_up_lb, tr_strlsize( buf, all.uploadedBytes, sizeof(buf) ) );
    6365    setLabel( ui->all_down_lb, tr_strlsize( buf, all.downloadedBytes, sizeof(buf) ) );
  • trunk/gtk/util.c

    r5221 r5227  
    119119{
    120120    int hours;
     121    int days;
    121122
    122123    if( seconds < 0 )
     
    136137    }
    137138
    138     hours = seconds / ( 60 *60 );
     139    hours = seconds / ( 60 * 60 );
    139140
    140141    if( seconds < ( 60 * 60 * 4 ) )
     
    151152    }
    152153
    153     g_snprintf( buf, buflen, ngettext( "%'d hour", "%'d hours", hours ), hours );
     154    if( hours < 24 )
     155    {
     156        g_snprintf( buf, buflen, ngettext( "%'d hour", "%'d hours", hours ), hours );
     157        return buf;
     158    }
     159
     160    days = seconds / ( 60 * 60 * 24 );
     161    g_snprintf( buf, buflen, ngettext( "'%d day", "%'d days", days ), days );
    154162    return buf;
    155163}
Note: See TracChangeset for help on using the changeset viewer.