1#include "ParameterProxy.h"
5 m_SockesV5(this,
"Proxy/SockesV5"),
6 m_SSH(this,
"Proxy/SSH/Tunnel"),
9 m_Type << TYPE::None << TYPE::Default << TYPE::SockesV5 << TYPE::SSHTunnel;
10 m_TypeName = {{TYPE::None, tr(
"None")},
11 {TYPE::Default, tr(
"Default")},
12 {TYPE::SockesV5, tr(
"Sockes V5")},
13 {TYPE::SSHTunnel, tr(
"SSH tunnel")}};
15 m_SockesV5.SetPort(1080);
17 QList<CParameterUser::TYPE> lstType;
18 lstType << CParameterUser::TYPE::None
19 << CParameterUser::TYPE::UserPassword;
20 m_SockesV5.m_User.SetType(lstType);
21 m_SockesV5.SetPrompt(tr(
"The host is empty in \"Proxy->SockesV5\". please set it"));
25 lstType << CParameterUser::TYPE::UserPassword
26 << CParameterUser::TYPE::PublicKey;
27 m_SSH.m_User.SetType(lstType);
28 m_SSH.SetPrompt(tr(
"The host is empty in \"Proxy->SSH tunnel\". please set it"));
31int CParameterProxy::OnLoad(QSettings &set)
33 set.beginGroup(
"Proxy");
35 foreach(
auto t, GetType()) {
36 type.push_back(QString::number((
int)t));
39 vType = set.value(
"Type", type).toStringList();
41 foreach(
auto s, vType)
43 lstType.push_back((TYPE)s.toInt());
46 SetUsedType((TYPE)set.value(
"Type/Used", (
int)GetUsedType()).toInt());
51int CParameterProxy::OnSave(QSettings &set)
53 set.beginGroup(
"Proxy");
55 foreach(
auto t, GetType()) {
56 type.push_back(QString::number((
int)t));
58 set.setValue(
"Type", type);
59 set.setValue(
"Type/Used", (
int)GetUsedType());
64QList<CParameterProxy::TYPE> CParameterProxy::GetType()
const
69int CParameterProxy::SetType(QList<TYPE> type)
78CParameterProxy::TYPE CParameterProxy::GetUsedType()
const
83int CParameterProxy::SetUsedType(TYPE type)
85 if(m_UsedType == type)
92QString CParameterProxy::ConvertTypeToName(TYPE t)
97int CParameterProxy::SetTypeName(TYPE t,
const QString& szName)
99 m_TypeName[t] = szName;
the parameters of connecter interface.
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.