diff --git a/src/libcalamaresui/ExecutionViewStep.cpp b/src/libcalamaresui/ExecutionViewStep.cpp index fc6bd2b58..4ce9eb8ed 100644 --- a/src/libcalamaresui/ExecutionViewStep.cpp +++ b/src/libcalamaresui/ExecutionViewStep.cpp @@ -46,31 +46,36 @@ namespace Calamares ExecutionViewStep::ExecutionViewStep( QObject* parent ) : ViewStep( parent ) , m_widget( new QWidget ) + , m_progressBar( new QProgressBar ) + , m_label( new QLabel ) + , m_qmlShow( new QQuickWidget ) + , m_qmlShowLoaded( false ) { - m_progressBar = new QProgressBar; - m_progressBar->setMaximum( 10000 ); - m_label = new QLabel; QVBoxLayout* layout = new QVBoxLayout( m_widget ); QVBoxLayout* innerLayout = new QVBoxLayout; - m_qmlShow = new QQuickWidget; - layout->addWidget( m_qmlShow ); - CalamaresUtils::unmarginLayout( layout ); + m_progressBar->setMaximum( 10000 ); - layout->addLayout( innerLayout ); m_qmlShow->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_qmlShow->setResizeMode( QQuickWidget::SizeRootObjectToView ); - m_qmlShow->engine()->addImportPath( CalamaresUtils::qmlModulesDir().absolutePath() ); + layout->addWidget( m_qmlShow ); + CalamaresUtils::unmarginLayout( layout ); + layout->addLayout( innerLayout ); + innerLayout->addSpacing( CalamaresUtils::defaultFontHeight() / 2 ); innerLayout->addWidget( m_progressBar ); innerLayout->addWidget( m_label ); cDebug() << "QML import paths:" << Logger::DebugList( m_qmlShow->engine()->importPathList() ); - connect( JobQueue::instance(), &JobQueue::progress, - this, &ExecutionViewStep::updateFromJobQueue ); + connect( JobQueue::instance(), &JobQueue::progress, this, &ExecutionViewStep::updateFromJobQueue ); + + CALAMARES_RETRANSLATE_WIDGET( m_widget, + if ( m_qmlShowLoaded ) + m_qmlShow->setSource( QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ) ); + ) } @@ -133,11 +138,11 @@ ExecutionViewStep::isAtEnd() const void ExecutionViewStep::onActivate() { - CALAMARES_RETRANSLATE_WIDGET( m_widget, - if ( !Calamares::Branding::instance()->slideshowPath().isEmpty() ) - m_qmlShow->setSource( QUrl::fromLocalFile( Calamares::Branding::instance() - ->slideshowPath() ) ); - ) + if ( !m_qmlShowLoaded && !Calamares::Branding::instance()->slideshowPath().isEmpty() ) + { + m_qmlShow->setSource( QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ) ); + m_qmlShowLoaded = true; + } JobQueue* queue = JobQueue::instance(); foreach ( const QString& instanceKey, m_jobInstanceKeys ) diff --git a/src/libcalamaresui/ExecutionViewStep.h b/src/libcalamaresui/ExecutionViewStep.h index c6e2897c9..6d5b90705 100644 --- a/src/libcalamaresui/ExecutionViewStep.h +++ b/src/libcalamaresui/ExecutionViewStep.h @@ -61,6 +61,7 @@ private: QProgressBar* m_progressBar; QLabel* m_label; QQuickWidget* m_qmlShow; + bool m_qmlShowLoaded; QStringList m_jobInstanceKeys;