2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2020-03-25 16:08:12 +01:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac <teo@kde.org>
|
|
|
|
* SPDX-FileCopyrightText: 2020 Camilo Higuita <milo.h@aol.com>
|
2020-10-25 18:35:03 +01:00
|
|
|
* SPDX-FileCopyrightText: 2020 Anke Boersma <demm@kaosx.us>
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2020-03-25 16:08:12 +01:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2020-03-25 16:08:12 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "KeyboardQmlViewStep.h"
|
|
|
|
|
2020-10-25 18:35:03 +01:00
|
|
|
#include "Config.h"
|
|
|
|
|
2020-03-25 16:08:12 +01:00
|
|
|
#include "GlobalStorage.h"
|
2020-03-26 15:57:02 +01:00
|
|
|
#include "JobQueue.h"
|
2020-03-25 16:08:12 +01:00
|
|
|
|
2020-03-26 15:57:02 +01:00
|
|
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( KeyboardQmlViewStepFactory, registerPlugin< KeyboardQmlViewStep >(); )
|
2020-03-25 16:08:12 +01:00
|
|
|
|
|
|
|
KeyboardQmlViewStep::KeyboardQmlViewStep( QObject* parent )
|
2020-03-26 15:57:02 +01:00
|
|
|
: Calamares::QmlViewStep( parent )
|
|
|
|
, m_config( new Config( this ) )
|
2020-03-25 16:08:12 +01:00
|
|
|
{
|
2020-10-27 15:48:51 +01:00
|
|
|
m_config->detectCurrentKeyboardLayout();
|
2020-10-27 16:55:02 +01:00
|
|
|
emit nextStatusChanged( true );
|
2020-03-25 16:08:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString
|
|
|
|
KeyboardQmlViewStep::prettyName() const
|
|
|
|
{
|
|
|
|
return tr( "Keyboard" );
|
|
|
|
}
|
|
|
|
|
|
|
|
QString
|
|
|
|
KeyboardQmlViewStep::prettyStatus() const
|
|
|
|
{
|
2020-10-27 15:42:27 +01:00
|
|
|
return m_config->prettyStatus();
|
2020-03-25 16:08:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
KeyboardQmlViewStep::isNextEnabled() const
|
|
|
|
{
|
2020-10-27 16:55:02 +01:00
|
|
|
return true;
|
2020-03-25 16:08:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
KeyboardQmlViewStep::isBackEnabled() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
KeyboardQmlViewStep::isAtBeginning() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
KeyboardQmlViewStep::isAtEnd() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Calamares::JobList
|
|
|
|
KeyboardQmlViewStep::jobs() const
|
|
|
|
{
|
2020-10-25 18:35:03 +01:00
|
|
|
return m_config->createJobs();
|
2020-03-25 16:08:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
KeyboardQmlViewStep::onActivate()
|
|
|
|
{
|
2021-07-30 22:17:26 +02:00
|
|
|
m_config->guessLocaleKeyboardLayout();
|
2020-03-25 16:08:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
KeyboardQmlViewStep::onLeave()
|
|
|
|
{
|
|
|
|
m_config->finalize();
|
|
|
|
}
|
|
|
|
|
2020-03-26 15:57:02 +01:00
|
|
|
QObject*
|
2020-03-25 16:08:12 +01:00
|
|
|
KeyboardQmlViewStep::getConfig()
|
|
|
|
{
|
|
|
|
return m_config;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
KeyboardQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|
|
|
{
|
2020-10-27 15:46:18 +01:00
|
|
|
m_config->setConfigurationMap( configurationMap );
|
2020-03-25 16:08:12 +01:00
|
|
|
Calamares::QmlViewStep::setConfigurationMap( configurationMap );
|
|
|
|
}
|