玉兔远程控制 0.1.0-bate5
载入中...
搜索中...
未找到
FrmFileTransfer.h
1// Copyright Copyright (c) Kang Lin studio, All Rights Reserved
2// Author: Kang Lin <kl222@126.com>
3
4#pragma once
5
6#include <QMap>
7#include <QWidget>
8#include <QFileSystemModel>
9#include "ListFileModel.h"
10#include "RemoteFileSystemModel.h"
11
12namespace Ui {
14}
15
16class CFrmFileTransfer : public QWidget
17{
18 Q_OBJECT
19
20public:
21 explicit CFrmFileTransfer(QWidget *parent = nullptr);
22 virtual ~CFrmFileTransfer();
23
24 virtual int Load(QSettings &set);
25 virtual int Save(QSettings &set);
26
27Q_SIGNALS:
28 void sigUpload(const QString& source, const QString& destination);
29 void sigCopyUrlToClipboard(const QString& szPath);
30
31 void sigGetDir(CRemoteFileSystem* pRfs);
32 void sigGetDir(CRemoteFileSystem* pRfs,
33 QVector<QSharedPointer<CRemoteFileSystem> > contents,
34 bool bEnd);
35
36 void sigMakeDir(const QString &szPath);
37 void sigRemoveDir(const QString &szPath);
38 void sigRemoveFile(const QString& szFile);
39 void sigRename(const QString& oldName, const QString& newName);
40
41 void sigStartFileTransfer(QSharedPointer<CFileTransfer> f);
42 void sigStopFileTransfer(QSharedPointer<CFileTransfer> f);
43
44private:
46 int SetLocalRoot(const QString &root);
48 [[nodiscard]] QString GetLocalRoot() const;
49 void SetRemoteConnect(CRemoteFileSystemModel* pRfs);
50
57 int EnumLocalDirectory(QDir d, const QString& szRemoteDir);
64 int EnumRemoteDirectory(CRemoteFileSystem* pRfs, const QString& szLocalDir);
65
66private Q_SLOTS:
67 void on_cbLocal_editTextChanged(const QString &szPath);
68
69 void slotTreeLocalClicked(const QModelIndex &index);
70 void on_treeLocal_customContextMenuRequested(const QPoint &pos);
71 void slotTreeLocalUpload();
72 void slotTreeLocalAddToList();
73 void slotTreeLocalOpen();
74 void slotTreeLocalNew();
75 void slotTreeLocalRename();
76 void slotTreeLocalDelete();
77 void slotTreeLocalCopyToClipboard();
78
79 void on_tabLocal_customContextMenuRequested(const QPoint &pos);
80 void slotTabLocalUpload();
81 void slotTabLocalAddToList();
82 void slotTabLocalOpen();
83 void slotTabLocalEdit();
84 void slotTabLocalRename();
85 void slotTabLocalDelete();
86 void slotTabLocalCopyToClipboard();
87
88 void on_cbRemote_editTextChanged(const QString &szPath);
89 //void on_cbRemote_currentTextChanged(const QString &szPath);
90 void on_cbRemote_currentIndexChanged(int index);
91
92 void on_treeRemote_clicked(const QModelIndex &index);
93 void on_treeRemote_doubleClicked(const QModelIndex &index);
94 void on_treeRemote_customContextMenuRequested(const QPoint &pos);
95 void slotTreeRemoteDownload();
96 void slotTreeRemoteAddToList();
97 void slotTreeRemoteNew();
98 void slotTreeRemoteDelete();
99 void slotTreeRemoteRename();
100 void slotTreeRemoteRefresh();
101 void slotTreeRemoteCopyToClipboard();
102
103 void on_tabRemote_customContextMenuRequested(const QPoint &pos);
104 void slotTabRemoteDownload();
105 void slotTabRemoteAddToList();
106 void slotTabRemoteNew();
107 void slotTabRemoteDelete();
108 void slotTabRemoteRename();
109 void slotTabRemoteCopyToClipboard();
110
111 void on_tabList_customContextMenuRequested(const QPoint &pos);
112 void slotTabListDelete();
113
114 void slotProcessFileTransfer();
115 void slotFileTransferUpdate(QSharedPointer<CFileTransfer> f);
116
117private:
118 Ui::CFrmFileTransfer *ui;
119
120 QFileSystemModel* m_pModelLocalDir;
121 QFileSystemModel* m_pModelLocalFile;
122
123 CRemoteFileSystemModel* m_pModelRemoteDir;
124 CRemoteFileSystemModel* m_pModelRemoteFile;
125
126 CListFileModel* m_pListFileModel;
127};
int SetLocalRoot(const QString &root)
Set local root path
int EnumLocalDirectory(QDir d, const QString &szRemoteDir)
Enum local directory, update to remote directory
int EnumRemoteDirectory(CRemoteFileSystem *pRfs, const QString &szLocalDir)
Enum remote directory, download to local directory
QString GetLocalRoot() const
Get local root path