2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2014-07-04 15:33:59 +02:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac <teo@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2014-07-04 15:33:59 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2014-07-04 15:33:59 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "KeyboardViewStep.h"
|
|
|
|
|
2020-10-12 16:30:06 +02:00
|
|
|
#include "Config.h"
|
2014-07-04 15:33:59 +02:00
|
|
|
#include "KeyboardPage.h"
|
|
|
|
|
2020-03-26 11:08:55 +01:00
|
|
|
#include "GlobalStorage.h"
|
|
|
|
#include "JobQueue.h"
|
|
|
|
|
|
|
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( KeyboardViewStepFactory, registerPlugin< KeyboardViewStep >(); )
|
2014-07-04 15:33:59 +02:00
|
|
|
|
|
|
|
KeyboardViewStep::KeyboardViewStep( QObject* parent )
|
|
|
|
: Calamares::ViewStep( parent )
|
2020-10-28 13:41:34 +01:00
|
|
|
, m_config( new Config( this ) )
|
2020-10-28 01:10:05 +01:00
|
|
|
, m_widget( new KeyboardPage( m_config ) )
|
2014-07-04 15:33:59 +02:00
|
|
|
{
|
2020-10-27 15:51:48 +01:00
|
|
|
m_config->detectCurrentKeyboardLayout();
|
2020-10-27 16:59:22 +01:00
|
|
|
emit nextStatusChanged( true );
|
2014-07-04 15:33:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KeyboardViewStep::~KeyboardViewStep()
|
|
|
|
{
|
|
|
|
if ( m_widget && m_widget->parent() == nullptr )
|
2020-03-26 11:08:55 +01:00
|
|
|
{
|
2014-07-04 15:33:59 +02:00
|
|
|
m_widget->deleteLater();
|
2020-03-26 11:08:55 +01:00
|
|
|
}
|
2014-07-04 15:33:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString
|
|
|
|
KeyboardViewStep::prettyName() const
|
|
|
|
{
|
|
|
|
return tr( "Keyboard" );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-08 18:25:39 +02:00
|
|
|
QString
|
|
|
|
KeyboardViewStep::prettyStatus() const
|
|
|
|
{
|
2020-10-27 15:53:59 +01:00
|
|
|
return m_config->prettyStatus();
|
2014-07-08 18:25:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-04 15:33:59 +02:00
|
|
|
QWidget*
|
|
|
|
KeyboardViewStep::widget()
|
|
|
|
{
|
|
|
|
return m_widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
KeyboardViewStep::isNextEnabled() const
|
|
|
|
{
|
2020-10-27 16:59:22 +01:00
|
|
|
return true;
|
2014-07-04 15:33:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-01-29 20:24:09 +01:00
|
|
|
bool
|
|
|
|
KeyboardViewStep::isBackEnabled() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-04 15:33:59 +02:00
|
|
|
bool
|
|
|
|
KeyboardViewStep::isAtBeginning() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
KeyboardViewStep::isAtEnd() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2014-07-08 14:02:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
QList< Calamares::job_ptr >
|
|
|
|
KeyboardViewStep::jobs() const
|
|
|
|
{
|
2020-10-12 16:30:06 +02:00
|
|
|
return m_config->createJobs();
|
2014-07-08 14:02:21 +02:00
|
|
|
}
|
2014-07-08 18:25:39 +02:00
|
|
|
|
|
|
|
|
2014-11-26 18:56:09 +01:00
|
|
|
void
|
|
|
|
KeyboardViewStep::onActivate()
|
|
|
|
{
|
2021-07-30 22:17:26 +02:00
|
|
|
m_config->guessLocaleKeyboardLayout();
|
2014-11-26 18:56:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-08 18:25:39 +02:00
|
|
|
void
|
|
|
|
KeyboardViewStep::onLeave()
|
|
|
|
{
|
2020-10-27 15:55:29 +01:00
|
|
|
m_config->finalize();
|
2014-07-08 18:25:39 +02:00
|
|
|
}
|
2014-11-11 02:58:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
KeyboardViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|
|
|
{
|
2020-10-28 13:41:34 +01:00
|
|
|
m_config->setConfigurationMap( configurationMap );
|
2014-11-11 02:58:14 +01:00
|
|
|
}
|