calamares/src/libcalamaresui/viewpages/PythonQtJob.h

54 lines
1.2 KiB
C
Raw Normal View History

/* === This file is part of Calamares - <https://calamares.io> ===
2016-10-27 15:12:47 +02:00
*
* SPDX-FileCopyrightText: 2016 Teo Mrnjavac <teo@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
2016-10-27 15:12:47 +02:00
*
* Calamares is Free Software: see the License-Identifier above.
2016-10-27 15:12:47 +02:00
*
*/
#ifndef PYTHONQTJOB_H
#define PYTHONQTJOB_H
#include "Job.h"
#include <PythonQt.h>
namespace Calamares
{
class PythonQtViewStep;
}
class PythonQtJobResult : public QObject, public Calamares::JobResult
{
Q_OBJECT
public:
explicit PythonQtJobResult( bool ok, const QString& message, const QString& details )
2016-10-27 15:12:47 +02:00
: QObject( nullptr )
, Calamares::JobResult( message, details, ok ? 0 : Calamares::JobResult::GenericError )
{
}
2016-10-27 15:12:47 +02:00
};
class PythonQtJob : public Calamares::Job
{
Q_OBJECT
public:
virtual ~PythonQtJob() {}
2016-10-27 15:12:47 +02:00
QString prettyName() const override;
QString prettyDescription() const override;
QString prettyStatusMessage() const override;
Calamares::JobResult exec() override;
private:
explicit PythonQtJob( PythonQtObjectPtr cxt, PythonQtObjectPtr pyJob, QObject* parent = nullptr );
friend class Calamares::PythonQtViewStep; // only this one can call the ctor
2016-10-27 15:12:47 +02:00
PythonQtObjectPtr m_cxt;
PythonQtObjectPtr m_pyJob;
};
#endif // PYTHONQTJOB_H