-
-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathParameterTelnet.cpp
More file actions
55 lines (45 loc) · 1.23 KB
/
ParameterTelnet.cpp
File metadata and controls
55 lines (45 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "ParameterTelnet.h"
#include <QLoggingCategory>
static Q_LOGGING_CATEGORY(log, "Plugin.Telnet.Parameter")
CParameterTelnet::CParameterTelnet(CParameterOperate *parent, const QString &szPrefix)
: CParameterTerminalBase{parent, szPrefix}
, m_Net(this)
, m_szLogin(".*login:")
, m_szPassword(".*Password:")
{}
CParameterTelnet::~CParameterTelnet()
{}
int CParameterTelnet::OnLoad(QSettings &set)
{
set.setValue("Login", GetLogin());
set.setValue("Password", GetPassword());
return CParameterTerminalBase::OnLoad(set);
}
int CParameterTelnet::OnSave(QSettings &set)
{
SetLogin(set.value("Login", GetLogin()).toString());
SetPassword(set.value("Password", GetPassword()).toString());
return CParameterTerminalBase::OnSave(set);
}
QString CParameterTelnet::GetLogin() const
{
return m_szLogin;
}
void CParameterTelnet::SetLogin(const QString &newLogin)
{
if(m_szLogin == newLogin)
return;
m_szLogin = newLogin;
SetModified(true);
}
QString CParameterTelnet::GetPassword() const
{
return m_szPassword;
}
void CParameterTelnet::SetPassword(const QString &newPassword)
{
if(m_szPassword == newPassword)
return;
m_szPassword = newPassword;
SetModified(true);
}