玉兔远程控制
0.1.0-bate11
Toggle main menu visibility
载入中...
搜索中...
未找到
Plugins
SftpServer
DlgSettingsSftpServer.cpp
1
// Author: Kang Lin <kl222@126.com>
2
3
#include <QFileDialog>
4
#include <QHBoxLayout>
5
#include "ParameterSftpServer.h"
6
#include "DlgSettingsSftpServer.h"
7
#include "ui_DlgSettingsSftpServer.h"
8
9
CDlgSettingsSftpServer::CDlgSettingsSftpServer(
CParameterSftpServer
*pPara, QWidget *parent)
10
: QDialog(parent)
11
, ui(new
Ui
::
CDlgSettingsSftpServer
)
12
, m_pPara(pPara)
13
, m_pServerUI(nullptr)
14
{
15
ui->setupUi(
this
);
16
m_pServerUI =
new
CParameterServerUI
(ui->wContain);
17
if
(m_pServerUI) {
18
m_pServerUI->SetParameter(pPara);
19
ui->wContain->insertTab(0, m_pServerUI, m_pServerUI->windowIcon(), m_pServerUI->windowTitle());
20
}
21
ui->wContain->setCurrentIndex(0);
22
23
ui->cbAnonymousLogin->setChecked(m_pPara->GetAnonymousLogin());
24
ui->cbReadOnly->setChecked(m_pPara->GetReadOnly());
25
ui->leRoot->setText(m_pPara->GetRoot());
26
}
27
28
CDlgSettingsSftpServer::~CDlgSettingsSftpServer()
29
{
30
delete
ui;
31
}
32
33
void
CDlgSettingsSftpServer::accept()
34
{
35
bool
nRet = 0;
36
nRet = m_pServerUI->CheckValidity(
true
);
37
if
(!nRet)
return
;
38
if
(m_pServerUI)
39
m_pServerUI->Accept();
40
41
m_pPara->SetAnonymousLogin(ui->cbAnonymousLogin->isChecked());
42
m_pPara->SetReadOnly(ui->cbReadOnly->isChecked());
43
m_pPara->SetRoot(ui->leRoot->text());
44
45
QDialog::accept();
46
}
47
48
void
CDlgSettingsSftpServer::on_pbRoot_clicked()
49
{
50
QString szDir = QFileDialog::getExistingDirectory(
this
, QString(), ui->leRoot->text());
51
if
(szDir.isEmpty())
52
return
;
53
ui->leRoot->setText(szDir);
54
}
CDlgSettingsSftpServer
定义
DlgSettingsSftpServer.h:15
CParameterServerUI
The server base parameters UI
定义
ParameterServerUI.h:19
CParameterSftpServer
定义
ParameterSftpServer.h:8
Ui
定义
FrmFullScreenToolBar.h:14
作者:康林 (kl222@126.com)
版权所有(c) 康林工作室 保留所有权力