Do ask for confirmation if quitting during install phase.
This commit is contained in:
parent
851f175ae7
commit
42316fe6dc
@ -76,13 +76,18 @@ ViewManager::ViewManager( QObject* parent )
|
|||||||
bottomLayout->addSpacing( 12 );
|
bottomLayout->addSpacing( 12 );
|
||||||
bottomLayout->addWidget( m_quit );
|
bottomLayout->addWidget( m_quit );
|
||||||
|
|
||||||
|
connect( m_next, &QPushButton::clicked, this, &ViewManager::next );
|
||||||
|
connect( m_back, &QPushButton::clicked, this, &ViewManager::back );
|
||||||
|
m_back->setEnabled( false );
|
||||||
|
|
||||||
|
m_installationViewStep = new InstallationViewStep( this );
|
||||||
|
|
||||||
connect( m_quit, &QPushButton::clicked,
|
connect( m_quit, &QPushButton::clicked,
|
||||||
this, [this]()
|
this, [this]()
|
||||||
{
|
{
|
||||||
if ( m_currentStep == m_steps.count() -1 &&
|
if ( m_steps.at( m_currentStep ) == m_installationViewStep ||
|
||||||
m_steps.last()->isAtEnd() )
|
!( m_currentStep == m_steps.count() -1 &&
|
||||||
qApp->quit();
|
m_steps.last()->isAtEnd() ) )
|
||||||
else
|
|
||||||
{
|
{
|
||||||
int response = QMessageBox::question( m_widget,
|
int response = QMessageBox::question( m_widget,
|
||||||
tr( "Cancel installation?" ),
|
tr( "Cancel installation?" ),
|
||||||
@ -93,12 +98,11 @@ ViewManager::ViewManager( QObject* parent )
|
|||||||
if ( response == QMessageBox::Yes )
|
if ( response == QMessageBox::Yes )
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
}
|
}
|
||||||
|
else //we're at the end
|
||||||
|
{
|
||||||
|
qApp->quit();
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
connect( m_next, &QPushButton::clicked, this, &ViewManager::next );
|
|
||||||
connect( m_back, &QPushButton::clicked, this, &ViewManager::back );
|
|
||||||
m_back->setEnabled( false );
|
|
||||||
|
|
||||||
m_installationViewStep = new InstallationViewStep( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user