From 92f4ab30ea7d411e834d1833dfe6eeefeb7adcac Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Feb 2022 12:51:25 +0100 Subject: [PATCH] [partition] Add a note and an icon about unusually-configured partition module --- src/modules/partition/PartitionViewStep.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index c87d1b314..f3d4fc8ac 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -242,6 +242,24 @@ PartitionViewStep::createSummaryWidget() const formLayout->setContentsMargins( MARGIN, 0, MARGIN, MARGIN ); mainLayout->addLayout( formLayout ); +#if defined( DEBUG_PARTITION_UNSAFE ) || defined( DEBUG_PARTITION_BAIL_OUT ) || defined( DEBUG_PARTITION_SKIP ) + auto specialRow = [ = ]( CalamaresUtils::ImageType t, const QString& s ) + { + QLabel* icon = new QLabel; + icon->setPixmap( CalamaresUtils::defaultPixmap( t ) ); + formLayout->addRow( icon, new QLabel( s ) ); + }; +#endif +#if defined( DEBUG_PARTITION_UNSAFE ) + specialRow( CalamaresUtils::ImageType::StatusWarning, tr( "Unsafe partition actions are enabled." ) ); +#endif +#if defined( DEBUG_PARTITION_BAIL_OUT ) + specialRow( CalamaresUtils::ImageType::Information, tr( "Partitioning is configured to always fail." ) ); +#endif +#if defined( DEBUG_PARTITION_SKIP ) + specialRow( CalamaresUtils::ImageType::Information, tr( "No partitions will be changed." ) ); +#endif + const QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo(); if ( list.length() > 1 ) // There are changes on more than one disk {