2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2020-03-24 15:47:53 +01:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac <teo@kde.org>
|
|
|
|
* SPDX-FileCopyrightText: 20182020 Adriaan de Groot <groot@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2020-03-24 15:47:53 +01:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2020-03-24 15:47:53 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LocaleQmlViewStep.h"
|
|
|
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
|
|
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( LocaleQmlViewStepFactory, registerPlugin< LocaleQmlViewStep >(); )
|
|
|
|
|
|
|
|
LocaleQmlViewStep::LocaleQmlViewStep( QObject* parent )
|
2020-07-23 11:11:18 +02:00
|
|
|
: Calamares::QmlViewStep( parent )
|
|
|
|
, m_config( std::make_unique< Config >( this ) )
|
2020-03-24 15:47:53 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QObject*
|
|
|
|
LocaleQmlViewStep::getConfig()
|
|
|
|
{
|
2020-07-23 11:11:18 +02:00
|
|
|
return m_config.get();
|
2020-03-24 15:47:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString
|
|
|
|
LocaleQmlViewStep::prettyName() const
|
|
|
|
{
|
|
|
|
return tr( "Location" );
|
|
|
|
}
|
|
|
|
|
2020-07-24 11:10:56 +02:00
|
|
|
QString
|
|
|
|
LocaleQmlViewStep::prettyStatus() const
|
|
|
|
{
|
2020-07-24 11:53:32 +02:00
|
|
|
return m_config->prettyStatus();
|
2020-07-24 11:10:56 +02:00
|
|
|
}
|
|
|
|
|
2020-03-24 15:47:53 +01:00
|
|
|
bool
|
|
|
|
LocaleQmlViewStep::isNextEnabled() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
LocaleQmlViewStep::isBackEnabled() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
LocaleQmlViewStep::isAtBeginning() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
LocaleQmlViewStep::isAtEnd() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Calamares::JobList
|
|
|
|
LocaleQmlViewStep::jobs() const
|
|
|
|
{
|
2020-07-23 11:11:18 +02:00
|
|
|
return m_config->createJobs();
|
2020-03-24 15:47:53 +01:00
|
|
|
}
|
|
|
|
|
2020-08-06 15:49:55 +02:00
|
|
|
void
|
|
|
|
LocaleQmlViewStep::onActivate()
|
|
|
|
{
|
|
|
|
m_config->setCurrentLocation(); // Finalize the location
|
|
|
|
QmlViewStep::onActivate();
|
|
|
|
}
|
|
|
|
|
2020-08-06 18:32:51 +02:00
|
|
|
void
|
|
|
|
LocaleQmlViewStep::onLeave()
|
|
|
|
{
|
|
|
|
m_config->finalizeGlobalStorage();
|
|
|
|
}
|
|
|
|
|
2020-07-23 11:11:18 +02:00
|
|
|
void
|
|
|
|
LocaleQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
2020-03-24 15:47:53 +01:00
|
|
|
{
|
2020-07-23 11:11:18 +02:00
|
|
|
m_config->setConfigurationMap( configurationMap );
|
2020-08-06 15:49:55 +02:00
|
|
|
QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
|
2020-03-24 15:47:53 +01:00
|
|
|
}
|