Skip to content

Commit

Permalink
[welcome] Update the results-list when a round of checks completes
Browse files Browse the repository at this point in the history
When the checks were done, the widget showing the countdown-timer
and results was not being informed, so it didn't update the
display of the countdown timer or hide the list of problems
(when there are none) so that the welcome image is shown.

FIXES calamares#1974
  • Loading branch information
adriaandegroot authored and abalfoort committed Jun 9, 2022
1 parent 4a85afb commit 7cefd89
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/modules/welcome/checker/CheckerContainer.cpp
Expand Up @@ -71,7 +71,11 @@ CheckerContainer::requirementsComplete( bool ok )
m_waitingWidget->deleteLater();
m_waitingWidget = nullptr; // Don't delete in destructor
}
if ( !m_checkerWidget )
if ( m_checkerWidget )
{
m_checkerWidget->requirementsComplete();
}
else
{
m_checkerWidget = new ResultsListWidget( m_config, this );
m_checkerWidget->setObjectName( "requirementsChecker" );
Expand Down
19 changes: 13 additions & 6 deletions src/modules/welcome/checker/ResultsListWidget.cpp
Expand Up @@ -67,18 +67,25 @@ ResultsListWidget::ResultsListWidget( Config* config, QWidget* parent )
}

void
ResultsListWidget::requirementsChanged()
ResultsListWidget::requirementsComplete()
{
// Check that all are satisfied (gives warnings if not) and
// all *mandatory* entries are satisfied (gives errors if not).

// Check that the satisfaction of the requirements:
// - if everything is satisfied, show the welcome image
// - otherwise, if all the mandatory ones are satisfied,
// we won't be re-checking (see ModuleManager::checkRequirements)
// so hide the countdown,
// - otherwise we have unsatisfied mandatory requirements,
// so keep the countdown and the list of problems.
const bool requirementsSatisfied = m_config->requirementsModel()->satisfiedRequirements();
const bool mandatoryRequirementsSatisfied = m_config->requirementsModel()->satisfiedMandatory();

if ( requirementsSatisfied )
if ( mandatoryRequirementsSatisfied )
{
m_countdown->stop();
m_countdown->hide();

}
if ( requirementsSatisfied )
{
delete m_centralWidget;
m_centralWidget = nullptr;

Expand Down
6 changes: 3 additions & 3 deletions src/modules/welcome/checker/ResultsListWidget.h
Expand Up @@ -26,10 +26,10 @@ class ResultsListWidget : public QWidget
public:
explicit ResultsListWidget( Config* config, QWidget* parent );

private:
/// @brief The model of requirements changed
void requirementsChanged();
/// @brief The model of requirements has finished a round of checking
void requirementsComplete();

private:
Config* m_config = nullptr;

// UI parts, which need updating when the model changes
Expand Down

0 comments on commit 7cefd89

Please sign in to comment.