Commit 1cb34c79 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Qt: make the resume panel timer cancellable

parent c7acc872
...@@ -385,6 +385,12 @@ void MainInterface::createContinueDialog( QWidget *w ) ...@@ -385,6 +385,12 @@ void MainInterface::createContinueDialog( QWidget *w )
continueDialogLayout->addWidget( ok ); continueDialogLayout->addWidget( ok );
continueDialogLayout->addWidget( cancel ); continueDialogLayout->addWidget( cancel );
continueTimer = new QTimer( continueDialog );
continueTimer->setSingleShot( true );
continueTimer->setInterval( 6000 );
CONNECT( continueTimer, timeout(), this, hideContinueDialog() );
CONNECT( cancel, clicked(), this, hideContinueDialog() ); CONNECT( cancel, clicked(), this, hideContinueDialog() );
BUTTONACT(ok, continuePlayback() ); BUTTONACT(ok, continuePlayback() );
...@@ -406,7 +412,7 @@ void MainInterface::showContinueDialog( int64_t _time ) { ...@@ -406,7 +412,7 @@ void MainInterface::showContinueDialog( int64_t _time ) {
else else
{ {
continueDialog->setVisible(true); continueDialog->setVisible(true);
QTimer::singleShot(6000, this, SLOT(hideContinueDialog())); continueTimer->start();
} }
} }
...@@ -417,6 +423,7 @@ void MainInterface::hideContinueDialog() ...@@ -417,6 +423,7 @@ void MainInterface::hideContinueDialog()
if( !isFullScreen() && !isMaximized() ) if( !isFullScreen() && !isMaximized() )
resize( width(), height() - continueDialog->height() ); resize( width(), height() - continueDialog->height() );
continueDialog->hide(); continueDialog->hide();
continueTimer->stop();
} }
} }
......
...@@ -54,6 +54,7 @@ class SpeedControlWidget; ...@@ -54,6 +54,7 @@ class SpeedControlWidget;
class QVBoxLayout; class QVBoxLayout;
class QMenu; class QMenu;
class QSize; class QSize;
class QTimer;
class StandardPLPanel; class StandardPLPanel;
struct vout_window_t; struct vout_window_t;
...@@ -150,6 +151,7 @@ private: ...@@ -150,6 +151,7 @@ private:
/* continue */ /* continue */
QWidget *continueDialog; QWidget *continueDialog;
QTimer *continueTimer;
int64_t i_continueTime; int64_t i_continueTime;
/* Status Bar */ /* Status Bar */
......
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