@ -367,15 +367,17 @@ bool ViewManager::confirmCancelInstallation()
{
{
const auto * const settings = Calamares : : Settings : : instance ( ) ;
const auto * const settings = Calamares : : Settings : : instance ( ) ;
// When we're at the very end, then it's always OK to exit.
if ( m_currentStep = = m_steps . count ( ) - 1 & & m_steps . last ( ) - > isAtEnd ( ) )
return true ;
// Not at the very end, cancel/quit might be disabled
if ( settings - > disableCancel ( ) )
if ( settings - > disableCancel ( ) )
return false ;
return false ;
if ( settings - > disableCancelDuringExec ( ) & & stepIsExecute ( m_steps , m_currentStep ) )
if ( settings - > disableCancelDuringExec ( ) & & stepIsExecute ( m_steps , m_currentStep ) )
return false ;
return false ;
// If it's NOT the last page of the last step, we ask for confirmation
// Otherwise, confirm cancel/quit.
if ( ! ( m_currentStep = = m_steps . count ( ) - 1 & &
m_steps . last ( ) - > isAtEnd ( ) ) )
{
QString title = settings - > isSetupMode ( )
QString title = settings - > isSetupMode ( )
? tr ( " Cancel setup? " )
? tr ( " Cancel setup? " )
: tr ( " Cancel installation? " ) ;
: tr ( " Cancel installation? " ) ;
@ -395,9 +397,6 @@ bool ViewManager::confirmCancelInstallation()
int response = mb . exec ( ) ;
int response = mb . exec ( ) ;
return response = = QMessageBox : : Yes ;
return response = = QMessageBox : : Yes ;
}
}
else // Means we're at the end, no need to confirm.
return true ;
}
void
void
ViewManager : : updateCancelEnabled ( bool enabled )
ViewManager : : updateCancelEnabled ( bool enabled )