mirror of
https://github.com/transmission/transmission
synced 2025-03-03 18:25:35 +00:00
(trunk gtk,qt) #2490: gtk, qt clients' Details dialog doesn't show ETA anymore
This commit is contained in:
parent
2730f9ac9c
commit
f58994b7bf
3 changed files with 48 additions and 0 deletions
|
@ -70,6 +70,7 @@ struct DetailsImpl
|
||||||
GtkWidget * ratio_lb;
|
GtkWidget * ratio_lb;
|
||||||
GtkWidget * error_lb;
|
GtkWidget * error_lb;
|
||||||
GtkWidget * date_started_lb;
|
GtkWidget * date_started_lb;
|
||||||
|
GtkWidget * eta_lb;
|
||||||
GtkWidget * last_activity_lb;
|
GtkWidget * last_activity_lb;
|
||||||
|
|
||||||
GtkWidget * hash_lb;
|
GtkWidget * hash_lb;
|
||||||
|
@ -732,6 +733,25 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
|
||||||
gtk_label_set_text( GTK_LABEL( di->date_started_lb ), str );
|
gtk_label_set_text( GTK_LABEL( di->date_started_lb ), str );
|
||||||
|
|
||||||
|
|
||||||
|
/* eta */
|
||||||
|
if( n <= 0 )
|
||||||
|
str = none;
|
||||||
|
else {
|
||||||
|
const int baseline = stats[0]->eta;
|
||||||
|
for( i=1; i<n; ++i )
|
||||||
|
if( baseline != stats[i]->eta )
|
||||||
|
break;
|
||||||
|
if( i!=n )
|
||||||
|
str = mixed;
|
||||||
|
else if( baseline < 0 )
|
||||||
|
str = _( "Unknown" );
|
||||||
|
else
|
||||||
|
str = tr_strltime( buf, baseline, sizeof( buf ) );
|
||||||
|
}
|
||||||
|
gtk_label_set_text( GTK_LABEL( di->eta_lb ), str );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* size_lb */
|
/* size_lb */
|
||||||
{
|
{
|
||||||
char sizebuf[128];
|
char sizebuf[128];
|
||||||
|
@ -941,6 +961,10 @@ info_page_new( struct DetailsImpl * di )
|
||||||
l = di->date_started_lb = gtk_label_new( NULL );
|
l = di->date_started_lb = gtk_label_new( NULL );
|
||||||
hig_workarea_add_row( t, &row, _( "Running time:" ), l, NULL );
|
hig_workarea_add_row( t, &row, _( "Running time:" ), l, NULL );
|
||||||
|
|
||||||
|
/* eta */
|
||||||
|
l = di->eta_lb = gtk_label_new( NULL );
|
||||||
|
hig_workarea_add_row( t, &row, _( "Remaining time:" ), l, NULL );
|
||||||
|
|
||||||
/* last activity */
|
/* last activity */
|
||||||
l = di->last_activity_lb = gtk_label_new( NULL );
|
l = di->last_activity_lb = gtk_label_new( NULL );
|
||||||
hig_workarea_add_row( t, &row, _( "Last activity:" ), l, NULL );
|
hig_workarea_add_row( t, &row, _( "Last activity:" ), l, NULL );
|
||||||
|
|
|
@ -329,6 +329,28 @@ Details :: refresh( )
|
||||||
myRunTimeLabel->setText( string );
|
myRunTimeLabel->setText( string );
|
||||||
|
|
||||||
|
|
||||||
|
// myETALabel
|
||||||
|
string.clear( );
|
||||||
|
if( torrents.empty( ) )
|
||||||
|
string = none;
|
||||||
|
else {
|
||||||
|
int baseline = torrents[0]->getETA( );
|
||||||
|
foreach( const Torrent * t, torrents ) {
|
||||||
|
if( baseline != t->getETA( ) ) {
|
||||||
|
string = mixed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( string.isEmpty( ) ) {
|
||||||
|
if( baseline < 0 )
|
||||||
|
string = tr( "Unknown" );
|
||||||
|
else
|
||||||
|
string = Utils::timeToString( baseline );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
myETALabel->setText( string );
|
||||||
|
|
||||||
|
|
||||||
// myLastActivityLabel
|
// myLastActivityLabel
|
||||||
if( torrents.empty( ) )
|
if( torrents.empty( ) )
|
||||||
string = none;
|
string = none;
|
||||||
|
@ -791,6 +813,7 @@ Details :: createInfoTab( )
|
||||||
hig->addRow( tr( "Ratio:" ), myRatioLabel = new SqueezeLabel );
|
hig->addRow( tr( "Ratio:" ), myRatioLabel = new SqueezeLabel );
|
||||||
hig->addRow( tr( "State:" ), myStateLabel = new SqueezeLabel );
|
hig->addRow( tr( "State:" ), myStateLabel = new SqueezeLabel );
|
||||||
hig->addRow( tr( "Running time:" ), myRunTimeLabel = new SqueezeLabel );
|
hig->addRow( tr( "Running time:" ), myRunTimeLabel = new SqueezeLabel );
|
||||||
|
hig->addRow( tr( "Remaining time:" ), myETALabel = new SqueezeLabel );
|
||||||
hig->addRow( tr( "Last activity:" ), myLastActivityLabel = new SqueezeLabel );
|
hig->addRow( tr( "Last activity:" ), myLastActivityLabel = new SqueezeLabel );
|
||||||
hig->addRow( tr( "Error:" ), myErrorLabel = new SqueezeLabel );
|
hig->addRow( tr( "Error:" ), myErrorLabel = new SqueezeLabel );
|
||||||
hig->addSectionDivider( );
|
hig->addSectionDivider( );
|
||||||
|
|
|
@ -76,6 +76,7 @@ class Details: public QDialog
|
||||||
QLabel * myRatioLabel;
|
QLabel * myRatioLabel;
|
||||||
QLabel * myErrorLabel;
|
QLabel * myErrorLabel;
|
||||||
QLabel * myRunTimeLabel;
|
QLabel * myRunTimeLabel;
|
||||||
|
QLabel * myETALabel;
|
||||||
QLabel * myLastActivityLabel;
|
QLabel * myLastActivityLabel;
|
||||||
|
|
||||||
QCheckBox * mySessionLimitCheck;
|
QCheckBox * mySessionLimitCheck;
|
||||||
|
|
Loading…
Reference in a new issue