2019-11-20 08:50:07 +00:00
|
|
|
#ifndef R2TASKDIALOG_H
|
|
|
|
#define R2TASKDIALOG_H
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QElapsedTimer>
|
|
|
|
|
|
|
|
#include "common/R2Task.h"
|
2020-08-01 14:14:30 +00:00
|
|
|
#include "core/CutterCommon.h"
|
2019-11-20 08:50:07 +00:00
|
|
|
|
|
|
|
class R2Task;
|
|
|
|
namespace Ui {
|
|
|
|
class R2TaskDialog;
|
|
|
|
}
|
|
|
|
|
2020-08-01 14:14:30 +00:00
|
|
|
class CUTTER_EXPORT R2TaskDialog : public QDialog
|
2019-11-20 08:50:07 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
using Ptr = QSharedPointer<R2Task>;
|
|
|
|
R2TaskDialog(Ptr task, QWidget *parent = nullptr);
|
|
|
|
~R2TaskDialog();
|
|
|
|
|
|
|
|
void setBreakOnClose(bool v) { breakOnClose = v; }
|
|
|
|
bool getBreakOnClose() { return breakOnClose; }
|
|
|
|
void setDesc(const QString &label);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void reject() override;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateProgressTimer();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<Ui::R2TaskDialog> ui;
|
|
|
|
QSharedPointer<R2Task> task;
|
|
|
|
|
|
|
|
QTimer timer;
|
|
|
|
QElapsedTimer elapsedTimer;
|
|
|
|
|
|
|
|
bool breakOnClose = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //R2TASKDIALOG_H
|