Files
frelay/Gui/Control/FileControl.h

55 lines
1.1 KiB
C
Raw Normal View History

2025-06-17 17:20:54 +08:00
#ifndef FILECONTROL_H
2025-06-15 14:31:54 +08:00
#define FILECONTROL_H
#include <ClientCore.h>
#include <FileTrans.h>
2025-06-15 14:31:54 +08:00
#include <InfoDirFile.h>
#include <QWidget>
#include <Util.h>
#include <QMutex>
2025-06-17 17:20:54 +08:00
#include <QMenu>
2025-06-15 14:31:54 +08:00
namespace Ui {
class FileManager;
}
class FileManager : public QWidget
{
Q_OBJECT
public:
explicit FileManager(QWidget* parent = nullptr);
~FileManager();
public:
2025-06-20 16:00:18 +08:00
QString GetRoot();
2025-06-15 14:31:54 +08:00
void SetModeStr(const QString& modeStr, int type = 0, ClientCore* clientCore = nullptr);
signals:
void sigSendTasks(const QVector<TransTask>& tasks);
2025-06-15 14:31:54 +08:00
private:
void InitControl();
2025-06-17 17:20:54 +08:00
void InitMenu(bool remote = false);
2025-06-15 14:31:54 +08:00
void ShowPath(const QString& path);
void ShowFile(const DirFileInfoVec& info);
void doubleClick(int row, int column);
2025-06-20 16:00:18 +08:00
void SetRoot(const QString& path);
2025-06-15 14:31:54 +08:00
private:
void evtHome();
void evtFile();
void evtUp();
private:
2025-06-20 16:00:18 +08:00
bool isRemote_;
2025-06-15 14:31:54 +08:00
Ui::FileManager* ui;
2025-06-18 10:36:19 +08:00
QMenu* menu_;
2025-06-18 14:53:56 +08:00
ClientCore* cliCore_;
QMutex cbMut_;
QMutex tbMut_;
2025-06-15 14:31:54 +08:00
std::shared_ptr<DirFileHelper> fileHelper_;
};
#endif // FILECONTROL_H