1#include "ParameterClient.h"
3CParameterClient::CParameterClient(QObject *parent)
5 , m_bHookKeyboard(true)
6 , m_bEnableSystemUserToUser(true)
7 , m_bSavePassword(false)
8 , m_PromptType(PromptType::No)
10 , m_bViewPassowrd(false)
11 , m_bShowProtocolPrefix(false)
12 , m_bShowIpPortInName(false)
13 , m_AdaptWindows(
CFrmViewer::ADAPT_WINDOWS::ZoomToWindow)
17CParameterClient::~CParameterClient()
22 SetHookKeyboard(set.value(
"Client/Hook/Keyboard",
23 GetHookKeyboard()).toBool());
24 SetEnableSystemUserToUser(set.value(
"Client/UserName/Enable",
25 GetEnableSystemUserToUser()).toBool());
26 SetPromptType(
static_cast<PromptType
>(
27 set.value(
"Client/Password/Prompty/Type",
28 static_cast<int>(GetPromptType())).toInt()
30 SetSavePassword(set.value(
"Client/Password/Save", GetSavePassword()).toBool());
31 SetViewPassowrd(set.value(
"Client/Password/View", GetViewPassowrd()).toBool());
32 SetShowProtocolPrefix(set.value(
"Client/Connecter/Name/ShowProtocolPrefix", GetShowProtocolPrefix()).toBool());
33 SetShowIpPortInName(set.value(
"Client/Connecter/Name/ShowIpPort", GetShowIpPortInName()).toBool());
35 (
int)GetAdaptWindows()).toInt());
41 set.setValue(
"Client/Hook/Keyboard", GetHookKeyboard());
42 set.setValue(
"Client/UserName/Enable", GetEnableSystemUserToUser());
43 set.setValue(
"Client/Password/Prompty/Type",
44 static_cast<int>(GetPromptType()));
45 set.setValue(
"Client/Password/Save", GetSavePassword());
46 set.setValue(
"Client/Password/View", GetViewPassowrd());
47 set.setValue(
"Client/Connecter/Name/ShowProtocolPrefix", GetShowProtocolPrefix());
48 set.setValue(
"Client/Connecter/Name/ShowIpPort", GetShowIpPortInName());
49 set.setValue(
"Client/Viewer/AdaptWindows", (
int)GetAdaptWindows());
53bool CParameterClient::GetHookKeyboard()
const
55 return m_bHookKeyboard;
58void CParameterClient::SetHookKeyboard(
bool newHookKeyboard)
60 if (m_bHookKeyboard == newHookKeyboard)
63 m_bHookKeyboard = newHookKeyboard;
64 emit sigHookKeyboardChanged();
67bool CParameterClient::GetEnableSystemUserToUser()
const
69 return m_bEnableSystemUserToUser;
72void CParameterClient::SetEnableSystemUserToUser(
bool enable)
74 if(m_bEnableSystemUserToUser == enable)
76 m_bEnableSystemUserToUser = enable;
80const QString &CParameterClient::GetEncryptKey()
const
82 return m_szEncryptKey;
85void CParameterClient::SetEncryptKey(
const QString &newPassword)
87 if (m_szEncryptKey == newPassword)
89 m_szEncryptKey = newPassword;
90 emit sigEncryptKeyChanged();
93const bool &CParameterClient::GetSavePassword()
const
95 return m_bSavePassword;
98void CParameterClient::SetSavePassword(
bool NewAutoSavePassword)
100 if (m_bSavePassword == NewAutoSavePassword)
103 m_bSavePassword = NewAutoSavePassword;
104 emit sigSavePasswordChanged(m_bSavePassword);
107CParameterClient::PromptType CParameterClient::GetPromptType()
const
112void CParameterClient::SetPromptType(PromptType NewPromptType)
114 if (m_PromptType == NewPromptType)
117 m_PromptType = NewPromptType;
118 emit sigPromptTypeChanged(m_PromptType);
121int CParameterClient::GetPromptCount()
const
123 return m_nPromptCount;
126void CParameterClient::SetPromptCount(
int NewPromptCount)
128 if (m_nPromptCount == NewPromptCount)
130 m_nPromptCount = NewPromptCount;
131 emit sigPromptCountChanged(m_nPromptCount);
134bool CParameterClient::GetViewPassowrd()
const
136 return m_bViewPassowrd;
139void CParameterClient::SetViewPassowrd(
bool NewViewPassowrd)
141 if (m_bViewPassowrd == NewViewPassowrd)
143 m_bViewPassowrd = NewViewPassowrd;
145 emit sigViewPassowrdChanged(m_bViewPassowrd);
148bool CParameterClient::GetShowProtocolPrefix()
const
150 return m_bShowProtocolPrefix;
153void CParameterClient::SetShowProtocolPrefix(
bool bShowProtocolPrefix)
155 if(m_bShowProtocolPrefix == bShowProtocolPrefix)
157 m_bShowProtocolPrefix = bShowProtocolPrefix;
159 emit sigShowProtocolPrefixChanged();
162bool CParameterClient::GetShowIpPortInName()
const
164 return m_bShowIpPortInName;
167void CParameterClient::SetShowIpPortInName(
bool bShowIpPortInName)
169 if(m_bShowIpPortInName == bShowIpPortInName)
171 m_bShowIpPortInName = bShowIpPortInName;
173 emit sigSHowIpPortInNameChanged();
178 return m_AdaptWindows;
183 if(m_AdaptWindows == aw)
187 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.