1#include "ParameterFreeRDP.h"
4CParameterFreeRDP::CParameterFreeRDP(QObject *parent)
10 m_nReconnectInterval(0),
11 m_bShowVerifyDiaglog(true),
12 m_bRedirectionPrinter(false),
13 m_nRedirectionSound(RedirecionSoundType::Disable),
14 m_bRedirectionMicrophone(false),
20 QList<CParameterProxy::TYPE>() << CParameterProxy::TYPE::None
21 << CParameterProxy::TYPE::SSHTunnel);
23 m_szRedirectionSoundParameters =
24 #if defined (Q_OS_WINDOWS) || defined(Q_OS_WIN) || defined(Q_OS_WIN32) || defined(Q_OS_WINRT)
26 #elif defined(Q_OS_IOS)
28 #elif defined (Q_OS_ANDROID)
30 #elif defined (Q_OS_LINUX) || defined (Q_OS_UNIX)
34 m_szRedirectionMicrophoneParameters = m_szRedirectionSoundParameters;
37int CParameterFreeRDP::OnLoad(QSettings &set)
39 CParameterBase::OnLoad(set);
41 set.beginGroup(
"FreeRDP");
42 SetDomain(set.value(
"Domain", GetDomain()).toString());
43 SetDesktopWidth(set.value(
"Width", GetDesktopWidth()).toInt());
44 SetDesktopHeight(set.value(
"Height", GetDesktopHeight()).toInt());
45 SetColorDepth(set.value(
"ColorDepth", GetColorDepth()).toInt());
46 SetUseMultimon(set.value(
"UseMultimon", GetUseMultimon()).toBool());
47 SetReconnectInterval(set.value(
"ReconnectionInterval",
48 GetReconnectInterval()).toInt());
50 SetShowVerifyDiaglog(set.value(
"ShowVerifyDiaglog",
51 GetShowVerifyDiaglog()).toBool());
53 SetRedirectionPrinter(set.value(
"Redirection/Printer",
54 GetRedirectionPrinter()).toBool());
55 SetRedirectionSound(
static_cast<RedirecionSoundType
>(set.value(
"Redirection/Sound",
56 static_cast<int>(GetRedirectionSound())).toInt()));
57 SetRedirectionSoundParameters(set.value(
"Redirection/Sound/Parameters",
58 GetRedirectionSoundParameters()).toString());
59 SetRedirectionMicrophone(set.value(
"Redirection/Microphone",
60 GetRedirectionMicrophone()).toBool());
61 SetRedirectionMicrophoneParameters(set.value(
"Redirection/Microphone/Parameters",
62 GetRedirectionMicrophoneParameters()).toString());
63 SetRedirectionDrives(set.value(
"Redirection/Drive").toStringList());
69int CParameterFreeRDP::OnSave(QSettings &set)
71 CParameterBase::OnSave(set);
73 set.beginGroup(
"FreeRDP");
74 set.setValue(
"Domain", GetDomain());
75 set.setValue(
"Width", GetDesktopWidth());
76 set.setValue(
"Height", GetDesktopHeight());
77 set.setValue(
"ColorDepth", GetColorDepth());
78 set.setValue(
"UseMultimon", GetUseMultimon());
80 set.setValue(
"ReconnectionInterval", GetReconnectInterval());
81 set.setValue(
"ShowVerifyDiaglog", GetShowVerifyDiaglog());
83 set.setValue(
"Redirection/Printer", GetRedirectionPrinter());
84 set.setValue(
"Redirection/Sound",
static_cast<int>(GetRedirectionSound()));
85 set.setValue(
"Redirection/Sound/Parameters", GetRedirectionSoundParameters());
86 set.setValue(
"Redirection/Microphone", GetRedirectionMicrophone());
87 set.setValue(
"Redirection/Microphone/Parameters", GetRedirectionMicrophoneParameters());
88 set.setValue(
"Redirection/Drive", GetRedirectionDrives());
94UINT32 CParameterFreeRDP::GetDesktopWidth()
const
99int CParameterFreeRDP::SetDesktopWidth(UINT32 nWidth)
101 if(m_nWidth == nWidth)
108UINT32 CParameterFreeRDP::GetDesktopHeight()
const
113int CParameterFreeRDP::SetDesktopHeight(UINT32 nHeight)
115 if(m_nHeight == nHeight)
122UINT32 CParameterFreeRDP::GetColorDepth()
const
124 return m_nColorDepth;
127int CParameterFreeRDP::SetColorDepth(UINT32 color)
129 if(m_nColorDepth == color)
131 m_nColorDepth = color;
136bool CParameterFreeRDP::GetUseMultimon()
const
138 return m_bUseMultimon;
141int CParameterFreeRDP::SetUseMultimon(
bool bUse)
143 if(m_bUseMultimon == bUse)
145 m_bUseMultimon = bUse;
150UINT CParameterFreeRDP::GetReconnectInterval()
const
152 return m_nReconnectInterval;
155void CParameterFreeRDP::SetReconnectInterval(UINT newReconnectInterval)
157 if (m_nReconnectInterval == newReconnectInterval)
160 m_nReconnectInterval = newReconnectInterval;
162 emit sigReconnectIntervalChanged();
165bool CParameterFreeRDP::GetShowVerifyDiaglog()
const
167 return m_bShowVerifyDiaglog;
170void CParameterFreeRDP::SetShowVerifyDiaglog(
bool bShow)
172 if(m_bShowVerifyDiaglog == bShow)
174 m_bShowVerifyDiaglog = bShow;
178CParameterFreeRDP::RedirecionSoundType CParameterFreeRDP::GetRedirectionSound()
const
180 return m_nRedirectionSound;
183void CParameterFreeRDP::SetRedirectionSound(RedirecionSoundType newRedirectionSound)
185 if (m_nRedirectionSound == newRedirectionSound)
187 m_nRedirectionSound = newRedirectionSound;
189 emit sigRedirectionSoundChanged(m_nRedirectionSound);
192bool CParameterFreeRDP::GetRedirectionMicrophone()
const
194 return m_bRedirectionMicrophone;
197void CParameterFreeRDP::SetRedirectionMicrophone(
bool newRedirectionMicrophone)
199 if (m_bRedirectionMicrophone == newRedirectionMicrophone)
201 m_bRedirectionMicrophone = newRedirectionMicrophone;
203 emit sigRedirectionMicrophoneChanged(m_bRedirectionMicrophone);
206QStringList CParameterFreeRDP::GetRedirectionDrives()
const
208 return m_lstRedirectionDrives;
211void CParameterFreeRDP::SetRedirectionDrives(
const QStringList &newRedirectionDrive)
213 if (m_lstRedirectionDrives == newRedirectionDrive)
215 m_lstRedirectionDrives = newRedirectionDrive;
217 emit sigRedirectionDrivesChanged(m_lstRedirectionDrives);
220bool CParameterFreeRDP::GetRedirectionPrinter()
const
222 return m_bRedirectionPrinter;
225void CParameterFreeRDP::SetRedirectionPrinter(
bool newRedirectionPrinter)
227 if (m_bRedirectionPrinter == newRedirectionPrinter)
229 m_bRedirectionPrinter = newRedirectionPrinter;
231 emit sigRedirectionPrinterChanged(m_bRedirectionPrinter);
234const QString &CParameterFreeRDP::GetRedirectionSoundParameters()
const
236 return m_szRedirectionSoundParameters;
239void CParameterFreeRDP::SetRedirectionSoundParameters(
const QString &newRedirectionSoundParameters)
241 if (m_szRedirectionSoundParameters == newRedirectionSoundParameters)
243 m_szRedirectionSoundParameters = newRedirectionSoundParameters;
245 emit sigRedirectionSoundParametersChanged();
248const QString &CParameterFreeRDP::GetRedirectionMicrophoneParameters()
const
250 return m_szRedirectionMicrophoneParameters;
253void CParameterFreeRDP::SetRedirectionMicrophoneParameters(
const QString &newRedirectionMicrophoneParameters)
255 if (m_szRedirectionMicrophoneParameters == newRedirectionMicrophoneParameters)
257 m_szRedirectionMicrophoneParameters = newRedirectionMicrophoneParameters;
259 emit sigRedirectionMicrophoneParametersChanged();
262void CParameterFreeRDP::SetDomain(
const QString& szDomain)
264 if(m_szDomain == szDomain)
266 m_szDomain = szDomain;
270const QString CParameterFreeRDP::GetDomain()
const
The interface of connecter parameters.
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.