From 075185547a067b6daaf41b8e830ed093eeeea32a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 15 Apr 2022 12:47:12 +0200 Subject: [PATCH] [welcome] Display a countdown while (re)checking requirements --- src/modules/welcome/checker/ResultsListWidget.cpp | 11 ++++++++++- src/modules/welcome/checker/ResultsListWidget.h | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/modules/welcome/checker/ResultsListWidget.cpp b/src/modules/welcome/checker/ResultsListWidget.cpp index eb0c624c8..4c802acfc 100644 --- a/src/modules/welcome/checker/ResultsListWidget.cpp +++ b/src/modules/welcome/checker/ResultsListWidget.cpp @@ -18,6 +18,7 @@ #include "utils/Logger.h" #include "utils/Retranslator.h" #include "widgets/FixedAspectRatioLabel.h" +#include "widgets/WaitingWidget.h" #include #include @@ -169,12 +170,18 @@ ResultsListWidget::ResultsListWidget( Config* config, QWidget* parent ) spacerLayout->addSpacing( paddingSize ); CalamaresUtils::unmarginLayout( spacerLayout ); + QHBoxLayout* explanationLayout = new QHBoxLayout; m_explanation = new QLabel( m_config->warningMessage() ); m_explanation->setWordWrap( true ); m_explanation->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); m_explanation->setOpenExternalLinks( false ); m_explanation->setObjectName( "resultsExplanation" ); - m_entriesLayout->addWidget( m_explanation ); + explanationLayout->addWidget( m_explanation ); + m_countdown = new CountdownWaitingWidget; + explanationLayout->addWidget( m_countdown ); + m_countdown->start(); + + m_entriesLayout->addLayout( explanationLayout ); m_entriesLayout->insertSpacing( 1, CalamaresUtils::defaultFontHeight() / 2 ); m_mainLayout->addStretch(); @@ -258,6 +265,8 @@ ResultsListWidget::requirementsChanged() } else { + m_countdown->stop(); + m_countdown->hide(); if ( !Calamares::Branding::instance()->imagePath( Calamares::Branding::ProductWelcome ).isEmpty() ) { QPixmap theImage diff --git a/src/modules/welcome/checker/ResultsListWidget.h b/src/modules/welcome/checker/ResultsListWidget.h index f4f23293b..ca47b3a13 100644 --- a/src/modules/welcome/checker/ResultsListWidget.h +++ b/src/modules/welcome/checker/ResultsListWidget.h @@ -17,8 +17,11 @@ #include +class CountdownWaitingWidget; + class QBoxLayout; class QLabel; + class ResultsListWidget : public QWidget { Q_OBJECT @@ -56,6 +59,7 @@ private: // UI parts, which need updating when the model changes QLabel* m_explanation = nullptr; + CountdownWaitingWidget* m_countdown = nullptr; QBoxLayout* m_mainLayout = nullptr; QBoxLayout* m_entriesLayout = nullptr; int m_requirementsSeen = 0;