FinishedPage: don't reboot on failure
If installation fails, and you end up on the last page, suppress the reboot-now checkbox. FIXES #605
This commit is contained in:
parent
da75035654
commit
72659dc6e1
@ -39,6 +39,7 @@ FinishedPage::FinishedPage( QWidget* parent )
|
|||||||
, ui( new Ui::FinishedPage )
|
, ui( new Ui::FinishedPage )
|
||||||
, m_restartSetUp( false )
|
, m_restartSetUp( false )
|
||||||
{
|
{
|
||||||
|
cDebug() << "FinishedPage()";
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
|
|
||||||
ui->mainText->setAlignment( Qt::AlignCenter );
|
ui->mainText->setAlignment( Qt::AlignCenter );
|
||||||
@ -83,6 +84,7 @@ FinishedPage::setRestartNowCommand( const QString& command )
|
|||||||
void
|
void
|
||||||
FinishedPage::setUpRestart()
|
FinishedPage::setUpRestart()
|
||||||
{
|
{
|
||||||
|
cDebug() << "FinishedPage::setUpRestart()";
|
||||||
if ( !m_restartSetUp )
|
if ( !m_restartSetUp )
|
||||||
{
|
{
|
||||||
connect( qApp, &QApplication::aboutToQuit,
|
connect( qApp, &QApplication::aboutToQuit,
|
||||||
@ -102,3 +104,14 @@ FinishedPage::focusInEvent( QFocusEvent* e )
|
|||||||
e->accept();
|
e->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
FinishedPage::onInstallationFailed( const QString& message, const QString& details )
|
||||||
|
{
|
||||||
|
ui->mainText->setText( tr( "<h1>Installation Failed</h1><br/>"
|
||||||
|
"%1 has not been installed on your computer.<br/>"
|
||||||
|
"The error message was: %2." )
|
||||||
|
.arg(Calamares::Branding::instance()->
|
||||||
|
string( Calamares::Branding::VersionedName ) )
|
||||||
|
.arg( details ) );
|
||||||
|
setRestartNowEnabled( false );
|
||||||
|
}
|
||||||
|
@ -38,6 +38,9 @@ public:
|
|||||||
|
|
||||||
void setUpRestart();
|
void setUpRestart();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void onInstallationFailed( const QString& message, const QString& details );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus
|
void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus
|
||||||
|
|
||||||
|
@ -17,8 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FinishedViewStep.h"
|
#include "FinishedViewStep.h"
|
||||||
|
|
||||||
#include "FinishedPage.h"
|
#include "FinishedPage.h"
|
||||||
|
#include "JobQueue.h"
|
||||||
|
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
@ -26,6 +28,11 @@ FinishedViewStep::FinishedViewStep( QObject* parent )
|
|||||||
: Calamares::ViewStep( parent )
|
: Calamares::ViewStep( parent )
|
||||||
, m_widget( new FinishedPage() )
|
, m_widget( new FinishedPage() )
|
||||||
{
|
{
|
||||||
|
cDebug() << "FinishedViewStep()";
|
||||||
|
|
||||||
|
connect( Calamares::JobQueue::instance(), &Calamares::JobQueue::failed,
|
||||||
|
m_widget, &FinishedPage::onInstallationFailed );
|
||||||
|
|
||||||
emit nextStatusChanged( true );
|
emit nextStatusChanged( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +54,7 @@ FinishedViewStep::prettyName() const
|
|||||||
QWidget*
|
QWidget*
|
||||||
FinishedViewStep::widget()
|
FinishedViewStep::widget()
|
||||||
{
|
{
|
||||||
|
cDebug() << "FinishedViewStep::widget()";
|
||||||
return m_widget;
|
return m_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,6 +102,7 @@ FinishedViewStep::isAtEnd() const
|
|||||||
void
|
void
|
||||||
FinishedViewStep::onActivate()
|
FinishedViewStep::onActivate()
|
||||||
{
|
{
|
||||||
|
cDebug() << "FinishedViewStep::onActivate()";
|
||||||
m_widget->setUpRestart();
|
m_widget->setUpRestart();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +110,7 @@ FinishedViewStep::onActivate()
|
|||||||
QList< Calamares::job_ptr >
|
QList< Calamares::job_ptr >
|
||||||
FinishedViewStep::jobs() const
|
FinishedViewStep::jobs() const
|
||||||
{
|
{
|
||||||
|
cDebug() << "FinishedViewStep::jobs";
|
||||||
return QList< Calamares::job_ptr >();
|
return QList< Calamares::job_ptr >();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user