[welcome] Show progress during requirements checking

This commit is contained in:
Adriaan de Groot 2019-02-24 09:07:44 -05:00
parent b169281b69
commit c508e3ed4d
3 changed files with 10 additions and 1 deletions

View File

@ -48,6 +48,7 @@ WelcomePage::WelcomePage( QWidget* parent )
{ {
connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsResult, m_checkingWidget, &CheckerContainer::requirementsChecked ); connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsResult, m_checkingWidget, &CheckerContainer::requirementsChecked );
connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsComplete, m_checkingWidget, &CheckerContainer::requirementsComplete ); connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsComplete, m_checkingWidget, &CheckerContainer::requirementsComplete );
connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsProgress, m_checkingWidget, &CheckerContainer::requirementsProgress );
ui->setupUi( this ); ui->setupUi( this );
ui->verticalLayout->insertSpacing( 1, CalamaresUtils::defaultFontHeight() * 2 ); ui->verticalLayout->insertSpacing( 1, CalamaresUtils::defaultFontHeight() * 2 );

View File

@ -54,7 +54,7 @@ void CheckerContainer::requirementsComplete( bool ok )
m_checkerWidget->init( m_requirements ); m_checkerWidget->init( m_requirements );
layout()->removeWidget( m_waitingWidget ); layout()->removeWidget( m_waitingWidget );
m_waitingWidget->deleteLater(); m_waitingWidget->deleteLater();
m_waitingWidget = nullptr; // Don't delete in constructor m_waitingWidget = nullptr; // Don't delete in destructor
m_checkerWidget->setParent( this ); m_checkerWidget->setParent( this );
layout()->addWidget( m_checkerWidget ); layout()->addWidget( m_checkerWidget );
@ -66,6 +66,12 @@ void CheckerContainer::requirementsChecked(const Calamares::RequirementsList& l)
m_requirements.append( l ); m_requirements.append( l );
} }
void CheckerContainer::requirementsProgress(const QString& message)
{
if ( m_waitingWidget )
m_waitingWidget->setText( message );
}
bool CheckerContainer::verdict() const bool CheckerContainer::verdict() const
{ {
return m_verdict; return m_verdict;

View File

@ -51,6 +51,8 @@ public slots:
/** @brief All the requirements are complete, switch to list view */ /** @brief All the requirements are complete, switch to list view */
void requirementsComplete( bool ); void requirementsComplete( bool );
void requirementsProgress( const QString& message );
protected: protected:
WaitingWidget *m_waitingWidget; WaitingWidget *m_waitingWidget;
CheckerWidget *m_checkerWidget; CheckerWidget *m_checkerWidget;