update: add dray trigger task.

This commit is contained in:
2025-06-18 14:53:56 +08:00
parent 5dcf638e62
commit a53657df30
14 changed files with 289 additions and 62 deletions

View File

@@ -2,14 +2,16 @@
#define TRANSFORM_H
#include <ClientCore.h>
#include <FileTrans.h>
#include <QDialog>
#include <QFile>
#include <FileTrans.h>
#include <QThread>
namespace Ui {
class TransForm;
}
class TranFromTh;
class TransForm : public QDialog
{
Q_OBJECT
@@ -21,18 +23,50 @@ public:
public:
void SetClientCore(ClientCore* clientCore);
void SetTasks(const QVector<TransTask>& tasks);
void startTask();
signals:
void sigProgress(double val);
void sigFailed();
void sigDone();
void sigSetUi(const TransTask& task);
private:
void startTask();
void setProgress(double val);
void handleFailed();
void handleDone();
void handleUI(const TransTask& task);
protected:
void showEvent(QShowEvent* event) override;
private:
TranFromTh* workTh_{};
QVector<TransTask> tasks_;
FileTrans* fileTrans_{};
ClientCore* clientCore_{};
Ui::TransForm* ui;
};
class TranFromTh : public QThread
{
Q_OBJECT
public:
explicit TranFromTh(TransForm* tf, QObject* parent = nullptr) : QThread(parent), tf_(tf)
{
}
protected:
void run() override
{
if (tf_) {
tf_->startTask();
}
}
private:
TransForm* tf_;
};
#endif // TRANSFORM_H