玉兔远程控制 0.1.0-bate1
载入中...
搜索中...
未找到
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*);
32 void sigGetDir(CRemoteFileSystem*,
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 SetRemoteConnecter(CRemoteFileSystemModel* p);
50
51 int EnumLocalDirectory(QDir d, const QString& szRemote);
52 int EnumRemoteDirectory(CRemoteFileSystem* p, const QString& szLocal);
53
54private Q_SLOTS:
55 void on_cbLocal_editTextChanged(const QString &szPath);
56
57 void slotTreeLocalClicked(const QModelIndex &index);
58 void on_treeLocal_customContextMenuRequested(const QPoint &pos);
59 void slotTreeLocalUpload();
60 void slotTreeLocalAddToList();
61 void slotTreeLocalOpen();
62 void slotTreeLocalNew();
63 void slotTreeLocalRename();
64 void slotTreeLocalDelete();
65 void slotTreeLocalCopyToClipboard();
66
67 void on_tabLocal_customContextMenuRequested(const QPoint &pos);
68 void slotTabLocalUpload();
69 void slotTabLocalAddToList();
70 void slotTabLocalOpen();
71 void slotTabLocalEdit();
72 void slotTabLocalRename();
73 void slotTabLocalDelete();
74 void slotTabLocalCopyToClipboard();
75
76 void on_cbRemote_editTextChanged(const QString &szPath);
77 //void on_cbRemote_currentTextChanged(const QString &szPath);
78 void on_cbRemote_currentIndexChanged(int index);
79
80 void on_treeRemote_clicked(const QModelIndex &index);
81 void on_treeRemote_doubleClicked(const QModelIndex &index);
82 void on_treeRemote_customContextMenuRequested(const QPoint &pos);
83 void slotTreeRemoteDownload();
84 void slotTreeRemoteAddToList();
85 void slotTreeRemoteNew();
86 void slotTreeRemoteDelete();
87 void slotTreeRemoteRename();
88 void slotTreeRemoteRefresh();
89 void slotTreeRemoteCopyToClipboard();
90
91 void on_tabRemote_customContextMenuRequested(const QPoint &pos);
92 void slotTabRemoteDownload();
93 void slotTabRemoteAddToList();
94 void slotTabRemoteNew();
95 void slotTabRemoteDelete();
96 void slotTabRemoteRename();
97 void slotTabRemoteCopyToClipboard();
98
99 void on_tabList_customContextMenuRequested(const QPoint &pos);
100 void slotTabListDelete();
101
102 void slotProcessFileTransfer();
103 void slotFileTransferUpdate(QSharedPointer<CFileTransfer> f);
104
105private:
106 Ui::CFrmFileTransfer *ui;
107
108 QFileSystemModel* m_pModelLocalDir;
109 QFileSystemModel* m_pModelLocalFile;
110
111 CRemoteFileSystemModel* m_pModelRemoteDir;
112 CRemoteFileSystemModel* m_pModelRemoteFile;
113
114 CListFileModel* m_pListFileModel;
115};
int SetLocalRoot(const QString &root)
Set local root path
QString GetLocalRoot() const
Get local root path