Rabbit Remote Control 0.1.0-de
Loading...
Searching...
No Matches
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_currentIndexChanged(int index);
78
79 void on_treeRemote_clicked(const QModelIndex &index);
80 void on_treeRemote_doubleClicked(const QModelIndex &index);
81 void on_treeRemote_customContextMenuRequested(const QPoint &pos);
82 void slotTreeRemoteDownload();
83 void slotTreeRemoteAddToList();
84 void slotTreeRemoteNew();
85 void slotTreeRemoteDelete();
86 void slotTreeRemoteRename();
87 void slotTreeRemoteRefresh();
88 void slotTreeRemoteCopyToClipboard();
89
90 void on_tabRemote_customContextMenuRequested(const QPoint &pos);
91 void slotTabRemoteDownload();
92 void slotTabRemoteAddToList();
93 void slotTabRemoteNew();
94 void slotTabRemoteDelete();
95 void slotTabRemoteRename();
96 void slotTabRemoteCopyToClipboard();
97
98 void on_tabList_customContextMenuRequested(const QPoint &pos);
99 void slotTabListDelete();
100
101 void slotProcessFileTransfer();
102 void slotFileTransferUpdate(QSharedPointer<CFileTransfer> f);
103
104private:
105 Ui::CFrmFileTransfer *ui;
106
107 QFileSystemModel* m_pModelLocalDir;
108 QFileSystemModel* m_pModelLocalFile;
109
110 CRemoteFileSystemModel* m_pModelRemoteDir;
111 CRemoteFileSystemModel* m_pModelRemoteFile;
112
113 CListFileModel* m_pListFileModel;
114};
int SetLocalRoot(const QString &root)
Set local root path.
QString GetLocalRoot() const
Get local root path.