ready: trans file ready code.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "Transform.h"
|
||||
#include "Transform.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "ui_Transform.h"
|
||||
@@ -13,31 +13,6 @@ TransForm::~TransForm()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TransForm::SetTasks(const QVector<TransTask>& tasks)
|
||||
{
|
||||
tasks_ = tasks;
|
||||
}
|
||||
|
||||
void TransForm::StartExecTask()
|
||||
{
|
||||
for (const auto& task : tasks_) {
|
||||
InfoMsg infoReq;
|
||||
if (task.isUpload) {
|
||||
if (!clientCore_->Send<InfoMsg>(infoReq, FBT_CLI_REQ_SEND, task.remoteId)) {
|
||||
QMessageBox::information(this, tr("Error"), tr("Send info request failed."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TransForm::StopExecTask()
|
||||
{
|
||||
}
|
||||
|
||||
void TransForm::SetClientCore(ClientCore* clientCore)
|
||||
{
|
||||
clientCore_ = clientCore;
|
||||
|
||||
@@ -1,28 +1,14 @@
|
||||
#ifndef TRANSFORM_H
|
||||
#ifndef TRANSFORM_H
|
||||
#define TRANSFORM_H
|
||||
|
||||
#include <ClientCore.h>
|
||||
#include <QDialog>
|
||||
#include <QFile>
|
||||
|
||||
namespace Ui {
|
||||
class TransForm;
|
||||
}
|
||||
|
||||
struct TransTask {
|
||||
bool isUpload{false};
|
||||
QString localId;
|
||||
QString localPath;
|
||||
QString remoteId;
|
||||
QString remotePath;
|
||||
};
|
||||
|
||||
enum class TaskState {
|
||||
STATE_READY = 0,
|
||||
STATE_RUNNING,
|
||||
STATE_FAILED,
|
||||
STATE_FINISH,
|
||||
};
|
||||
|
||||
class TransForm : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -33,15 +19,8 @@ public:
|
||||
|
||||
public:
|
||||
void SetClientCore(ClientCore* clientCore);
|
||||
void SetTasks(const QVector<TransTask>& tasks);
|
||||
|
||||
private:
|
||||
void StartExecTask();
|
||||
void StopExecTask();
|
||||
|
||||
private:
|
||||
TaskState curState_{TaskState::STATE_READY};
|
||||
QVector<TransTask> tasks_;
|
||||
ClientCore* clientCore_;
|
||||
Ui::TransForm* ui;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user