calamares/src/modules/welcome/WelcomeViewStep.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

106 lines
2.0 KiB
C++
Raw Normal View History

/* === This file is part of Calamares - <https://calamares.io> ===
*
2020-08-22 01:19:58 +02:00
* SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac <teo@kde.org>
* SPDX-FileCopyrightText: 2018 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#include "WelcomeViewStep.h"
#include "Config.h"
#include "WelcomePage.h"
#include "Branding.h"
#include "modulesystem/ModuleManager.h"
#include "utils/Logger.h"
2019-05-02 20:00:32 +02:00
#include "utils/Variant.h"
CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeViewStepFactory, registerPlugin< WelcomeViewStep >(); )
2015-09-09 18:46:13 +02:00
WelcomeViewStep::WelcomeViewStep( QObject* parent )
2020-03-25 11:41:39 +01:00
: Calamares::ViewStep( parent )
, m_conf( new Config( this ) )
, m_widget( new WelcomePage( m_conf ) )
{
2020-03-25 11:41:39 +01:00
connect( Calamares::ModuleManager::instance(),
&Calamares::ModuleManager::requirementsComplete,
this,
&WelcomeViewStep::nextStatusChanged );
connect( m_conf, &Config::localeIndexChanged, m_widget, &WelcomePage::externallySelectedLanguage );
}
WelcomeViewStep::~WelcomeViewStep()
{
2020-03-25 11:41:39 +01:00
if ( m_widget && m_widget->parent() == nullptr )
{
m_widget->deleteLater();
}
}
QString
WelcomeViewStep::prettyName() const
{
2020-03-25 11:41:39 +01:00
return tr( "Welcome" );
}
QWidget*
WelcomeViewStep::widget()
{
2020-03-25 11:41:39 +01:00
return m_widget;
}
bool
WelcomeViewStep::isNextEnabled() const
{
2020-03-25 11:41:39 +01:00
return m_widget->verdict();
}
bool
WelcomeViewStep::isBackEnabled() const
{
2020-03-25 11:41:39 +01:00
return false;
}
bool
WelcomeViewStep::isAtBeginning() const
{
2020-03-25 11:41:39 +01:00
return true;
}
bool
WelcomeViewStep::isAtEnd() const
{
2020-03-25 11:41:39 +01:00
return true;
}
2019-02-25 13:05:12 +01:00
Calamares::JobList
WelcomeViewStep::jobs() const
{
2020-03-25 11:41:39 +01:00
return Calamares::JobList();
}
void
WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{
m_conf->setConfigurationMap( configurationMap );
2020-03-25 11:41:39 +01:00
//here init the qml or qwidgets needed bits
m_widget->init();
}
Calamares::RequirementsList
WelcomeViewStep::checkRequirements()
{
return m_conf->checkRequirements();
}