mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-25 16:38:21 -04:00
Abort installation when a job fails
This commit is contained in:
parent
7894bb9462
commit
165d28fc23
4 changed files with 45 additions and 4 deletions
|
@ -46,7 +46,12 @@ public:
|
|||
for( auto job : m_jobs )
|
||||
{
|
||||
emitProgress( current, total, job->prettyName() );
|
||||
job->exec();
|
||||
JobResult result = job->exec();
|
||||
if ( !result )
|
||||
{
|
||||
emitFailed( result.message(), result.details() );
|
||||
return;
|
||||
}
|
||||
++current;
|
||||
}
|
||||
emitProgress( total, total, QString() );
|
||||
|
@ -64,6 +69,14 @@ private:
|
|||
Q_ARG( QString, prettyName )
|
||||
);
|
||||
}
|
||||
|
||||
void emitFailed( const QString& message, const QString& details )
|
||||
{
|
||||
QMetaObject::invokeMethod( m_queue, "failed", Qt::QueuedConnection,
|
||||
Q_ARG( QString, message ),
|
||||
Q_ARG( QString, details )
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue