[vlc-commits] Qt: make the resume panel timer cancellable
Ludovic Fauvet
git at videolan.org
Mon Nov 24 19:28:14 CET 2014
vlc/vlc-2.2 | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Nov 24 16:18:08 2014 +0100| [2c39151b02e49f8ba4e85ead8622438d6253adde] | committer: Jean-Baptiste Kempf
Qt: make the resume panel timer cancellable
(cherry picked from commit 1cb34c7916d538776a0b47785bde9f863358c551)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=2c39151b02e49f8ba4e85ead8622438d6253adde
---
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 a72fae8..f91385e 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -387,6 +387,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() );
@@ -408,7 +414,7 @@ void MainInterface::showContinueDialog( int64_t _time ) {
else
{
continueDialog->setVisible(true);
- QTimer::singleShot(6000, this, SLOT(hideContinueDialog()));
+ continueTimer->start();
}
}
@@ -419,6 +425,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 3c769f8..02d5b10 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;
class MainInterface : public QVLCMW
@@ -149,6 +150,7 @@ private:
/* continue */
QWidget *continueDialog;
+ QTimer *continueTimer;
int64_t i_continueTime;
/* Status Bar */
More information about the vlc-commits
mailing list