[libcalamaresui] Load QML on startup

This commit is contained in:
Adriaan de Groot 2019-06-02 13:19:16 +02:00
parent 5973dbf74c
commit ff03235e33
2 changed files with 9 additions and 2 deletions

View File

@ -69,6 +69,7 @@ ExecutionViewStep::ExecutionViewStep( QObject* parent )
innerLayout->addWidget( m_label ); innerLayout->addWidget( m_label );
cDebug() << "QML import paths:" << Logger::DebugList( m_qmlShow->engine()->importPathList() ); cDebug() << "QML import paths:" << Logger::DebugList( m_qmlShow->engine()->importPathList() );
loadQml();
connect( JobQueue::instance(), &JobQueue::progress, this, &ExecutionViewStep::updateFromJobQueue ); connect( JobQueue::instance(), &JobQueue::progress, this, &ExecutionViewStep::updateFromJobQueue );
@ -134,15 +135,20 @@ ExecutionViewStep::isAtEnd() const
return true; return true;
} }
void void
ExecutionViewStep::onActivate() ExecutionViewStep::loadQml()
{ {
if ( !m_qmlShowLoaded && !Calamares::Branding::instance()->slideshowPath().isEmpty() ) if ( !m_qmlShowLoaded && !Calamares::Branding::instance()->slideshowPath().isEmpty() )
{ {
m_qmlShow->setSource( QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ) ); m_qmlShow->setSource( QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ) );
m_qmlShowLoaded = true; m_qmlShowLoaded = true;
} }
}
void
ExecutionViewStep::onActivate()
{
loadQml();
JobQueue* queue = JobQueue::instance(); JobQueue* queue = JobQueue::instance();
foreach ( const QString& instanceKey, m_jobInstanceKeys ) foreach ( const QString& instanceKey, m_jobInstanceKeys )

View File

@ -65,6 +65,7 @@ private:
QStringList m_jobInstanceKeys; QStringList m_jobInstanceKeys;
void loadQml(); //< Loads the slideshow QML (from branding)
void updateFromJobQueue( qreal percent, const QString& message ); void updateFromJobQueue( qreal percent, const QString& message );
}; };