From d78bc0c5c536117f0b2b36339c3752854013add2 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 14 May 2019 13:04:24 +0200 Subject: [PATCH] [libcalamaresui] When disable-cancel is on, never confirm - This function is also reached by clicking the window-close decoration. --- src/libcalamaresui/ViewManager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 9da71f85f..49ecfb9ad 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -364,14 +364,19 @@ ViewManager::back() bool ViewManager::confirmCancelInstallation() { + const auto* const settings = Calamares::Settings::instance(); + + if ( settings->disableCancel() ) + return false; + // If it's NOT the last page of the last step, we ask for confirmation if ( !( m_currentStep == m_steps.count() -1 && m_steps.last()->isAtEnd() ) ) { - QString title = Calamares::Settings::instance()->isSetupMode() + QString title = settings->isSetupMode() ? tr( "Cancel setup?" ) : tr( "Cancel installation?" ); - QString question = Calamares::Settings::instance()->isSetupMode() + QString question = settings->isSetupMode() ? tr( "Do you really want to cancel the current setup process?\n" "The setup program will quit and all changes will be lost." ) : tr( "Do you really want to cancel the current install process?\n"