2020-03-24 15:47:53 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
|
|
|
*
|
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
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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
|
|
|
}
|