mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-06 03:55:27 +00:00
50 lines
902 B
C
50 lines
902 B
C
|
#ifndef R2TASKDIALOG_H
|
||
|
#define R2TASKDIALOG_H
|
||
|
|
||
|
#include <memory>
|
||
|
|
||
|
#include <QDialog>
|
||
|
#include <QTimer>
|
||
|
#include <QElapsedTimer>
|
||
|
|
||
|
#include "common/R2Task.h"
|
||
|
|
||
|
class R2Task;
|
||
|
namespace Ui {
|
||
|
class R2TaskDialog;
|
||
|
}
|
||
|
|
||
|
class R2TaskDialog : public QDialog
|
||
|
{
|
||
|
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
|