mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-04 04:45:36 -04:00
113 lines
2.2 KiB
C++
113 lines
2.2 KiB
C++
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
*
|
|
* SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac <teo@kde.org>
|
|
* SPDX-FileCopyrightText: 2017 2019, Adriaan de Groot <groot@kde.org>
|
|
* SPDX-FileCopyrightText: 2019 Collabora Ltd <arnaud.ferraris@collabora.com>
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*
|
|
* Calamares is Free Software: see the License-Identifier above.
|
|
*
|
|
*/
|
|
|
|
#include "FinishedViewStep.h"
|
|
|
|
#include "Config.h"
|
|
#include "FinishedPage.h"
|
|
|
|
#include "JobQueue.h"
|
|
|
|
#include <QApplication>
|
|
|
|
FinishedViewStep::FinishedViewStep( QObject* parent )
|
|
: Calamares::ViewStep( parent )
|
|
, m_config( new Config( this ) )
|
|
, m_widget( new FinishedPage( m_config ) )
|
|
, m_installFailed( false )
|
|
{
|
|
auto jq = Calamares::JobQueue::instance();
|
|
connect( jq, &Calamares::JobQueue::failed, this, &FinishedViewStep::onInstallationFailed );
|
|
|
|
emit nextStatusChanged( true );
|
|
}
|
|
|
|
|
|
FinishedViewStep::~FinishedViewStep()
|
|
{
|
|
if ( m_widget && m_widget->parent() == nullptr )
|
|
{
|
|
m_widget->deleteLater();
|
|
}
|
|
}
|
|
|
|
|
|
QString
|
|
FinishedViewStep::prettyName() const
|
|
{
|
|
return tr( "Finish" );
|
|
}
|
|
|
|
|
|
QWidget*
|
|
FinishedViewStep::widget()
|
|
{
|
|
return m_widget;
|
|
}
|
|
|
|
|
|
bool
|
|
FinishedViewStep::isNextEnabled() const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
|
|
bool
|
|
FinishedViewStep::isBackEnabled() const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
|
|
bool
|
|
FinishedViewStep::isAtBeginning() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
|
|
bool
|
|
FinishedViewStep::isAtEnd() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
|
|
void
|
|
FinishedViewStep::onActivate()
|
|
{
|
|
m_config->doNotify( m_installFailed );
|
|
connect( qApp, &QApplication::aboutToQuit, m_config, &Config::doRestart );
|
|
}
|
|
|
|
|
|
Calamares::JobList
|
|
FinishedViewStep::jobs() const
|
|
{
|
|
return Calamares::JobList();
|
|
}
|
|
|
|
void
|
|
FinishedViewStep::onInstallationFailed( const QString& message, const QString& details )
|
|
{
|
|
m_installFailed = true;
|
|
m_config->setRestartNowMode( Config::RestartMode::Never );
|
|
m_widget->onInstallationFailed( message, details );
|
|
}
|
|
|
|
void
|
|
FinishedViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|
{
|
|
m_config->setConfigurationMap( configurationMap );
|
|
}
|
|
|
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( FinishedViewStepFactory, registerPlugin< FinishedViewStep >(); )
|