add: basic req trans.

This commit is contained in:
2025-06-18 13:18:31 +08:00
parent 280721f29b
commit 5dcf638e62
7 changed files with 121 additions and 12 deletions

View File

@@ -33,7 +33,6 @@ void FileManager::SetModeStr(const QString& modeStr, int type, ClientCore* clien
remotePtr->registerPathCall([this](const QString& path) { ShowPath(path); });
remotePtr->registerFileCall([this](const DirFileInfoVec& info) { ShowFile(info); });
remotePtr->setClientCore(clientCore);
fileTrans_ = new FileTrans(clientCore);
fileHelper_ = remotePtr;
}
}

View File

@@ -6,7 +6,6 @@
#include <QWidget>
#include <Util.h>
#include <QMenu>
#include <FileTrans.h>
namespace Ui {
class FileManager;
@@ -39,7 +38,6 @@ private:
Ui::FileManager* ui;
QString curRoot_;
QMenu* menu_;
FileTrans* fileTrans_;
std::shared_ptr<DirFileHelper> fileHelper_;
};

View File

@@ -1,4 +1,5 @@
#include "Transform.h"
#include <QMessageBox>
#include "ui_Transform.h"
@@ -16,4 +17,23 @@ TransForm::~TransForm()
void TransForm::SetClientCore(ClientCore* clientCore)
{
clientCore_ = clientCore;
fileTrans_ = new FileTrans(clientCore_);
}
void TransForm::SetTasks(const QVector<TransTask>& tasks)
{
tasks_ = tasks;
}
void TransForm::startTask()
{
for (auto& task : tasks_) {
}
}
void TransForm::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
startTask();
}

View File

@@ -4,6 +4,7 @@
#include <ClientCore.h>
#include <QDialog>
#include <QFile>
#include <FileTrans.h>
namespace Ui {
class TransForm;
@@ -19,9 +20,18 @@ public:
public:
void SetClientCore(ClientCore* clientCore);
void SetTasks(const QVector<TransTask>& tasks);
private:
ClientCore* clientCore_;
void startTask();
protected:
void showEvent(QShowEvent* event) override;
private:
QVector<TransTask> tasks_;
FileTrans* fileTrans_{};
ClientCore* clientCore_{};
Ui::TransForm* ui;
};