Rabbit Remote Control 0.1.0-bate10
Loading...
Searching...
No Matches
ParameterFreeRDPServer.cpp
1// Author: Kang Lin <kl222@126.com>
2
3#include "ParameterFreeRDPServer.h"
4
5CParameterFreeRDPServer::CParameterFreeRDPServer(
6 QObject *parent, const QString &szPrefix)
7 : CParameterServer{parent, szPrefix}
8 , m_bTlsSecurity(true)
9 , m_bRdpSecurity(true)
10 , m_bNlaSecurity(false)
11 , m_bNlaExtSecurity(false)
12#ifdef WITH_SHADOW_X11
13 , m_bAuthentication(true)
14#else
15 , m_bAuthentication(false)
16#endif
17 , m_MayView(true)
18 , m_MayInteract(true)
19{
20 m_Net.SetPort(3389);
21}
22
23int CParameterFreeRDPServer::OnLoad(QSettings &set)
24{
25 int nRet = 0;
26 nRet = CParameterServer::OnLoad(set);
27 if(nRet) return nRet;
28
29 setTlsSecurity(set.value("Security/Tls", getTlsSecurity()).toBool());
30 setRdpSecurity(set.value("Security/Rdp", getRdpSecurity()).toBool());
31 setNlaSecurity(set.value("Security/Nla", getNlaSecurity()).toBool());
32 setNlaExtSecurity(set.value("Security/NlaExt", getNlaExtSecurity()).toBool());
33 setSamFile(set.value("Security/Nla/SamFIle", getSamFile()).toString());
34
35 setAuthentication(set.value("Server/Authentication", getAuthentication()).toBool());
36 setMayView(set.value("Server/MayView", getMayView()).toBool());
37 setMayInteract(set.value("Server/MayInteract", getMayInteract()).toBool());
38
39 return nRet;
40}
41
42int CParameterFreeRDPServer::OnSave(QSettings &set)
43{
44 int nRet = 0;
45 nRet = CParameterServer::OnSave(set);
46 if(nRet) return nRet;
47
48 set.setValue("Security/Tls", getTlsSecurity());
49 set.setValue("Security/Rdp", getRdpSecurity());
50 set.setValue("Security/Nla", getNlaSecurity());
51 set.setValue("Security/NlaExt", getNlaExtSecurity());
52 set.setValue("Security/Nla/SamFIle", getSamFile());
53
54 set.setValue("Server/Authentication", getAuthentication());
55 set.setValue("Server/MayView", getMayView());
56 set.setValue("Server/MayInteract", getMayInteract());
57
58 return nRet;
59}
60
61bool CParameterFreeRDPServer::getTlsSecurity() const
62{
63 return m_bTlsSecurity;
64}
65
66void CParameterFreeRDPServer::setTlsSecurity(bool newTlsSecurity)
67{
68 if (m_bTlsSecurity == newTlsSecurity)
69 return;
70 m_bTlsSecurity = newTlsSecurity;
71 emit sigTlsSecurityChanged();
72}
73
74bool CParameterFreeRDPServer::getRdpSecurity() const
75{
76 return m_bRdpSecurity;
77}
78
79void CParameterFreeRDPServer::setRdpSecurity(bool newRdpSecurity)
80{
81 if (m_bRdpSecurity == newRdpSecurity)
82 return;
83 m_bRdpSecurity = newRdpSecurity;
84 emit sigRdpSecurityChanged();
85}
86
87bool CParameterFreeRDPServer::getNlaSecurity() const
88{
89 return m_bNlaSecurity;
90}
91
92void CParameterFreeRDPServer::setNlaSecurity(bool newNlaSecurity)
93{
94 if (m_bNlaSecurity == newNlaSecurity)
95 return;
96 m_bNlaSecurity = newNlaSecurity;
97 emit sigNlaecurityChanged();
98}
99
100bool CParameterFreeRDPServer::getNlaExtSecurity() const
101{
102 return m_bNlaExtSecurity;
103}
104
105void CParameterFreeRDPServer::setNlaExtSecurity(bool newNlaExtSecurity)
106{
107 if (m_bNlaExtSecurity == newNlaExtSecurity)
108 return;
109 m_bNlaExtSecurity = newNlaExtSecurity;
110 emit sigNlaExtSecurityChanged();
111}
112
113bool CParameterFreeRDPServer::getAuthentication() const
114{
115 return m_bAuthentication;
116}
117
118void CParameterFreeRDPServer::setAuthentication(bool newAuthentication)
119{
120 if (m_bAuthentication == newAuthentication)
121 return;
122 m_bAuthentication = newAuthentication;
123 emit sigAuthenticationChanged();
124}
125
126bool CParameterFreeRDPServer::getMayView() const
127{
128 return m_MayView;
129}
130
131void CParameterFreeRDPServer::setMayView(bool newMayView)
132{
133 if (m_MayView == newMayView)
134 return;
135 m_MayView = newMayView;
136 emit sigMayViewChanged();
137}
138
139bool CParameterFreeRDPServer::getMayInteract() const
140{
141 return m_MayInteract;
142}
143
144void CParameterFreeRDPServer::setMayInteract(bool newMayInteract)
145{
146 if (m_MayInteract == newMayInteract)
147 return;
148 m_MayInteract = newMayInteract;
149 emit sigMayInteractChanged();
150}
151
152const QString &CParameterFreeRDPServer::getSamFile() const
153{
154 return m_szSamFile;
155}
156
157void CParameterFreeRDPServer::setSamFile(const QString &newSamFile)
158{
159 if (m_szSamFile == newSamFile)
160 return;
161 m_szSamFile = newSamFile;
162 emit sigSamFileChanged();
163}
The server base parameters.