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