From 851f175ae75e0cdd7cd18ae4bb4b726c5ab8568d Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Mon, 29 Jun 2015 10:00:47 +0200 Subject: [PATCH] Only load QML when the install page is activated. --- src/libcalamaresui/InstallationViewStep.cpp | 30 +++++++++++++++------ src/libcalamaresui/InstallationViewStep.h | 2 ++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/libcalamaresui/InstallationViewStep.cpp b/src/libcalamaresui/InstallationViewStep.cpp index df4e12418..9c9570bf0 100644 --- a/src/libcalamaresui/InstallationViewStep.cpp +++ b/src/libcalamaresui/InstallationViewStep.cpp @@ -33,6 +33,7 @@ #include #include + namespace Calamares { @@ -56,27 +57,21 @@ InstallationViewStep::InstallationViewStep( QObject* parent ) m_slideShow->engine()->addImportPath( CalamaresUtils::qmlModulesDir().absolutePath() ); - CALAMARES_RETRANSLATE_WIDGET( m_widget, - if ( !Calamares::Branding::instance()->slideshowPath().isEmpty() ) - m_slideShow->setSource( QUrl::fromLocalFile( Calamares::Branding::instance() - ->slideshowPath() ) ); - ) innerLayout->addSpacing( CalamaresUtils::defaultFontHeight() / 2 ); innerLayout->addWidget( m_progressBar ); innerLayout->addWidget( m_label ); - connect( JobQueue::instance(), &JobQueue::progress, - this, &InstallationViewStep::updateFromJobQueue ); - cDebug() << "QML import paths:" << m_slideShow->engine()->importPathList(); } + QString InstallationViewStep::prettyName() const { return tr( "Install" ); } + QWidget* InstallationViewStep::widget() { @@ -89,11 +84,13 @@ InstallationViewStep::next() { } + void InstallationViewStep::back() { } + bool InstallationViewStep::isNextEnabled() const { @@ -114,18 +111,35 @@ InstallationViewStep::isAtBeginning() const return true; } + bool InstallationViewStep::isAtEnd() const { return true; } + +void +InstallationViewStep::onActivate() +{ + CALAMARES_RETRANSLATE_WIDGET( m_widget, + if ( !Calamares::Branding::instance()->slideshowPath().isEmpty() ) + m_slideShow->setSource( QUrl::fromLocalFile( Calamares::Branding::instance() + ->slideshowPath() ) ); + ) + + connect( JobQueue::instance(), &JobQueue::progress, + this, &InstallationViewStep::updateFromJobQueue ); +} + + QList< Calamares::job_ptr > InstallationViewStep::jobs() const { return QList< Calamares::job_ptr >(); } + void InstallationViewStep::updateFromJobQueue( qreal percent, const QString& message ) { diff --git a/src/libcalamaresui/InstallationViewStep.h b/src/libcalamaresui/InstallationViewStep.h index 7a434a640..f4c8daf2c 100644 --- a/src/libcalamaresui/InstallationViewStep.h +++ b/src/libcalamaresui/InstallationViewStep.h @@ -48,6 +48,8 @@ public: bool isAtBeginning() const override; bool isAtEnd() const override; + void onActivate() override; + QList< Calamares::job_ptr > jobs() const override; private: