MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / CParameterProxy

Method CParameterProxy

Src/ParameterCompone/ParameterProxy.cpp:4–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "ParameterProxy.h"
3
4CParameterProxy::CParameterProxy(CParameterOperate *parent, const QString &szPrefix)
5 : CParameterOperate(parent, szPrefix)
6 , m_SockesV5(this, "Proxy/SockesV5")
7 , m_Http(this, "Proxy/Http")
8 , m_SSH(this, "Proxy/SSH/Tunnel")
9 , m_UsedType(TYPE::None)
10{
11 m_Type << TYPE::None << TYPE::System << TYPE::SockesV5 << TYPE::Http;
12#if HAVE_LIBSSH
13 m_Type << TYPE::SSHTunnel;
14#endif
15 m_TypeName = {{TYPE::None, tr("None")},
16 {TYPE::System, tr("System settings")},
17 {TYPE::SockesV5, tr("Sockes V5")},
18 {TYPE::Http, tr("Http")},
19 {TYPE::SSHTunnel, tr("SSH tunnel")}};
20
21 QList<CParameterUser::TYPE> lstType;
22 m_Http.SetPort(80);
23 lstType.clear();
24 lstType << CParameterUser::TYPE::None
25 << CParameterUser::TYPE::UserPassword;
26 m_Http.m_User.SetType(lstType);
27 m_Http.SetPrompt(tr("The host is empty in \"Proxy->Http\". please set it"));
28
29 m_SockesV5.SetPort(1080);
30 lstType.clear();
31 lstType << CParameterUser::TYPE::None
32 << CParameterUser::TYPE::UserPassword;
33 m_SockesV5.m_User.SetType(lstType);
34 m_SockesV5.SetPrompt(tr("The host is empty in \"Proxy->SockesV5\". please set it"));
35
36 m_SSH.m_Net.SetPort(22);
37 lstType.clear();
38 lstType << CParameterUser::TYPE::UserPassword
39 << CParameterUser::TYPE::PublicKey;
40 m_SSH.m_Net.m_User.SetType(lstType);
41 m_SSH.m_Net.SetPrompt(tr("The host is empty in \"Proxy->SSH tunnel\". please set it"));
42}
43
44int CParameterProxy::OnLoad(QSettings &set)
45{

Callers

nothing calls this directly

Calls 3

SetPortMethod · 0.45
SetTypeMethod · 0.45
SetPromptMethod · 0.45

Tested by

no test coverage detected