2022-05-17 14:40:36 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2016 Luca Giambonini <almack@chakraos.org>
|
|
|
|
* SPDX-FileCopyrightText: 2016 Lisa Vitolo <shainer@chakraos.org>
|
|
|
|
* SPDX-FileCopyrightText: 2017 Kyle Robbertze <krobbertze@gmail.com>
|
|
|
|
* SPDX-FileCopyrightText: 2017-2018 2020, Adriaan de Groot <groot@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2016-06-26 00:26:08 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2016-06-26 00:26:08 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "NetInstallViewStep.h"
|
|
|
|
|
|
|
|
#include "NetInstallPage.h"
|
|
|
|
|
2020-02-18 11:02:53 +01:00
|
|
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( NetInstallViewStepFactory, registerPlugin< NetInstallViewStep >(); )
|
2016-06-26 00:26:08 +02:00
|
|
|
|
|
|
|
NetInstallViewStep::NetInstallViewStep( QObject* parent )
|
|
|
|
: Calamares::ViewStep( parent )
|
2020-03-27 16:12:48 +01:00
|
|
|
, m_widget( new NetInstallPage( &m_config ) )
|
2020-03-27 15:51:03 +01:00
|
|
|
, m_nextEnabled( false )
|
2016-06-26 00:26:08 +02:00
|
|
|
{
|
2020-03-27 16:12:48 +01:00
|
|
|
connect( &m_config, &Config::statusReady, this, &NetInstallViewStep::nextIsReady );
|
2016-06-26 00:26:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NetInstallViewStep::~NetInstallViewStep()
|
|
|
|
{
|
|
|
|
if ( m_widget && m_widget->parent() == nullptr )
|
2020-02-18 11:02:53 +01:00
|
|
|
{
|
2016-06-26 00:26:08 +02:00
|
|
|
m_widget->deleteLater();
|
2020-02-18 11:02:53 +01:00
|
|
|
}
|
2016-06-26 00:26:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString
|
|
|
|
NetInstallViewStep::prettyName() const
|
|
|
|
{
|
2021-02-08 22:57:38 +01:00
|
|
|
return m_config.sidebarLabel();
|
2020-02-19 14:37:47 +01:00
|
|
|
|
2020-03-23 14:10:48 +01:00
|
|
|
#if defined( TABLE_OF_TRANSLATIONS )
|
2020-10-25 12:48:12 +01:00
|
|
|
__builtin_unreachable();
|
2020-02-19 14:37:47 +01:00
|
|
|
// This is a table of "standard" labels for this module. If you use them
|
|
|
|
// in the label: sidebar: section of the config file, the existing
|
|
|
|
// translations can be used.
|
2021-02-09 10:58:11 +01:00
|
|
|
//
|
|
|
|
// These translations still live here, even though the lookup
|
|
|
|
// code is in the Config class.
|
2020-02-19 14:37:47 +01:00
|
|
|
tr( "Package selection" );
|
|
|
|
tr( "Office software" );
|
|
|
|
tr( "Office package" );
|
|
|
|
tr( "Browser software" );
|
|
|
|
tr( "Browser package" );
|
|
|
|
tr( "Web browser" );
|
2022-05-23 15:41:45 +02:00
|
|
|
tr( "Kernel", "label for netinstall module, Linux kernel" );
|
|
|
|
tr( "Services", "label for netinstall module, system services" );
|
|
|
|
tr( "Login", "label for netinstall module, choose login manager" );
|
|
|
|
tr( "Desktop", "label for netinstall module, choose desktop environment" );
|
2020-02-19 17:21:12 +01:00
|
|
|
tr( "Applications" );
|
2022-05-23 15:41:45 +02:00
|
|
|
tr( "Communication", "label for netinstall module" );
|
|
|
|
tr( "Development", "label for netinstall module" );
|
|
|
|
tr( "Office", "label for netinstall module" );
|
|
|
|
tr( "Multimedia", "label for netinstall module" );
|
|
|
|
tr( "Internet", "label for netinstall module" );
|
|
|
|
tr( "Theming", "label for netinstall module" );
|
|
|
|
tr( "Gaming", "label for netinstall module" );
|
|
|
|
tr( "Utilities", "label for netinstall module" );
|
2020-02-19 17:21:12 +01:00
|
|
|
#endif
|
2016-06-26 00:26:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QWidget*
|
|
|
|
NetInstallViewStep::widget()
|
|
|
|
{
|
|
|
|
return m_widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
NetInstallViewStep::isNextEnabled() const
|
|
|
|
{
|
2020-03-27 16:12:48 +01:00
|
|
|
return !m_config.required() || m_nextEnabled;
|
2016-06-26 00:26:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
NetInstallViewStep::isBackEnabled() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
NetInstallViewStep::isAtBeginning() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
NetInstallViewStep::isAtEnd() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-03-27 15:14:37 +01:00
|
|
|
Calamares::JobList
|
2016-06-26 00:26:08 +02:00
|
|
|
NetInstallViewStep::jobs() const
|
|
|
|
{
|
2020-03-27 15:14:37 +01:00
|
|
|
return Calamares::JobList();
|
2016-06-26 00:26:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
NetInstallViewStep::onActivate()
|
|
|
|
{
|
|
|
|
m_widget->onActivate();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
NetInstallViewStep::onLeave()
|
|
|
|
{
|
2021-03-16 14:47:12 +01:00
|
|
|
m_config.finalizeGlobalStorage( moduleInstanceKey() );
|
2016-06-26 00:26:08 +02:00
|
|
|
}
|
|
|
|
|
2020-02-18 17:59:34 +01:00
|
|
|
void
|
2020-03-27 16:12:48 +01:00
|
|
|
NetInstallViewStep::nextIsReady()
|
2020-02-18 17:59:34 +01:00
|
|
|
{
|
2020-03-27 16:12:48 +01:00
|
|
|
m_nextEnabled = true;
|
|
|
|
emit nextStatusChanged( true );
|
2020-02-18 17:59:34 +01:00
|
|
|
}
|
2016-06-26 00:26:08 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
NetInstallViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|
|
|
{
|
2021-02-08 22:57:38 +01:00
|
|
|
m_config.setConfigurationMap( configurationMap );
|
2017-11-06 11:14:42 +01:00
|
|
|
}
|