1#include "DlgUserPassword.h"
2#include "ui_DlgUserPassword.h"
3#include <QLoggingCategory>
5static Q_LOGGING_CATEGORY(log,
"Channel.SSH.Tunnel.DlgUserPassword")
16CDlgUserPassword::~CDlgUserPassword()
23 m_pPara = other.m_pPara;
26void CDlgUserPassword::SetContext(
void *pContext)
30 qCritical(log) <<
"The pContext is null";
34 if(m_pPara->GetAuthenticationMethod() == SSH_AUTH_METHOD_PASSWORD) {
35 setWindowTitle(tr(
"Set SSH user and password"));
36 ui->leUser->setText(m_pPara->GetUser());
39 if(m_pPara->GetAuthenticationMethod() == SSH_AUTH_METHOD_PUBLICKEY) {
40 setWindowTitle(tr(
"Set SSH passphrase"));
41 ui->leUser->setEnabled(
false);
44 ui->lbText->setText(tr(
"SSH host: ")
45 + m_pPara->GetServer()
46 +
":" + QString::number(m_pPara->GetPort()));
48 ui->lePassowrd->setText(m_pPara->GetPassword());
51void CDlgUserPassword::accept()
54 qCritical(log) <<
"The pContext is null";
58 m_pPara->SetUser(ui->leUser->text());
59 if(m_pPara->GetAuthenticationMethod() == SSH_AUTH_METHOD_PASSWORD)
60 m_pPara->SetPassword(ui->lePassowrd->text());
61 if(m_pPara->GetAuthenticationMethod() == SSH_AUTH_METHOD_PUBLICKEY)
62 m_pPara->SetPassphrase(ui->lePassowrd->text());