Commit 52aefe95 authored by Ludovic Fauvet's avatar Ludovic Fauvet Committed by Jean-Baptiste Kempf

Qt: better wording for the resume playback code

(cherry picked from commit 65e800488b3c875e653aafb20b769b99b0edf69b)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 114100ad
...@@ -136,7 +136,7 @@ void InputManager::setInput( input_thread_t *_p_input ) ...@@ -136,7 +136,7 @@ void InputManager::setInput( input_thread_t *_p_input )
!var_GetFloat( p_input, "start-time" ) && !var_GetFloat( p_input, "start-time" ) &&
!var_GetFloat( p_input, "stop-time" ) ) !var_GetFloat( p_input, "stop-time" ) )
{ {
emit continuePlayback( (int64_t)i_time * 1000 ); emit resumePlayback( (int64_t)i_time * 1000 );
} }
} }
} }
......
...@@ -223,8 +223,8 @@ signals: ...@@ -223,8 +223,8 @@ signals:
void titleChanged( bool ); void titleChanged( bool );
void chapterChanged( bool ); void chapterChanged( bool );
void inputCanSeek( bool ); void inputCanSeek( bool );
/// You can continuePlayback /// You can resume playback
void continuePlayback( int64_t ); void resumePlayback( int64_t );
/// Statistics are updated /// Statistics are updated
void statisticsUpdated( input_item_t* ); void statisticsUpdated( input_item_t* );
void infoChanged( input_item_t* ); void infoChanged( input_item_t* );
......
...@@ -368,13 +368,13 @@ void MainInterface::reloadPrefs() ...@@ -368,13 +368,13 @@ void MainInterface::reloadPrefs()
} }
} }
void MainInterface::createContinueDialog( QWidget *w ) void MainInterface::createResumePanel( QWidget *w )
{ {
/* Create non-modal continueDialog */ /* Create non-modal resumePanel */
continueDialog = new QWidget( w ); resumePanel = new QWidget( w );
continueDialog->hide(); resumePanel->hide();
QHBoxLayout *continueDialogLayout = new QHBoxLayout( continueDialog ); QHBoxLayout *resumePanelLayout = new QHBoxLayout( resumePanel );
continueDialogLayout->setSpacing( 0 ); continueDialogLayout->setMargin( 0 ); resumePanelLayout->setSpacing( 0 ); resumePanelLayout->setMargin( 0 );
QLabel *continuePixmapLabel = new QLabel(); QLabel *continuePixmapLabel = new QLabel();
continuePixmapLabel->setPixmap( QPixmap( ":/menu/help" ) ); continuePixmapLabel->setPixmap( QPixmap( ":/menu/help" ) );
...@@ -382,63 +382,63 @@ void MainInterface::createContinueDialog( QWidget *w ) ...@@ -382,63 +382,63 @@ void MainInterface::createContinueDialog( QWidget *w )
QLabel *continueLabel = new QLabel( qtr( "Do you want to restart the playback where left off?") ); 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->setAutoRaise( true );
cancel->setText( "X" ); cancel->setText( "X" );
QPushButton *ok = new QPushButton( qtr("&Continue") ); QPushButton *ok = new QPushButton( qtr("&Continue") );
continueDialogLayout->addWidget( continuePixmapLabel ); resumePanelLayout->addWidget( continuePixmapLabel );
continueDialogLayout->addWidget(continueLabel); resumePanelLayout->addWidget(continueLabel);
continueDialogLayout->addStretch( 1 ); resumePanelLayout->addStretch( 1 );
continueDialogLayout->addWidget( ok ); resumePanelLayout->addWidget( ok );
continueDialogLayout->addWidget( cancel ); resumePanelLayout->addWidget( cancel );
continueTimer = new QTimer( continueDialog ); resumeTimer = new QTimer( resumePanel );
continueTimer->setSingleShot( true ); resumeTimer->setSingleShot( true );
continueTimer->setInterval( 6000 ); resumeTimer->setInterval( 6000 );
CONNECT( continueTimer, timeout(), this, hideContinueDialog() ); CONNECT( resumeTimer, timeout(), this, hideResumePanel() );
CONNECT( cancel, clicked(), this, hideContinueDialog() ); CONNECT( cancel, clicked(), this, hideResumePanel() );
BUTTONACT(ok, continuePlayback() ); 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" ); int setting = var_InheritInteger( p_intf, "qt-continue" );
if( setting == 0 ) if( setting == 0 )
return; return;
i_continueTime = _time; i_resumeTime = _time;
if( setting == 2) if( setting == 2)
continuePlayback(); resumePlayback();
else else
{ {
continueDialog->setVisible(true); resumePanel->setVisible(true);
continueTimer->start(); resumeTimer->start();
} }
} }
void MainInterface::hideContinueDialog() void MainInterface::hideResumePanel()
{ {
if( continueDialog->isVisible() ) if( resumePanel->isVisible() )
{ {
if( !isFullScreen() && !isMaximized() ) if( !isFullScreen() && !isMaximized() )
resize( width(), height() - continueDialog->height() ); resize( width(), height() - resumePanel->height() );
continueDialog->hide(); resumePanel->hide();
continueTimer->stop(); resumeTimer->stop();
} }
} }
void MainInterface::continuePlayback() void MainInterface::resumePlayback()
{ {
var_SetTime( THEMIM->getInput(), "time", i_continueTime ); var_SetTime( THEMIM->getInput(), "time", i_resumeTime );
hideContinueDialog(); hideResumePanel();
} }
void MainInterface::createMainWidget( QSettings *creationSettings ) void MainInterface::createMainWidget( QSettings *creationSettings )
...@@ -450,7 +450,7 @@ void MainInterface::createMainWidget( QSettings *creationSettings ) ...@@ -450,7 +450,7 @@ void MainInterface::createMainWidget( QSettings *creationSettings )
main->setContentsMargins( 0, 0, 0, 0 ); main->setContentsMargins( 0, 0, 0, 0 );
mainLayout->setSpacing( 0 ); mainLayout->setMargin( 0 ); mainLayout->setSpacing( 0 ); mainLayout->setMargin( 0 );
createContinueDialog( main ); createResumePanel( main );
/* */ /* */
stackCentralW = new QVLCStackedWidget( main ); stackCentralW = new QVLCStackedWidget( main );
...@@ -767,7 +767,7 @@ void MainInterface::releaseVideoSlot( void ) ...@@ -767,7 +767,7 @@ void MainInterface::releaseVideoSlot( void )
videoWidget->release(); videoWidget->release();
setVideoOnTop( false ); setVideoOnTop( false );
setVideoFullScreen( false ); setVideoFullScreen( false );
hideContinueDialog(); hideResumePanel();
if( stackCentralW->currentWidget() == videoWidget ) if( stackCentralW->currentWidget() == videoWidget )
restoreStackOldWidget(); restoreStackOldWidget();
......
...@@ -112,7 +112,7 @@ private: ...@@ -112,7 +112,7 @@ private:
void createMainWidget( QSettings* ); void createMainWidget( QSettings* );
void createStatusBar(); void createStatusBar();
void createPlaylist(); void createPlaylist();
void createContinueDialog( QWidget *w ); void createResumePanel( QWidget *w );
/* Systray */ /* Systray */
void createSystray(); void createSystray();
...@@ -148,10 +148,10 @@ private: ...@@ -148,10 +148,10 @@ private:
PlaylistWidget *playlistWidget; PlaylistWidget *playlistWidget;
//VisualSelector *visualSelector; //VisualSelector *visualSelector;
/* continue */ /* resume panel */
QWidget *continueDialog; QWidget *resumePanel;
QTimer *continueTimer; QTimer *resumeTimer;
int64_t i_continueTime; int64_t i_resumeTime;
/* Status Bar */ /* Status Bar */
QLabel *nameLabel; QLabel *nameLabel;
...@@ -261,9 +261,9 @@ private slots: ...@@ -261,9 +261,9 @@ private slots:
void setBoss(); void setBoss();
void setRaise(); void setRaise();
void showContinueDialog( int64_t); void showResumePanel( int64_t);
void hideContinueDialog(); void hideResumePanel();
void continuePlayback(); void resumePlayback();
signals: signals:
void askGetVideo( WId *p_id, int *pi_x, int *pi_y, void askGetVideo( WId *p_id, int *pi_x, int *pi_y,
......
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