Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
DlgGetUserPasswordFreeRDP.cpp
1#include "DlgGetUserPasswordFreeRDP.h"
2#include "ui_DlgGetUserPasswordFreeRDP.h"
3#include "ParameterNetUI.h"
4
5static int g_CDlgGetUserPasswordFreeRDP = qRegisterMetaType<CDlgGetUserPasswordFreeRDP>();
6
7CDlgGetUserPasswordFreeRDP::CDlgGetUserPasswordFreeRDP(QWidget *parent) :
8 QDialog(parent),
10 m_pConnecter(nullptr),
11 m_pParameter(nullptr)
12{
13 ui->setupUi(this);
14}
15
16CDlgGetUserPasswordFreeRDP::CDlgGetUserPasswordFreeRDP(const CDlgGetUserPasswordFreeRDP& dlg)
17{
18 m_pConnecter = dlg.m_pConnecter;
19 m_pParameter = dlg.m_pParameter;
20}
21
22CDlgGetUserPasswordFreeRDP::~CDlgGetUserPasswordFreeRDP()
23{
24 delete ui;
25}
26
27void CDlgGetUserPasswordFreeRDP::SetContext(void *pContext)
28{
29}
30
31void CDlgGetUserPasswordFreeRDP::SetConnecter(CConnecter *pConnecter)
32{
33 m_pConnecter = qobject_cast<CConnecterFreeRDP*>(pConnecter);
34 if(!m_pConnecter) return;
35
36 m_pParameter = qobject_cast<CParameterFreeRDP*>(m_pConnecter->GetParameter());
37 Q_ASSERT(m_pParameter);
38 if(!m_pParameter) return;
39
40 ui->lbText->setText(tr("Set password for %1").arg(m_pConnecter->Name()));
41 ui->leDomain->setText(m_pParameter->GetDomain());
42 ui->wUser->SetParameter(&m_pParameter->m_Net.m_User);
43}
44
45void CDlgGetUserPasswordFreeRDP::on_pbOK_clicked()
46{
47 Q_ASSERT(m_pParameter);
48 ui->wUser->Accept();
49 m_pParameter->SetDomain(ui->leDomain->text().toStdString().c_str());
50 emit m_pConnecter->sigUpdateParameters(m_pConnecter);
51 accept();
52}
53
54void CDlgGetUserPasswordFreeRDP::on_pbCancel_clicked()
55{
56 reject();
57}
virtual CParameterBase * GetParameter()
Get parameter.
virtual const QString Name() override
Display order:
Connecter interface.
Definition Connecter.h:62
void sigUpdateParameters(CConnecter *pConnecter)
Update parameters, notify application to save or show parameters.
CParameterUser m_User
[Instance user]