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 )
!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 );
}
}
}
......
......@@ -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* );
......
......@@ -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();
......
......@@ -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,
......
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