From dc255e161ee7f8348e89e66f3a9f1b6446cf91ab Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 22 Dec 2017 16:20:35 +0100 Subject: [PATCH 01/10] [partition] Rename slots, to avoid recursion --- src/modules/partition/jobs/PartitionJob.cpp | 2 +- src/modules/partition/jobs/PartitionJob.h | 2 +- src/modules/partition/jobs/ResizePartitionJob.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/partition/jobs/PartitionJob.cpp b/src/modules/partition/jobs/PartitionJob.cpp index 00498ae35..1da8b0ba0 100644 --- a/src/modules/partition/jobs/PartitionJob.cpp +++ b/src/modules/partition/jobs/PartitionJob.cpp @@ -22,7 +22,7 @@ PartitionJob::PartitionJob( Partition* partition ) : m_partition( partition ) {} -void PartitionJob::progress(int percent) +void PartitionJob::iprogress(int percent) { if ( percent < 0 ) percent = 0; diff --git a/src/modules/partition/jobs/PartitionJob.h b/src/modules/partition/jobs/PartitionJob.h index 8bfe0e956..61245203c 100644 --- a/src/modules/partition/jobs/PartitionJob.h +++ b/src/modules/partition/jobs/PartitionJob.h @@ -43,7 +43,7 @@ public slots: * KPMCore presents progress as an integer percent from 0 .. 100, * while Calamares uses a qreal from 0 .. 1.00 . */ - void progress( int percent ); + void iprogress( int percent ); protected: Partition* m_partition; diff --git a/src/modules/partition/jobs/ResizePartitionJob.cpp b/src/modules/partition/jobs/ResizePartitionJob.cpp index 63af68cc1..c0477cafe 100644 --- a/src/modules/partition/jobs/ResizePartitionJob.cpp +++ b/src/modules/partition/jobs/ResizePartitionJob.cpp @@ -80,7 +80,7 @@ ResizePartitionJob::exec() m_partition->setLastSector( m_oldLastSector ); ResizeOperation op(*m_device, *m_partition, m_newFirstSector, m_newLastSector); op.setStatus(Operation::StatusRunning); - connect(&op, &Operation::progress, this, &ResizePartitionJob::progress ); + connect(&op, &Operation::progress, this, &ResizePartitionJob::iprogress ); QString errorMessage = tr( "The installer failed to resize partition %1 on disk '%2'." ) .arg( m_partition->partitionPath() ) From 2e1f3899978bd0f434cccc14903173a275b7bb47 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 24 Dec 2017 16:08:48 -0500 Subject: [PATCH 02/10] CMake: explain which modules are skipped Modules may be skipped for different reasons: SKIP_MODULES is the traditional approach to suppress some, but other modules may have unmet build requirements (e.g. Plasma Look-and-Feel, or the Partitioning module) and should be able to opt-out of being built. For all those skipped, log it explicitly after all the modules have been examined. Only CMake-based (e.g. C++) modules support opting-out in this way. --- .../CalamaresAddModuleSubdirectory.cmake | 12 ++++++++++++ src/modules/CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/CMakeModules/CalamaresAddModuleSubdirectory.cmake b/CMakeModules/CalamaresAddModuleSubdirectory.cmake index caf1b707e..12aad380f 100644 --- a/CMakeModules/CalamaresAddModuleSubdirectory.cmake +++ b/CMakeModules/CalamaresAddModuleSubdirectory.cmake @@ -3,15 +3,27 @@ include( CalamaresAddTranslations ) set( MODULE_DATA_DESTINATION share/calamares/modules ) +# Convenience function to indicate that a module has been skipped +# (optionally also why). Call this in the module's CMakeLists.txt +macro( calamares_skip_module ) + set( SKIPPED_MODULES ${SKIPPED_MODULES} ${ARGV} PARENT_SCOPE ) +endmacro() + function( calamares_add_module_subdirectory ) set( SUBDIRECTORY ${ARGV0} ) + set( SKIPPED_MODULES ) set( MODULE_CONFIG_FILES "" ) # If this subdirectory has a CMakeLists.txt, we add_subdirectory it... if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/CMakeLists.txt" ) add_subdirectory( ${SUBDIRECTORY} ) file( GLOB MODULE_CONFIG_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY} "${SUBDIRECTORY}/*.conf" ) + # Module has indicated it should be skipped, show that in + # the calling CMakeLists (which is src/modules/CMakeLists.txt normally). + if ( SKIPPED_MODULES ) + set( SKIPPED_MODULES ${SKIPPED_MODULES} PARENT_SCOPE ) + endif() # ...otherwise, we look for a module.desc. elseif( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/module.desc" ) set( MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/calamares/modules ) diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index d48ecd29f..dceaef8dd 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -1,5 +1,11 @@ include( CMakeColors ) +# The variable SKIP_MODULES can be set to skip particular modules; +# individual modules can also decide they must be skipped (e.g. OS-specific +# modules, or ones with unmet dependencies). Collect the skipped modules +# in this list. +set( LIST_SKIPPED_MODULES "" ) + if( BUILD_TESTING ) add_executable( test_conf test_conf.cpp ) target_link_libraries( test_conf ${YAMLCPP_LIBRARY} ) @@ -13,11 +19,24 @@ foreach( SUBDIRECTORY ${SUBDIRECTORIES} ) if( NOT DO_SKIP EQUAL -1 ) message( "${ColorReset}-- Skipping module ${BoldRed}${SUBDIRECTORY}${ColorReset}." ) message( "" ) + list( APPEND LIST_SKIPPED_MODULES "${SUBDIRECTORY} (user request)" ) elseif( ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}" ) AND ( DO_SKIP EQUAL -1 ) ) + set( SKIPPED_MODULES ) calamares_add_module_subdirectory( ${SUBDIRECTORY} ) + if ( SKIPPED_MODULES ) + list( APPEND LIST_SKIPPED_MODULES "${SKIPPED_MODULES}" ) + endif() endif() endforeach() +if ( LIST_SKIPPED_MODULES ) + message( "${ColorReset}-- Skipped modules:" ) + foreach( SUBDIRECTORY ${LIST_SKIPPED_MODULES} ) + message( "${ColorReset}-- Skipped ${BoldRed}${SUBDIRECTORY}${ColorReset}." ) + endforeach() + message( "" ) +endif() + include( CalamaresAddTranslations ) add_calamares_python_translations( ${CALAMARES_TRANSLATION_LANGUAGES} ) From 661789825a8de9a644b58996652d54eebc9f10c1 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 23 Dec 2017 10:07:42 -0500 Subject: [PATCH 03/10] [plasmalnf] Make the module optional - Check for presence of KDE Frameworks for Plasma & Package - Explain when module is skipped --- src/modules/plasmalnf/CMakeLists.txt | 55 +++++++++++++++++++--------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/src/modules/plasmalnf/CMakeLists.txt b/src/modules/plasmalnf/CMakeLists.txt index 8148a80e9..15897f98c 100644 --- a/src/modules/plasmalnf/CMakeLists.txt +++ b/src/modules/plasmalnf/CMakeLists.txt @@ -1,22 +1,41 @@ find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) -find_package( KF5 5.29 REQUIRED CoreAddons Plasma Package ) +# Requires a sufficiently recent Plasma framework, but also +# needs a runtime support component (which we don't test for). +set( lnf_ver 5.41 ) -calamares_add_plugin( plasmalnf - TYPE viewmodule - EXPORT_MACRO PLUGINDLLEXPORT_PRO - SOURCES - PlasmaLnfViewStep.cpp - PlasmaLnfPage.cpp - PlasmaLnfJob.cpp - ThemeWidget.cpp - RESOURCES - page_plasmalnf.qrc - UI - page_plasmalnf.ui - LINK_PRIVATE_LIBRARIES - calamaresui - KF5::Package - KF5::Plasma - SHARED_LIB +find_package( KF5Plasma ${lnf_ver} ) +find_package( KF5Package ${lnf_ver} ) +set_package_properties( + KF5Plasma PROPERTIES + PURPOSE "For Plasma Look-and-Feel selection" ) +set_package_properties( + KF5Package PROPERTIES + PURPOSE "For Plasma Look-and-Feel selection" +) + +if ( KF5Plasma_FOUND AND KF5Package_FOUND ) + find_package( KF5 ${lnf_ver} REQUIRED CoreAddons Plasma Package ) + + calamares_add_plugin( plasmalnf + TYPE viewmodule + EXPORT_MACRO PLUGINDLLEXPORT_PRO + SOURCES + PlasmaLnfViewStep.cpp + PlasmaLnfPage.cpp + PlasmaLnfJob.cpp + ThemeWidget.cpp + RESOURCES + page_plasmalnf.qrc + UI + page_plasmalnf.ui + LINK_PRIVATE_LIBRARIES + calamaresui + KF5::Package + KF5::Plasma + SHARED_LIB + ) +else() + calamares_skip_module( "plasmalnf (missing requirements)" ) +endif() From 1cffa9fafc5e77486980d257d082488dab49abeb Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 25 Dec 2017 15:48:55 -0500 Subject: [PATCH 04/10] [partition] Rename slots, to avoid recursion - see also https://github.com/calamares/calamares/issues/880 - missed within https://github.com/calamares/calamares/commit/7ce52ecda72c18194ba3449588358a788b5710e6 --- src/modules/partition/jobs/SetPartitionFlagsJob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/partition/jobs/SetPartitionFlagsJob.cpp b/src/modules/partition/jobs/SetPartitionFlagsJob.cpp index 750afcba3..7f6169bbe 100644 --- a/src/modules/partition/jobs/SetPartitionFlagsJob.cpp +++ b/src/modules/partition/jobs/SetPartitionFlagsJob.cpp @@ -135,7 +135,7 @@ SetPartFlagsJob::exec() Report report ( nullptr ); SetPartFlagsOperation op( *m_device, *partition(), m_flags ); op.setStatus( Operation::StatusRunning ); - connect( &op, &Operation::progress, this, &SetPartFlagsJob::progress ); + connect( &op, &Operation::progress, this, &SetPartFlagsJob::iprogress ); QString errorMessage = tr( "The installer failed to set flags on partition %1." ) .arg( m_partition->partitionPath() ); From 2027a5538e2e16f6d942c57154ed337de8ac4889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Wed, 27 Dec 2017 12:26:40 +0000 Subject: [PATCH 05/10] Fix propagation of new partition table to global storage. --- src/modules/partition/jobs/CreatePartitionJob.cpp | 3 --- src/modules/partition/jobs/CreatePartitionTableJob.cpp | 3 +-- src/modules/partition/jobs/FormatPartitionJob.cpp | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/modules/partition/jobs/CreatePartitionJob.cpp b/src/modules/partition/jobs/CreatePartitionJob.cpp index 3b16df2fc..4e91a00bf 100644 --- a/src/modules/partition/jobs/CreatePartitionJob.cpp +++ b/src/modules/partition/jobs/CreatePartitionJob.cpp @@ -32,9 +32,6 @@ #include #include -// Qt -#include - CreatePartitionJob::CreatePartitionJob( Device* device, Partition* partition ) : PartitionJob( partition ) , m_device( device ) diff --git a/src/modules/partition/jobs/CreatePartitionTableJob.cpp b/src/modules/partition/jobs/CreatePartitionTableJob.cpp index e2f2ec7a9..3937beb5d 100644 --- a/src/modules/partition/jobs/CreatePartitionTableJob.cpp +++ b/src/modules/partition/jobs/CreatePartitionTableJob.cpp @@ -31,7 +31,6 @@ #include // Qt -#include #include CreatePartitionTableJob::CreatePartitionTableJob( Device* device, PartitionTable::TableType type ) @@ -72,7 +71,7 @@ CreatePartitionTableJob::exec() Report report( nullptr ); QString message = tr( "The installer failed to create a partition table on %1." ).arg( m_device->name() ); - PartitionTable* table( createTable() ); + PartitionTable* table = m_device->partitionTable(); cDebug() << "Creating new partition table of type" << table->typeName() << ", uncommitted yet:\n" << table; diff --git a/src/modules/partition/jobs/FormatPartitionJob.cpp b/src/modules/partition/jobs/FormatPartitionJob.cpp index 76b806390..5e68502bd 100644 --- a/src/modules/partition/jobs/FormatPartitionJob.cpp +++ b/src/modules/partition/jobs/FormatPartitionJob.cpp @@ -29,10 +29,6 @@ #include #include -// Qt -#include -#include - FormatPartitionJob::FormatPartitionJob( Device* device, Partition* partition ) : PartitionJob( partition ) , m_device( device ) From 5a8302469843b9cb98e82006700a9f78095a28e5 Mon Sep 17 00:00:00 2001 From: Philip Date: Sat, 30 Dec 2017 02:48:00 -0500 Subject: [PATCH 06/10] [initcpiocfg] add 'lvm2' hook as needed --- src/modules/initcpiocfg/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index a18cd0c4f..f716cec5d 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -100,6 +100,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point): cpu = cpuinfo() swap_uuid = "" btrfs = "" + lvm2 = "" hooks = ["base", "udev", "autodetect", "modconf", "block", "keyboard", "keymap"] modules = [] @@ -122,6 +123,9 @@ def modify_mkinitcpio_conf(partitions, root_mount_point): if partition["fs"] == "btrfs": btrfs = "yes" + if partition["fs"] == "lvm2 pv": + lvm2 = "yes" + if partition["mountPoint"] == "/" and "luksMapperName" in partition: encrypt_hook = True @@ -137,6 +141,9 @@ def modify_mkinitcpio_conf(partitions, root_mount_point): ): files.append("/crypto_keyfile.bin") + if lvm2: + hooks.append("lvm2") + if swap_uuid != "": if encrypt_hook and openswap_hook: hooks.extend(["openswap"]) From be650d79869fe3cec10afd91608b5b5f1a379365 Mon Sep 17 00:00:00 2001 From: Philip Date: Sat, 30 Dec 2017 02:57:52 -0500 Subject: [PATCH 07/10] [initcpiocfg] search just for 'lvm2' in partition[fs] --- src/modules/initcpiocfg/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index f716cec5d..83736b5fe 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -123,7 +123,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point): if partition["fs"] == "btrfs": btrfs = "yes" - if partition["fs"] == "lvm2 pv": + if "lvm2" in partition["fs"]: lvm2 = "yes" if partition["mountPoint"] == "/" and "luksMapperName" in partition: From 5593be125fecc7c99f32265b8f20e0a0ba27b0bf Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 2 Jan 2018 13:58:29 +0100 Subject: [PATCH 08/10] [calamares] Reduce font-related debug output on startup. --- src/calamares/CalamaresApplication.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/calamares/CalamaresApplication.cpp b/src/calamares/CalamaresApplication.cpp index 6389a2806..f1062e942 100644 --- a/src/calamares/CalamaresApplication.cpp +++ b/src/calamares/CalamaresApplication.cpp @@ -55,14 +55,7 @@ CalamaresApplication::CalamaresApplication( int& argc, char* argv[] ) QFont f = font(); - cDebug() << "Default font =====" - << "\nPixel size: " << f.pixelSize() - << "\nPoint size: " << f.pointSize() - << "\nPoint sizeF: " << f.pointSizeF() - << "\nFont family: " << f.family() - << "\nMetric height:" << QFontMetrics( f ).height(); - // The following line blocks for 15s on Qt 5.1.0 - cDebug() << "Font height:" << QFontMetrics( f ).height(); + cDebug() << "Default font size" << f.pointSize() << ';' << f.pixelSize() << "px"; CalamaresUtils::setDefaultFontSize( f.pointSize() ); cDebug() << "Available languages:" << QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' ); From 41e6f0e06cd8fa4c8f8032880daea744eb113ba1 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 2 Jan 2018 13:59:38 +0100 Subject: [PATCH 09/10] [calamares] Allow WM close button - remove hide-close-button hack - refactor code in viewmanager for confirming quit - hook up confirm-and-quit to WM close button - also works for alt-F4 and other quit methods - while here, update copyright year FIXES #870 --- src/calamares/CalamaresWindow.cpp | 25 ++++++++++----- src/calamares/CalamaresWindow.h | 9 ++++-- src/libcalamaresui/ViewManager.cpp | 50 +++++++++++++++--------------- src/libcalamaresui/ViewManager.h | 9 +++++- 4 files changed, 58 insertions(+), 35 deletions(-) diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index ab24b6db2..df5274598 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017, Adriaan de Groot + * Copyright 2017-2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -37,10 +38,8 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) : QWidget( parent ) , m_debugWindow( nullptr ) + , m_viewManager( nullptr ) { - // Hide close button - setWindowFlags( Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint ); - CALAMARES_RETRANSLATE( setWindowTitle( tr( "%1 Installer" ) .arg( *Calamares::Branding::ProductName ) ); @@ -139,10 +138,10 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) CalamaresUtils::unmarginLayout( sideLayout ); CalamaresUtils::unmarginLayout( mainLayout ); - Calamares::ViewManager* vm = Calamares::ViewManager::instance( this ); - connect( vm, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge ); + m_viewManager = Calamares::ViewManager::instance( this ); + connect( m_viewManager, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge ); - mainLayout->addWidget( vm->centralWidget() ); + mainLayout->addWidget( m_viewManager->centralWidget() ); } void @@ -156,3 +155,15 @@ CalamaresWindow::enlarge( QSize enlarge ) resize( w, h ); } + +void +CalamaresWindow::closeEvent( QCloseEvent* event ) +{ + if ( ( !m_viewManager ) || m_viewManager->confirmCancelInstallation() ) + { + event->accept(); + qApp->quit(); + } + else + event->ignore(); +} diff --git a/src/calamares/CalamaresWindow.h b/src/calamares/CalamaresWindow.h index 00f790f5a..92b6da834 100644 --- a/src/calamares/CalamaresWindow.h +++ b/src/calamares/CalamaresWindow.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017, Adriaan de Groot + * Copyright 2017-2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ namespace Calamares { class DebugWindow; +class ViewManager; } /** @@ -46,8 +47,12 @@ public slots: */ void enlarge( QSize enlarge ); +protected: + virtual void closeEvent( QCloseEvent* e ) override; + private: - QPointer< Calamares::DebugWindow > m_debugWindow; + QPointer< Calamares::DebugWindow > m_debugWindow; // Managed by self + Calamares::ViewManager* m_viewManager; }; #endif //CALAMARESWINDOW_H diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 7b5df155b..7b5921f6b 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017, Adriaan de Groot + * Copyright 2017-2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,30 +88,8 @@ ViewManager::ViewManager( QObject* parent ) connect( m_back, &QPushButton::clicked, this, &ViewManager::back ); m_back->setEnabled( false ); - connect( m_quit, &QPushButton::clicked, - this, [this]() - { - // 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() ) ) - { - QMessageBox mb( QMessageBox::Question, - tr( "Cancel installation?" ), - tr( "Do you really want to cancel the current install process?\n" - "The installer will quit and all changes will be lost." ), - QMessageBox::Yes | QMessageBox::No, - m_widget ); - mb.setDefaultButton( QMessageBox::No ); - mb.button( QMessageBox::Yes )->setText( tr( "&Yes" ) ); - mb.button( QMessageBox::No )->setText( tr( "&No" ) ); - int response = mb.exec(); - if ( response == QMessageBox::Yes ) - qApp->quit(); - } - else // Means we're at the end, no need to confirm. - qApp->quit(); - } ); - + connect( m_quit, &QPushButton::clicked, this, + [this]() { if ( this->confirmCancelInstallation() ) qApp->quit(); } ); connect( JobQueue::instance(), &JobQueue::failed, this, &ViewManager::onInstallationFailed ); connect( JobQueue::instance(), &JobQueue::finished, @@ -302,4 +280,26 @@ ViewManager::back() } } +bool ViewManager::confirmCancelInstallation() +{ + // 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() ) ) + { + QMessageBox mb( QMessageBox::Question, + tr( "Cancel installation?" ), + tr( "Do you really want to cancel the current install process?\n" + "The installer will quit and all changes will be lost." ), + QMessageBox::Yes | QMessageBox::No, + m_widget ); + mb.setDefaultButton( QMessageBox::No ); + mb.button( QMessageBox::Yes )->setText( tr( "&Yes" ) ); + mb.button( QMessageBox::No )->setText( tr( "&No" ) ); + int response = mb.exec(); + return response == QMessageBox::Yes; + } + else // Means we're at the end, no need to confirm. + return true; } + +} // namespace diff --git a/src/libcalamaresui/ViewManager.h b/src/libcalamaresui/ViewManager.h index 38ddda70a..fe56509c0 100644 --- a/src/libcalamaresui/ViewManager.h +++ b/src/libcalamaresui/ViewManager.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017, Adriaan de Groot + * Copyright 2017-2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,6 +86,13 @@ public: */ int currentStepIndex() const; + /** + * @ brief Called when "Cancel" is clicked; asks for confirmation. + * Other means of closing Calamares also call this method, e.g. alt-F4. + * At the end of installation, no confirmation is asked. Returns true + * if the user confirms closing the window. + */ + bool confirmCancelInstallation(); public slots: /** From b3f0932ff9772d482308366c197326a236efb81b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 2 Jan 2018 15:37:36 +0100 Subject: [PATCH 10/10] CMake: bump version number --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a43d3205..5da78c5b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,7 +176,7 @@ set( CALAMARES_TRANSLATION_LANGUAGES ar ast bg ca cs_CZ da de el en en_GB es_MX ### Bump version here set( CALAMARES_VERSION_MAJOR 3 ) set( CALAMARES_VERSION_MINOR 1 ) -set( CALAMARES_VERSION_PATCH 11 ) +set( CALAMARES_VERSION_PATCH 12 ) set( CALAMARES_VERSION_RC 0 ) set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )