calamares/src/modules/keyboard/KeyboardViewStep.cpp

116 lines
1.8 KiB
C++
Raw Normal View History

/* === This file is part of Calamares - <https://calamares.io> ===
*
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
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#include "KeyboardViewStep.h"
#include "Config.h"
#include "KeyboardPage.h"
#include "GlobalStorage.h"
#include "JobQueue.h"
CALAMARES_PLUGIN_FACTORY_DEFINITION( KeyboardViewStepFactory, registerPlugin< KeyboardViewStep >(); )
KeyboardViewStep::KeyboardViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_config( new Config(this) )
, m_widget( new KeyboardPage() )
, m_nextEnabled( false )
{
m_config->detectCurrentKeyboardLayout();
m_nextEnabled = true;
emit nextStatusChanged( m_nextEnabled );
}
KeyboardViewStep::~KeyboardViewStep()
{
if ( m_widget && m_widget->parent() == nullptr )
{
m_widget->deleteLater();
}
}
QString
KeyboardViewStep::prettyName() const
{
return tr( "Keyboard" );
}
2014-07-08 18:25:39 +02:00
QString
KeyboardViewStep::prettyStatus() const
{
return m_config->prettyStatus();
2014-07-08 18:25:39 +02:00
}
QWidget*
KeyboardViewStep::widget()
{
return m_widget;
}
bool
KeyboardViewStep::isNextEnabled() const
{
return m_nextEnabled;
}
bool
KeyboardViewStep::isBackEnabled() const
{
return true;
}
bool
KeyboardViewStep::isAtBeginning() const
{
return true;
}
bool
KeyboardViewStep::isAtEnd() const
{
return true;
}
QList< Calamares::job_ptr >
KeyboardViewStep::jobs() const
{
return m_config->createJobs();
}
2014-07-08 18:25:39 +02:00
2014-11-26 18:56:09 +01:00
void
KeyboardViewStep::onActivate()
{
m_widget->onActivate();
}
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
}
void
KeyboardViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{
m_config->setConfigurationMap(configurationMap);
}