Changeset 9280 for trunk/gtk/details.c


Ignore:
Timestamp:
Oct 10, 2009, 8:42:23 PM (13 years ago)
Author:
charles
Message:

(trunk gtk,qt) #2490: gtk, qt clients' Details dialog doesn't show ETA anymore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r9275 r9280  
    7171    GtkWidget * error_lb;
    7272    GtkWidget * date_started_lb;
     73    GtkWidget * eta_lb;
    7374    GtkWidget * last_activity_lb;
    7475
     
    731732    }
    732733    gtk_label_set_text( GTK_LABEL( di->date_started_lb ), str );
     734
     735
     736    /* eta */
     737    if( n <= 0 )
     738        str = none;
     739    else {
     740        const int baseline = stats[0]->eta;
     741        for( i=1; i<n; ++i )
     742            if( baseline != stats[i]->eta )
     743                break;
     744        if( i!=n )
     745            str = mixed;
     746        else if( baseline < 0 )
     747            str = _( "Unknown" );
     748        else
     749            str = tr_strltime( buf, baseline, sizeof( buf ) );
     750    }
     751    gtk_label_set_text( GTK_LABEL( di->eta_lb ), str );
     752     
    733753
    734754
     
    941961        l = di->date_started_lb = gtk_label_new( NULL );
    942962        hig_workarea_add_row( t, &row, _( "Running time:" ), l, NULL );
     963
     964        /* eta */
     965        l = di->eta_lb = gtk_label_new( NULL );
     966        hig_workarea_add_row( t, &row, _( "Remaining time:" ), l, NULL );
    943967
    944968        /* last activity */
Note: See TracChangeset for help on using the changeset viewer.