1#include "ParameterClient.h"
3CParameterClient::CParameterClient(QObject *parent)
5 , m_bHookKeyboard(false)
6 , m_bHookShowAdministratorPrivilege(true)
7 , m_bEnableSystemUserToUser(true)
8 , m_bSavePassword(false)
9 , m_PromptType(PromptType::No)
11 , m_bViewPassowrd(false)
12 , m_bShowProtocolPrefix(false)
13 , m_bShowIpPortInName(false)
14 , m_AdaptWindows(
CFrmViewer::ADAPT_WINDOWS::ZoomToWindow)
18CParameterClient::~CParameterClient()
24 SetHookShowAdministratorPrivilege(
25 set.value(
"Client/Hook/ShowAdministratorPrivilege",
26 GetHookShowAdministratorPrivilege()).toBool());
27 SetHookKeyboard(set.value(
"Client/Hook/Keyboard",
28 GetHookKeyboard()).toBool());
29 SetEnableSystemUserToUser(set.value(
"Client/UserName/Enable",
30 GetEnableSystemUserToUser()).toBool());
31 SetPromptType(
static_cast<PromptType
>(
32 set.value(
"Client/Password/Prompty/Type",
33 static_cast<int>(GetPromptType())).toInt()
35 SetSavePassword(set.value(
"Client/Password/Save", GetSavePassword()).toBool());
36 SetViewPassowrd(set.value(
"Client/Password/View", GetViewPassowrd()).toBool());
37 SetShowProtocolPrefix(set.value(
"Client/Connecter/Name/ShowProtocolPrefix", GetShowProtocolPrefix()).toBool());
38 SetShowIpPortInName(set.value(
"Client/Connecter/Name/ShowIpPort", GetShowIpPortInName()).toBool());
40 (
int)GetAdaptWindows()).toInt());
46 set.setValue(
"Client/Hook/Keyboard", GetHookKeyboard());
47 set.setValue(
"Client/Hook/ShowAdministratorPrivilege", GetHookShowAdministratorPrivilege());
48 set.setValue(
"Client/UserName/Enable", GetEnableSystemUserToUser());
49 set.setValue(
"Client/Password/Prompty/Type",
50 static_cast<int>(GetPromptType()));
51 set.setValue(
"Client/Password/Save", GetSavePassword());
52 set.setValue(
"Client/Password/View", GetViewPassowrd());
53 set.setValue(
"Client/Connecter/Name/ShowProtocolPrefix", GetShowProtocolPrefix());
54 set.setValue(
"Client/Connecter/Name/ShowIpPort", GetShowIpPortInName());
55 set.setValue(
"Client/Viewer/AdaptWindows", (
int)GetAdaptWindows());
59bool CParameterClient::GetHookKeyboard()
const
61 return m_bHookKeyboard;
64void CParameterClient::SetHookKeyboard(
bool newHookKeyboard)
66 if (m_bHookKeyboard == newHookKeyboard)
69 m_bHookKeyboard = newHookKeyboard;
70 emit sigHookKeyboardChanged();
73bool CParameterClient::GetHookShowAdministratorPrivilege()
75 return m_bHookShowAdministratorPrivilege;
78void CParameterClient::SetHookShowAdministratorPrivilege(
bool bShow)
80 if(bShow == m_bHookShowAdministratorPrivilege)
83 m_bHookShowAdministratorPrivilege = bShow;
84 emit sigHookShowAdministratorPrivilege();
87bool CParameterClient::GetEnableSystemUserToUser()
const
89 return m_bEnableSystemUserToUser;
92void CParameterClient::SetEnableSystemUserToUser(
bool enable)
94 if(m_bEnableSystemUserToUser == enable)
96 m_bEnableSystemUserToUser = enable;
100const QString &CParameterClient::GetEncryptKey()
const
102 return m_szEncryptKey;
105void CParameterClient::SetEncryptKey(
const QString &newPassword)
107 if (m_szEncryptKey == newPassword)
109 m_szEncryptKey = newPassword;
111 emit sigEncryptKeyChanged();
114const bool &CParameterClient::GetSavePassword()
const
116 return m_bSavePassword;
119void CParameterClient::SetSavePassword(
bool NewAutoSavePassword)
121 if (m_bSavePassword == NewAutoSavePassword)
124 m_bSavePassword = NewAutoSavePassword;
125 emit sigSavePasswordChanged(m_bSavePassword);
128CParameterClient::PromptType CParameterClient::GetPromptType()
const
133void CParameterClient::SetPromptType(PromptType NewPromptType)
135 if (m_PromptType == NewPromptType)
138 m_PromptType = NewPromptType;
139 emit sigPromptTypeChanged(m_PromptType);
142int CParameterClient::GetPromptCount()
const
144 return m_nPromptCount;
147void CParameterClient::SetPromptCount(
int NewPromptCount)
149 if (m_nPromptCount == NewPromptCount)
151 m_nPromptCount = NewPromptCount;
153 emit sigPromptCountChanged(m_nPromptCount);
156bool CParameterClient::GetViewPassowrd()
const
158 return m_bViewPassowrd;
161void CParameterClient::SetViewPassowrd(
bool NewViewPassowrd)
163 if (m_bViewPassowrd == NewViewPassowrd)
165 m_bViewPassowrd = NewViewPassowrd;
167 emit sigViewPassowrdChanged(m_bViewPassowrd);
170bool CParameterClient::GetShowProtocolPrefix()
const
172 return m_bShowProtocolPrefix;
175void CParameterClient::SetShowProtocolPrefix(
bool bShowProtocolPrefix)
177 if(m_bShowProtocolPrefix == bShowProtocolPrefix)
179 m_bShowProtocolPrefix = bShowProtocolPrefix;
181 emit sigShowProtocolPrefixChanged();
184bool CParameterClient::GetShowIpPortInName()
const
186 return m_bShowIpPortInName;
189void CParameterClient::SetShowIpPortInName(
bool bShowIpPortInName)
191 if(m_bShowIpPortInName == bShowIpPortInName)
193 m_bShowIpPortInName = bShowIpPortInName;
195 emit sigSHowIpPortInNameChanged();
200 return m_AdaptWindows;
205 if(m_AdaptWindows == aw)
209 emit sigAdaptWindowsChanged();
A widget which displays output image from a CConnectDesktop and sends input keypresses and mouse acti...
ADAPT_WINDOWS
The ADAPT_WINDOWS enum.
virtual int OnLoad(QSettings &set) override
virtual int OnSave(QSettings &set) override
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.