[vlc-commits] Qt: better wording for the resume playback code
Ludovic Fauvet
git at videolan.org
Wed Dec 17 17:54:52 CET 2014
vlc/vlc-2.2 | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Nov 24 19:11:15 2014 +0100| [52aefe9516f5d1ce5627f305df66896dcfe2c1fa] | committer: Jean-Baptiste Kempf
Qt: better wording for the resume playback code
(cherry picked from commit 65e800488b3c875e653aafb20b769b99b0edf69b)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=52aefe9516f5d1ce5627f305df66896dcfe2c1fa
---
modules/gui/qt4/input_manager.cpp | 2 +-
modules/gui/qt4/input_manager.hpp | 4 +--
modules/gui/qt4/main_interface.cpp | 70 ++++++++++++++++++------------------
modules/gui/qt4/main_interface.hpp | 16 ++++-----
4 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 1a04f51..dbc317a 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -136,7 +136,7 @@ void InputManager::setInput( input_thread_t *_p_input )
!var_GetFloat( p_input, "start-time" ) &&
!var_GetFloat( p_input, "stop-time" ) )
{
- emit continuePlayback( (int64_t)i_time * 1000 );
+ emit resumePlayback( (int64_t)i_time * 1000 );
}
}
}
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 60719b8..e6cc0ed 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -223,8 +223,8 @@ signals:
void titleChanged( bool );
void chapterChanged( bool );
void inputCanSeek( bool );
- /// You can continuePlayback
- void continuePlayback( int64_t );
+ /// You can resume playback
+ void resumePlayback( int64_t );
/// Statistics are updated
void statisticsUpdated( input_item_t* );
void infoChanged( input_item_t* );
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index c41d9e8..b7e7f54 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -368,13 +368,13 @@ void MainInterface::reloadPrefs()
}
}
-void MainInterface::createContinueDialog( QWidget *w )
+void MainInterface::createResumePanel( QWidget *w )
{
- /* Create non-modal continueDialog */
- continueDialog = new QWidget( w );
- continueDialog->hide();
- QHBoxLayout *continueDialogLayout = new QHBoxLayout( continueDialog );
- continueDialogLayout->setSpacing( 0 ); continueDialogLayout->setMargin( 0 );
+ /* Create non-modal resumePanel */
+ resumePanel = new QWidget( w );
+ resumePanel->hide();
+ QHBoxLayout *resumePanelLayout = new QHBoxLayout( resumePanel );
+ resumePanelLayout->setSpacing( 0 ); resumePanelLayout->setMargin( 0 );
QLabel *continuePixmapLabel = new QLabel();
continuePixmapLabel->setPixmap( QPixmap( ":/menu/help" ) );
@@ -382,63 +382,63 @@ void MainInterface::createContinueDialog( QWidget *w )
QLabel *continueLabel = new QLabel( qtr( "Do you want to restart the playback where left off?") );
- QToolButton *cancel = new QToolButton( continueDialog );
+ QToolButton *cancel = new QToolButton( resumePanel );
cancel->setAutoRaise( true );
cancel->setText( "X" );
QPushButton *ok = new QPushButton( qtr("&Continue") );
- continueDialogLayout->addWidget( continuePixmapLabel );
- continueDialogLayout->addWidget(continueLabel);
- continueDialogLayout->addStretch( 1 );
- continueDialogLayout->addWidget( ok );
- continueDialogLayout->addWidget( cancel );
+ resumePanelLayout->addWidget( continuePixmapLabel );
+ resumePanelLayout->addWidget(continueLabel);
+ resumePanelLayout->addStretch( 1 );
+ resumePanelLayout->addWidget( ok );
+ resumePanelLayout->addWidget( cancel );
- continueTimer = new QTimer( continueDialog );
- continueTimer->setSingleShot( true );
- continueTimer->setInterval( 6000 );
+ resumeTimer = new QTimer( resumePanel );
+ resumeTimer->setSingleShot( true );
+ resumeTimer->setInterval( 6000 );
- CONNECT( continueTimer, timeout(), this, hideContinueDialog() );
+ CONNECT( resumeTimer, timeout(), this, hideResumePanel() );
- CONNECT( cancel, clicked(), this, hideContinueDialog() );
- BUTTONACT(ok, continuePlayback() );
+ CONNECT( cancel, clicked(), this, hideResumePanel() );
+ BUTTONACT(ok, resumePlayback() );
- CONNECT( THEMIM->getIM(), continuePlayback(int64_t), this, showContinueDialog(int64_t) );
+ CONNECT( THEMIM->getIM(), resumePlayback(int64_t), this, showResumePanel(int64_t) );
- w->layout()->addWidget( continueDialog );
+ w->layout()->addWidget( resumePanel );
}
-void MainInterface::showContinueDialog( int64_t _time ) {
+void MainInterface::showResumePanel( int64_t _time ) {
int setting = var_InheritInteger( p_intf, "qt-continue" );
if( setting == 0 )
return;
- i_continueTime = _time;
+ i_resumeTime = _time;
if( setting == 2)
- continuePlayback();
+ resumePlayback();
else
{
- continueDialog->setVisible(true);
- continueTimer->start();
+ resumePanel->setVisible(true);
+ resumeTimer->start();
}
}
-void MainInterface::hideContinueDialog()
+void MainInterface::hideResumePanel()
{
- if( continueDialog->isVisible() )
+ if( resumePanel->isVisible() )
{
if( !isFullScreen() && !isMaximized() )
- resize( width(), height() - continueDialog->height() );
- continueDialog->hide();
- continueTimer->stop();
+ resize( width(), height() - resumePanel->height() );
+ resumePanel->hide();
+ resumeTimer->stop();
}
}
-void MainInterface::continuePlayback()
+void MainInterface::resumePlayback()
{
- var_SetTime( THEMIM->getInput(), "time", i_continueTime );
- hideContinueDialog();
+ var_SetTime( THEMIM->getInput(), "time", i_resumeTime );
+ hideResumePanel();
}
void MainInterface::createMainWidget( QSettings *creationSettings )
@@ -450,7 +450,7 @@ void MainInterface::createMainWidget( QSettings *creationSettings )
main->setContentsMargins( 0, 0, 0, 0 );
mainLayout->setSpacing( 0 ); mainLayout->setMargin( 0 );
- createContinueDialog( main );
+ createResumePanel( main );
/* */
stackCentralW = new QVLCStackedWidget( main );
@@ -767,7 +767,7 @@ void MainInterface::releaseVideoSlot( void )
videoWidget->release();
setVideoOnTop( false );
setVideoFullScreen( false );
- hideContinueDialog();
+ hideResumePanel();
if( stackCentralW->currentWidget() == videoWidget )
restoreStackOldWidget();
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 02d5b10..8d59f65 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -112,7 +112,7 @@ private:
void createMainWidget( QSettings* );
void createStatusBar();
void createPlaylist();
- void createContinueDialog( QWidget *w );
+ void createResumePanel( QWidget *w );
/* Systray */
void createSystray();
@@ -148,10 +148,10 @@ private:
PlaylistWidget *playlistWidget;
//VisualSelector *visualSelector;
- /* continue */
- QWidget *continueDialog;
- QTimer *continueTimer;
- int64_t i_continueTime;
+ /* resume panel */
+ QWidget *resumePanel;
+ QTimer *resumeTimer;
+ int64_t i_resumeTime;
/* Status Bar */
QLabel *nameLabel;
@@ -261,9 +261,9 @@ private slots:
void setBoss();
void setRaise();
- void showContinueDialog( int64_t);
- void hideContinueDialog();
- void continuePlayback();
+ void showResumePanel( int64_t);
+ void hideResumePanel();
+ void resumePlayback();
signals:
void askGetVideo( WId *p_id, int *pi_x, int *pi_y,
More information about the vlc-commits
mailing list