2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2014-06-11 13:37:10 +02:00
|
|
|
*
|
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
|
2014-06-11 13:37:10 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2014-06-11 13:37:10 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-05-13 12:44:11 +02:00
|
|
|
#include "WelcomeViewStep.h"
|
2014-06-11 13:37:10 +02:00
|
|
|
|
2020-03-25 13:46:27 +01:00
|
|
|
#include "Config.h"
|
2015-05-13 12:44:11 +02:00
|
|
|
#include "WelcomePage.h"
|
2015-05-14 18:02:26 +02:00
|
|
|
|
2020-03-25 13:46:27 +01:00
|
|
|
#include "Branding.h"
|
|
|
|
#include "modulesystem/ModuleManager.h"
|
2019-02-25 12:11:14 +01:00
|
|
|
#include "utils/Logger.h"
|
2019-05-02 20:00:32 +02:00
|
|
|
#include "utils/Variant.h"
|
2014-06-27 13:58:53 +02:00
|
|
|
|
2019-08-13 22:29:01 +02:00
|
|
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeViewStepFactory, registerPlugin< WelcomeViewStep >(); )
|
2015-09-09 18:46:13 +02:00
|
|
|
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::WelcomeViewStep( QObject* parent )
|
2020-03-25 11:41:39 +01:00
|
|
|
: Calamares::ViewStep( parent )
|
|
|
|
, m_conf( new Config( this ) )
|
2020-05-12 14:54:18 +02:00
|
|
|
, m_widget( new WelcomePage( m_conf ) )
|
2014-06-11 13:37:10 +02:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
connect( Calamares::ModuleManager::instance(),
|
|
|
|
&Calamares::ModuleManager::requirementsComplete,
|
|
|
|
this,
|
|
|
|
&WelcomeViewStep::nextStatusChanged );
|
2020-04-02 23:04:23 +02:00
|
|
|
connect( m_conf, &Config::localeIndexChanged, m_widget, &WelcomePage::externallySelectedLanguage );
|
2020-03-10 22:44:48 +01:00
|
|
|
}
|
2014-06-27 18:00:27 +02:00
|
|
|
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::~WelcomeViewStep()
|
2014-06-27 18:00:27 +02:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
if ( m_widget && m_widget->parent() == nullptr )
|
|
|
|
{
|
|
|
|
m_widget->deleteLater();
|
|
|
|
}
|
2014-06-11 13:37:10 +02:00
|
|
|
}
|
2014-06-27 13:58:53 +02:00
|
|
|
|
|
|
|
QString
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::prettyName() const
|
2014-06-27 13:58:53 +02:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
return tr( "Welcome" );
|
2014-06-27 13:58:53 +02:00
|
|
|
}
|
2014-06-27 18:00:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
QWidget*
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::widget()
|
2014-06-27 18:00:27 +02:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
return m_widget;
|
2014-06-27 18:00:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::isNextEnabled() const
|
2014-06-27 18:00:27 +02:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
return m_widget->verdict();
|
2014-06-27 18:00:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-01-29 20:24:09 +01:00
|
|
|
bool
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::isBackEnabled() const
|
2015-01-29 20:24:09 +01:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
return false;
|
2015-01-29 20:24:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-27 18:00:27 +02:00
|
|
|
bool
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::isAtBeginning() const
|
2014-06-27 18:00:27 +02:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
return true;
|
2014-06-27 18:00:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::isAtEnd() const
|
2014-06-27 18:00:27 +02:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
return true;
|
2014-06-27 18:00:27 +02:00
|
|
|
}
|
|
|
|
|
2014-07-08 14:02:21 +02:00
|
|
|
|
2019-02-25 13:05:12 +01:00
|
|
|
Calamares::JobList
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::jobs() const
|
2014-07-08 14:02:21 +02:00
|
|
|
{
|
2020-03-25 11:41:39 +01:00
|
|
|
return Calamares::JobList();
|
2014-07-08 14:02:21 +02:00
|
|
|
}
|
|
|
|
|
2015-04-02 12:27:54 +02:00
|
|
|
|
|
|
|
void
|
2015-05-13 12:44:11 +02:00
|
|
|
WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
2015-04-02 12:27:54 +02:00
|
|
|
{
|
2020-05-06 15:08:31 +02:00
|
|
|
m_conf->setConfigurationMap( configurationMap );
|
2020-03-10 22:44:48 +01:00
|
|
|
|
2020-03-25 11:41:39 +01:00
|
|
|
//here init the qml or qwidgets needed bits
|
|
|
|
m_widget->init();
|
2015-04-02 12:27:54 +02:00
|
|
|
}
|
|
|
|
|
2019-05-10 13:53:44 +02:00
|
|
|
Calamares::RequirementsList
|
|
|
|
WelcomeViewStep::checkRequirements()
|
2017-12-02 17:25:26 +01:00
|
|
|
{
|
2021-08-26 16:39:55 +02:00
|
|
|
return m_conf->checkRequirements();
|
2017-12-02 17:25:26 +01:00
|
|
|
}
|