[vlc-commits] Qt: make the resume panel timer cancellable
Ludovic Fauvet
git at videolan.org
Mon Nov 24 18:15:05 CET 2014
vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Nov 24 16:18:08 2014 +0100| [1cb34c7916d538776a0b47785bde9f863358c551] | committer: Ludovic Fauvet
Qt: make the resume panel timer cancellable
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1cb34c7916d538776a0b47785bde9f863358c551
---
modules/gui/qt4/main_interface.cpp | 9 ++++++++-
modules/gui/qt4/main_interface.hpp | 2 ++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index ddeb695..0fa217a 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -385,6 +385,12 @@ void MainInterface::createContinueDialog( QWidget *w )
continueDialogLayout->addWidget( ok );
continueDialogLayout->addWidget( cancel );
+ continueTimer = new QTimer( continueDialog );
+ continueTimer->setSingleShot( true );
+ continueTimer->setInterval( 6000 );
+
+ CONNECT( continueTimer, timeout(), this, hideContinueDialog() );
+
CONNECT( cancel, clicked(), this, hideContinueDialog() );
BUTTONACT(ok, continuePlayback() );
@@ -406,7 +412,7 @@ void MainInterface::showContinueDialog( int64_t _time ) {
else
{
continueDialog->setVisible(true);
- QTimer::singleShot(6000, this, SLOT(hideContinueDialog()));
+ continueTimer->start();
}
}
@@ -417,6 +423,7 @@ void MainInterface::hideContinueDialog()
if( !isFullScreen() && !isMaximized() )
resize( width(), height() - continueDialog->height() );
continueDialog->hide();
+ continueTimer->stop();
}
}
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 7af3fdf..be7101e 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -54,6 +54,7 @@ class SpeedControlWidget;
class QVBoxLayout;
class QMenu;
class QSize;
+class QTimer;
class StandardPLPanel;
struct vout_window_t;
@@ -150,6 +151,7 @@ private:
/* continue */
QWidget *continueDialog;
+ QTimer *continueTimer;
int64_t i_continueTime;
/* Status Bar */
More information about the vlc-commits
mailing list