Commit 8784800a authored by Benoit's avatar Benoit Committed by Hugo Beauzée-Luyssen

Qt: fix syncing elapsed / remaining time in TimeLabel

Fix #8292
Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent f9dc591a
......@@ -797,9 +797,20 @@ TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType )
CONNECT( THEMIM->getIM(), positionUpdated( float, int64_t, int ),
this, setDisplayPosition( float, int64_t, int ) );
connect( this, SIGNAL( broadcastRemainingTime( bool ) ),
THEMIM->getIM(), SIGNAL( remainingTimeChanged( bool ) ) );
CONNECT( THEMIM->getIM(), remainingTimeChanged( bool ),
this, setRemainingTime( bool ) );
setStyleSheet( "QLabel { padding-left: 4px; padding-right: 4px; }" );
}
void TimeLabel::setRemainingTime( bool remainingTime )
{
b_remainingTime = remainingTime;
}
void TimeLabel::setDisplayPosition( float pos, int64_t t, int length )
{
if( pos == -1.f )
......@@ -890,5 +901,6 @@ void TimeLabel::toggleTimeDisplay()
{
b_remainingTime = !b_remainingTime;
getSettings()->setValue( "MainWindow/ShowRemainingTime", b_remainingTime );
emit broadcastRemainingTime( b_remainingTime );
}
......@@ -209,8 +209,11 @@ private:
char psz_time[MSTRTIME_MAX_SIZE];
void toggleTimeDisplay();
private slots:
void setRemainingTime( bool );
void setDisplayPosition( float pos, int64_t time, int length );
void setDisplayPosition( float pos );
signals:
void broadcastRemainingTime( bool );
};
class SpeedLabel : public QLabel
......
......@@ -212,6 +212,7 @@ private slots:
signals:
/// Send new position, new time and new length
void positionUpdated( float , int64_t, int );
void remainingTimeChanged( bool );
void seekRequested( float pos );
void rateChanged( float );
void nameChanged( const QString& );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment