4#include <openssl/tls1.h>
9#include <QFileSystemModel>
10#include <QButtonGroup>
11#include <QLoggingCategory>
13#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
14 #include <QMediaDevices>
15 #include <QAudioDevice>
17 #include <QAudioDeviceInfo>
20#include "RabbitCommonTools.h"
21#include "DlgDesktopSize.h"
22#include "freerdp/version.h"
24#include "ParameterNetUI.h"
25#include "ui_DlgSetFreeRDP.h"
26#include "DlgSetFreeRDP.h"
28static Q_LOGGING_CATEGORY(log,
"FreeRDP.Parameter.Dlg")
33 , m_pSettings(pSettings)
34 , m_pFileModel(
nullptr)
36 , m_pRecordUI(
nullptr)
37 , m_pButtonGroup(
nullptr)
39 setAttribute(Qt::WA_DeleteOnClose);
42 ui->leName->setText(m_pSettings->GetName());
45 ui->leDomain->setText(m_pSettings->GetDomain());
46 ui->wNet->SetParameter(&m_pSettings->m_Net);
48 ui->cbOnlyView->setChecked(m_pSettings->GetOnlyView());
49 ui->cbClipboard->setChecked(m_pSettings->GetClipboard());
50 ui->cbShowServerName->setChecked(m_pSettings->GetShowServerName());
53 m_pProxyUI->SetParameter(&m_pSettings->m_Proxy);
54 InsertView(m_pProxyUI, 1);
57 m_pRecordUI->SetParameter(&m_pSettings->m_Record);
64 ui->cbAllMonitor->setChecked(m_pSettings->GetUseMultimon());
66 int width = GetScreenGeometry().width();
67 int height = GetScreenGeometry().height();
68 QString curSize = QString::number(width) +
"×" + QString::number(height);
69 UINT32 desktopWidth = 0, desktopHeight = 0;
70 desktopWidth = m_pSettings->GetDesktopWidth();
71 desktopHeight = m_pSettings->GetDesktopHeight();
72 if(width == desktopWidth && height == desktopHeight)
74 ui->rbLocalScreen->setChecked(
true);
75 ui->cbDesktopSize->setCurrentText(curSize);
77 ui->rbSelect->setChecked(
true);
78 curSize = QString::number(desktopWidth)
79 +
"×" + QString::number(desktopHeight);
80 ui->cbDesktopSize->setCurrentText(curSize);
83 ui->cbColorDepth->addItem(tr(
"8 bits"), 8);
84 ui->cbColorDepth->addItem(tr(
"16 bits"), 16);
85 ui->cbColorDepth->addItem(tr(
"24 bits"), 24);
86 ui->cbColorDepth->addItem(tr(
"32 bits"), 32);
87 int nIndex = ui->cbColorDepth->findData(
88 m_pSettings->GetColorDepth());
90 ui->cbColorDepth->setCurrentIndex(nIndex);
92 ui->sbReconnect->setValue(m_pSettings->GetReconnectInterval());
95 ui->cbPrinter->setChecked(m_pSettings->GetRedirectionPrinter());
97 ui->cbEnableLocalInputMethod->setChecked(m_pSettings->GetEnableLocalInputMethod());
100 ui->gbAudio->setEnabled(HasAudioOutput() || HasAudioInput());
101 if(m_pSettings->GetRedirectionSound() == CParameterFreeRDP::RedirecionSoundType::Disable)
102 ui->rbAudioDisable->setChecked(
true);
103 if(m_pSettings->GetRedirectionSound() == CParameterFreeRDP::RedirecionSoundType::Local)
104 ui->rbAudioLocal->setChecked(
true);
105 if(m_pSettings->GetRedirectionSound() == CParameterFreeRDP::RedirecionSoundType::Remote)
106 ui->rbAudioRemote->setChecked(
true);
107 QString szRdpSndParameters
108 = tr(
"- [sys:<sys>,][dev:<dev>,][format:<format>,][rate:<rate>,][channel:<channel>]\n"
109 #
if defined (Q_OS_WINDOWS) || defined(Q_OS_WIN) || defined(Q_OS_WIN32) || defined(Q_OS_WINRT)
111 #elif defined(Q_OS_IOS)
114 #elif defined (Q_OS_ANDROID)
116 #elif defined (Q_OS_LINUX) || defined (Q_OS_UNIX)
119 "- sys:oss,dev:1,format:1\n"
123 QString szRdpSnd = tr(
"Options for redirection of audio output:\n") + szRdpSndParameters;
124 ui->leRdpSnd->setToolTip(szRdpSnd);
125 ui->leRdpSnd->setStatusTip(szRdpSnd);
126 ui->leRdpSnd->setWhatsThis(szRdpSnd);
127 ui->leRdpSnd->setEnabled(HasAudioOutput());
128 ui->leRdpSnd->setText(m_pSettings->GetRedirectionSoundParameters());
130 QString szAudin = tr(
"Options for redirection of audio input:\n") + szRdpSndParameters;
131 ui->leAudin->setToolTip(szAudin);
132 ui->leAudin->setStatusTip(szAudin);
133 ui->leAudin->setWhatsThis(szAudin);
134 ui->leAudin->setText(m_pSettings->GetRedirectionMicrophoneParameters());
135 if(HasAudioInput()) {
136 ui->cbAudin->setChecked(m_pSettings->GetRedirectionMicrophone());
138 ui->cbAudin->setChecked(
false);
139 ui->cbAudin->setEnabled(
false);
140 ui->leAudin->setEnabled(
false);
144 m_pFileModel=
new QFileSystemModel();
145 m_pFileModel->setNameFilterDisables(
false);
146 m_pFileModel->setFilter(QDir::Drives | QDir::Dirs | QDir::NoDotAndDotDot);
147 m_pFileModel->setRootPath(
"");
148 ui->tvDrive->setModel(m_pFileModel);
149 ui->tvDrive->setEditTriggers(QAbstractItemView::NoEditTriggers);
150 int count = m_pFileModel->columnCount();
151 for(
int i = 1; i < count; i++)
152 ui->tvDrive->hideColumn(i);
153 bool check = connect(ui->tvDrive->selectionModel(),
154 SIGNAL(selectionChanged(
const QItemSelection &,
155 const QItemSelection &)),
157 SLOT(slotSelectionChanged(QItemSelection,QItemSelection)));
159 QStringList lstDrives = m_pSettings->GetRedirectionDrives();
160 foreach(
auto path, lstDrives)
163 if(!path.isEmpty()) {
164 index = m_pFileModel->index(path);
165 ui->tvDrive->setCurrentIndex(index);
168 ShowDriveSelected(lstDrives.size());
171 ui->cbSecurityEnable->setChecked(m_pSettings->GetNegotiateSecurityLayer());
172 on_cbSecurityEnable_stateChanged(ui->cbSecurityEnable->checkState());
173 CParameterFreeRDP::Security security = m_pSettings->GetSecurity();
174 if(CParameterFreeRDP::Security::RDP & (uint)security)
175 ui->cbSecurityRDP->setChecked(
true);
176 if(CParameterFreeRDP::Security::TLS & (uint)security)
177 ui->cbSecurityTls->setChecked(
true);
178 if(CParameterFreeRDP::Security::NLA & (uint)security)
179 ui->cbSecurityNLA->setChecked(
true);
180 if(CParameterFreeRDP::Security::NLA_Ext & (uint)security)
181 ui->cbSecurityNlaExt->setChecked(
true);
182 if(CParameterFreeRDP::Security::RDSAAD & (uint)security)
183 ui->cbSecurityRDSAAD->setChecked(
true);
184 if(CParameterFreeRDP::Security::RDSTLS & (uint)security)
185 ui->cbSecurityRDSTLS->setChecked(
true);
186#if FREERDP_VERSION_MAJOR >= 3
187 ui->cbSecurityRDSAAD->setVisible(
true);
188 ui->cbSecurityRDSTLS->setVisible(
true);
190 ui->cbSecurityRDSAAD->setVisible(
false);
191 ui->cbSecurityRDSTLS->setVisible(
false);
194 switch(m_pSettings->GetTlsVersion())
197 ui->rbTls1_0->setChecked(
true);
200 ui->rbTls1_1->setChecked(
true);
203 ui->rbTls1_2->setChecked(
true);
206 ui->rbTls1_3->setChecked(
true);
211 m_vPerformanceFlags[CONNECTION_TYPE_MODEM - 1] = PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG | PERF_DISABLE_MENUANIMATIONS | PERF_DISABLE_THEMING;
212 m_vPerformanceFlags[CONNECTION_TYPE_BROADBAND_LOW - 1] = PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG | PERF_DISABLE_MENUANIMATIONS;
213 m_vPerformanceFlags[CONNECTION_TYPE_SATELLITE - 1] = PERF_DISABLE_WALLPAPER | PERF_ENABLE_DESKTOP_COMPOSITION | PERF_DISABLE_FULLWINDOWDRAG | PERF_DISABLE_MENUANIMATIONS;
214 m_vPerformanceFlags[CONNECTION_TYPE_BROADBAND_HIGH - 1] = PERF_DISABLE_WALLPAPER | PERF_ENABLE_DESKTOP_COMPOSITION | PERF_DISABLE_FULLWINDOWDRAG | PERF_DISABLE_MENUANIMATIONS;
215 m_vPerformanceFlags[CONNECTION_TYPE_WAN - 1] = PERF_ENABLE_FONT_SMOOTHING | PERF_ENABLE_DESKTOP_COMPOSITION;
216 m_vPerformanceFlags[CONNECTION_TYPE_LAN - 1] = PERF_ENABLE_FONT_SMOOTHING | PERF_ENABLE_DESKTOP_COMPOSITION;
217 m_vPerformanceFlags[CONNECTION_TYPE_AUTODETECT - 1] = PERF_ENABLE_FONT_SMOOTHING | PERF_ENABLE_DESKTOP_COMPOSITION;
219 if(m_pSettings->GetConnectType() > 0 && m_pSettings->GetPerformanceFlags() > 0)
220 m_vPerformanceFlags[m_pSettings->GetConnectType() - 1] = m_pSettings->GetPerformanceFlags();
222 ui->cbConnectType->addItem(tr(
"Modem(56 kbps)"), CONNECTION_TYPE_MODEM);
223 ui->cbConnectType->addItem(tr(
"Broadband low(256 kbps - 2 Mbps)"), CONNECTION_TYPE_BROADBAND_LOW);
224 ui->cbConnectType->addItem(tr(
"Satellite(2 Mbps - 16 Mbps, High latency)"), CONNECTION_TYPE_SATELLITE);
225 ui->cbConnectType->addItem(tr(
"Broadband high(2 Mbps - 10 Mbps)"), CONNECTION_TYPE_BROADBAND_HIGH);
226 ui->cbConnectType->addItem(tr(
"Wan(10 Mbps or higher speed, High latency)"), CONNECTION_TYPE_WAN);
227 ui->cbConnectType->addItem(tr(
"Lan(10 Mbps or higher speed)"), CONNECTION_TYPE_LAN);
228 ui->cbConnectType->addItem(tr(
"Automatically detect"), CONNECTION_TYPE_AUTODETECT);
229 ui->cbConnectType->setCurrentIndex(ui->cbConnectType->findData(m_pSettings->GetConnectType()));
233CDlgSetFreeRDP::~CDlgSetFreeRDP()
239void CDlgSetFreeRDP::accept()
243 if(!ui->wNet->CheckValidity(
true)) {
244 ui->tabWidget->setCurrentIndex(0);
247 if(!m_pProxyUI->CheckValidity(
true)) {
248 ui->tabWidget->setCurrentWidget(m_pProxyUI);
251 if(!m_pRecordUI->CheckValidity(
true)) {
252 ui->tabWidget->setCurrentWidget(m_pRecordUI);
256 m_pSettings->SetName(ui->leName->text());
259 m_pSettings->SetDomain(ui->leDomain->text());
260 nRet = ui->wNet->Accept();
263 nRet = m_pProxyUI->Accept();
266 nRet = m_pRecordUI->Accept();
269 m_pSettings->SetOnlyView(ui->cbOnlyView->isChecked());
270 m_pSettings->SetClipboard(ui->cbClipboard->isChecked());
271 m_pSettings->SetShowServerName(ui->cbShowServerName->isChecked());
274 m_pSettings->SetUseMultimon(ui->cbAllMonitor->isChecked());
275 QString szSize = ui->cbDesktopSize->currentText();
276 int index = szSize.indexOf(
"×");
279 UINT32 width = szSize.left(index).toInt();
280 UINT32 height = szSize.right(szSize.length() - index - 1).toInt();
281 m_pSettings->SetDesktopWidth(width);
282 m_pSettings->SetDesktopHeight(height);
284 m_pSettings->SetColorDepth(ui->cbColorDepth->currentData().toInt());
285 m_pSettings->SetReconnectInterval(ui->sbReconnect->value());
288 m_pSettings->SetRedirectionPrinter(ui->cbPrinter->isChecked());
289 m_pSettings->SetEnableLocalInputMethod(ui->cbEnableLocalInputMethod->isChecked());
290 if(HasAudioOutput()) {
291 CParameterFreeRDP::RedirecionSoundType tRdirectionSound
292 = CParameterFreeRDP::RedirecionSoundType::Disable;
293 if(ui->rbAudioDisable->isChecked())
294 tRdirectionSound = CParameterFreeRDP::RedirecionSoundType::Disable;
295 else if(ui->rbAudioLocal->isChecked())
296 tRdirectionSound = CParameterFreeRDP::RedirecionSoundType::Local;
297 else if(ui->rbAudioRemote->isChecked())
298 tRdirectionSound = CParameterFreeRDP::RedirecionSoundType::Remote;
299 m_pSettings->SetRedirectionSound(tRdirectionSound);
301 m_pSettings->SetRedirectionSound(
302 CParameterFreeRDP::RedirecionSoundType::Disable);
304 m_pSettings->SetRedirectionSoundParameters(ui->leRdpSnd->text());
306 m_pSettings->SetRedirectionMicrophone(ui->cbAudin->isChecked());
308 m_pSettings->SetRedirectionMicrophone(
false);
309 m_pSettings->SetRedirectionMicrophoneParameters(ui->leAudin->text());
311 QStringList lstDrives;
313 QModelIndexList selected = ui->tvDrive->selectionModel()->selectedRows(0);
314 QList<QModelIndex>::iterator it;
315 QModelIndex modelIndex;
317 for (it = selected.begin(); it != selected.end(); ++it)
320 szPath = m_pFileModel->filePath(modelIndex);
321 if(!szPath.isEmpty())
322 lstDrives.append(szPath);
324 m_pSettings->SetRedirectionDrives(lstDrives);
327 m_pSettings->SetNegotiateSecurityLayer(ui->cbSecurityEnable->isChecked());
329 if(ui->cbSecurityRDP->isChecked())
330 security |= CParameterFreeRDP::Security::RDP;
331 if(ui->cbSecurityTls->isChecked())
332 security |= CParameterFreeRDP::Security::TLS;
333 if(ui->cbSecurityNLA->isChecked())
334 security |= CParameterFreeRDP::Security::NLA;
335 if(ui->cbSecurityNlaExt->isChecked())
336 security |= CParameterFreeRDP::Security::NLA_Ext;
337 if(ui->cbSecurityRDSTLS->isChecked())
338 security |= CParameterFreeRDP::Security::RDSTLS;
339 if(ui->cbSecurityRDSAAD->isChecked())
340 security |= CParameterFreeRDP::Security::RDSAAD;
341 m_pSettings->SetSecurity((CParameterFreeRDP::Security)security);
344 if(ui->rbTls1_0->isChecked())
345 m_pSettings->SetTlsVersion(TLS1_VERSION);
346 else if(ui->rbTls1_1->isChecked())
347 m_pSettings->SetTlsVersion(TLS1_1_VERSION);
348 else if(ui->rbTls1_2->isChecked())
349 m_pSettings->SetTlsVersion(TLS1_2_VERSION);
350 else if(ui->rbTls1_3->isChecked())
351 m_pSettings->SetTlsVersion(TLS1_3_VERSION);
354 m_pSettings->SetConnectType(ui->cbConnectType->currentData().toUInt());
356 UINT32 performanceFlags = 0;
357 if(!ui->cbDesktopBackground->isChecked())
358 performanceFlags |= PERF_DISABLE_WALLPAPER;
359 if(!ui->cbWindowDrag->isChecked())
360 performanceFlags |= PERF_DISABLE_FULLWINDOWDRAG;
361 if(!ui->cbMenuAnims->isChecked())
362 performanceFlags |= PERF_DISABLE_MENUANIMATIONS;
363 if(!ui->cbThemes->isChecked())
364 performanceFlags |= PERF_DISABLE_THEMING;
365 if(ui->cbFontSmoothing->isChecked())
366 performanceFlags |= PERF_ENABLE_FONT_SMOOTHING;
367 if(ui->cbDesktopCompositing->isChecked())
368 performanceFlags |= PERF_ENABLE_DESKTOP_COMPOSITION;
369 m_pSettings->SetPerformanceFlags(performanceFlags);
375void CDlgSetFreeRDP::on_rbLocalScreen_clicked(
bool checked)
378 int width = GetScreenGeometry().width();
379 int height = GetScreenGeometry().height();
380 QString curSize = QString::number(width) +
"×" + QString::number(height);
381 ui->rbLocalScreen->setText(tr(
"Local screen") +
": " + curSize);
382 if(ui->cbDesktopSize->findText(curSize) == -1)
383 InsertDesktopSize(width, height);
384 ui->cbDesktopSize->setCurrentText(curSize);
387QRect CDlgSetFreeRDP::GetScreenGeometry()
390 QScreen* pScreen = QApplication::primaryScreen();
391 if(ui->cbAllMonitor->isChecked())
394 r = pScreen->virtualGeometry();
410 r = pScreen->geometry();
415int CDlgSetFreeRDP::UpdateDesktopSize()
417 ui->cbDesktopSize->clear();
418 QStringList lstDesktopSizes;
419 lstDesktopSizes <<
"640×480"
436 ui->cbDesktopSize->addItems(lstDesktopSizes);
438 int width = GetScreenGeometry().width();
439 int height = GetScreenGeometry().height();
440 QString curSize = QString::number(width) +
"×" + QString::number(height);
441 ui->rbLocalScreen->setText(tr(
"Local screen") +
": " + curSize);
442 if(ui->cbDesktopSize->findText(curSize) == -1)
443 InsertDesktopSize(width, height);
447int CDlgSetFreeRDP::InsertDesktopSize(QString szSize)
450 int nIndex = szSize.indexOf(
"×");
454 w = szSize.left(nIndex).toInt(&ok);
456 h = szSize.right(szSize.length() - nIndex - 1).toInt(&ok);
460 return InsertDesktopSize(w, h);
463int CDlgSetFreeRDP::InsertDesktopSize(
int width,
int height)
465 QString curSize = QString::number(width) +
"×" + QString::number(height);
466 if(ui->cbDesktopSize->findText(curSize) > -1)
469 int nCount = ui->cbDesktopSize->count();
470 for(
int i = 0; i < nCount; i++)
472 QString curText = ui->cbDesktopSize->itemText(i);
473 int nIndex = curText.indexOf(
"×");
476 int w = curText.left(nIndex).toInt();
477 int h = curText.right(curText.length() - nIndex - 1).toInt();
480 ui->cbDesktopSize->insertItem(i, curSize);
482 }
else if(w == width) {
485 ui->cbDesktopSize->insertItem(i, curSize);
492 QString curText = ui->cbDesktopSize->itemText(j);
493 int nIndex = curText.indexOf(
"×");
497 int w = curText.left(nIndex).toInt();
498 int h = curText.right(curText.length() - nIndex - 1).toInt();
500 ui->cbDesktopSize->insertItem(j, curSize);
505 ui->cbDesktopSize->insertItem(j, curSize);
507 }
else if(h == height)
519 if(ui->cbDesktopSize->findText(curSize) == -1)
520 ui->cbDesktopSize->addItem(curSize);
526void CDlgSetFreeRDP::on_rbAudioDisable_toggled(
bool checked)
528 ui->leRdpSnd->setEnabled(!checked);
531void CDlgSetFreeRDP::on_rbAudioLocal_toggled(
bool checked)
533 ui->leRdpSnd->setEnabled(checked);
536void CDlgSetFreeRDP::on_rbAudioRemote_toggled(
bool checked)
538 ui->leRdpSnd->setEnabled(!checked);
539 ui->leAudin->setEnabled(!checked);
540 ui->cbAudin->setEnabled(!checked);
543bool CDlgSetFreeRDP::HasAudioOutput()
545#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
546 auto d = QMediaDevices::defaultAudioOutput();
549 return !QAudioDeviceInfo::defaultOutputDevice().isNull();
553bool CDlgSetFreeRDP::HasAudioInput()
555#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
556 auto d = QMediaDevices::defaultAudioInput();
559 return !QAudioDeviceInfo::defaultInputDevice().isNull();
563void CDlgSetFreeRDP::on_pbSizeEdit_clicked()
567 for(
int i = 0; i < ui->cbDesktopSize->count(); i++)
568 lstSize << ui->cbDesktopSize->itemText(i);
569 dlg.SetDesktopSizes(lstSize);
570 if(QDialog::Accepted == RC_SHOW_WINDOW(&dlg))
572 ui->cbDesktopSize->clear();
573 foreach(
auto s, dlg.GetDesktopSize())
575 InsertDesktopSize(s);
580void CDlgSetFreeRDP::on_pbDriveClearAll_clicked()
582 ui->tvDrive->clearSelection();
583 ShowDriveSelected(0);
586void CDlgSetFreeRDP::slotSelectionChanged(
const QItemSelection &selected,
587 const QItemSelection &deselected)
589 QModelIndexList s = ui->tvDrive->selectionModel()->selectedRows(0);
590 ShowDriveSelected(s.size());
593int CDlgSetFreeRDP::ShowDriveSelected(
int counts)
595 ui->lbDriveSelected->setText(tr(
"Selected counts: ") + QString::number(counts));
599void CDlgSetFreeRDP::on_cbAllMonitor_stateChanged(
int arg1)
601 on_rbLocalScreen_clicked(
true);
604void CDlgSetFreeRDP::on_cbSecurityEnable_stateChanged(
int arg1)
607 m_pButtonGroup->deleteLater();
608 m_pButtonGroup =
nullptr;
610 if(!ui->cbSecurityEnable->isChecked()) {
611 m_pButtonGroup =
new QButtonGroup(
this);
612 m_pButtonGroup->addButton(ui->cbSecurityRDP);
613 m_pButtonGroup->addButton(ui->cbSecurityTls);
614 m_pButtonGroup->addButton(ui->cbSecurityNLA);
615 m_pButtonGroup->addButton(ui->cbSecurityNlaExt);
616 m_pButtonGroup->addButton(ui->cbSecurityRDSAAD);
617 m_pButtonGroup->addButton(ui->cbSecurityRDSTLS);
621void CDlgSetFreeRDP::on_cbConnectType_currentIndexChanged(
int index)
623 UINT32 type = ui->cbConnectType->itemData(index).toUInt();
624 if(0 >= type || CONNECTION_TYPE_AUTODETECT < type)
627 UINT32 performanceFlags = m_vPerformanceFlags[type - 1];
628 if(CONNECTION_TYPE_AUTODETECT == type)
630 performanceFlags = PERF_ENABLE_FONT_SMOOTHING | PERF_ENABLE_DESKTOP_COMPOSITION;
633 ui->cbDesktopBackground->setChecked(!(PERF_DISABLE_WALLPAPER & performanceFlags));
634 ui->cbWindowDrag->setChecked(!(PERF_DISABLE_FULLWINDOWDRAG & performanceFlags));
635 ui->cbMenuAnims->setChecked(!(PERF_DISABLE_MENUANIMATIONS & performanceFlags));
636 ui->cbThemes->setChecked(!(PERF_DISABLE_THEMING & performanceFlags));
637 ui->cbFontSmoothing->setChecked(PERF_ENABLE_FONT_SMOOTHING & performanceFlags);
638 ui->cbDesktopCompositing->setChecked(PERF_ENABLE_DESKTOP_COMPOSITION & performanceFlags);
640 ui->cbDesktopBackground->setEnabled(!(CONNECTION_TYPE_AUTODETECT == type));
641 ui->cbWindowDrag->setEnabled(!(CONNECTION_TYPE_AUTODETECT == type));
642 ui->cbMenuAnims->setEnabled(!(CONNECTION_TYPE_AUTODETECT == type));
643 ui->cbThemes->setEnabled(!(CONNECTION_TYPE_AUTODETECT == type));
644 ui->cbFontSmoothing->setEnabled(!(CONNECTION_TYPE_AUTODETECT == type));
645 ui->cbDesktopCompositing->setEnabled(!(CONNECTION_TYPE_AUTODETECT == type));
648void CDlgSetFreeRDP::InsertView(QWidget* pView,
int pos)
655 check = connect(
this, SIGNAL(accepted()), pView, SLOT(slotAccept()));
658 szMsg =
"Class '" + QString(pView->metaObject()->className())
659 +
"' must has slot slotAccept(), please add it. "
660 +
"Or the class derived from CParameterUI";
661 qCritical(log) << szMsg;
663 Q_ASSERT_X(check,
"CDlgSetFreeRDP", szMsg.toStdString().c_str());
666 bool bScroll =
false;
669 nWidth = qMax(nWidth, pView->frameSize().width());
670 nHeigth = qMax(nHeigth, pView->frameSize().height());
672 QSize size = this->size();
673 if(nWidth > size.width() || nHeigth > size.height())
679 QScrollArea* pScroll =
new QScrollArea(ui->tabWidget);
681 pScroll->setWidget(pView);
684 ui->tabWidget->insertTab(pos, p, pView->windowIcon(), pView->windowTitle());
688void CDlgSetFreeRDP::AddViewers(
const QList<QWidget *> &wViewer)
692 foreach(
auto p, wViewer) {
694 nWidth = qMax(nWidth, p->frameSize().width());
695 nHeigth = qMax(nHeigth, p->frameSize().height());
697 bool bScroll =
false;
701 QSize size = this->size();
702 if(nWidth > size.width() || nHeigth > size.height())
706 foreach(
auto p, wViewer)
712 QScrollArea* pScroll =
new QScrollArea(ui->tabWidget);
713 if(!pScroll)
continue;
714 pScroll->setWidget(p);
717 ui->tabWidget->addTab(pView, p->windowIcon(), p->windowTitle());
719 check = connect(
this, SIGNAL(accepted()), p, SLOT(slotAccept()));
722 szMsg =
"Class '" + QString(p->metaObject()->className())
723 +
"' must has slot slotAccept(), please add it. "
724 +
"Or the class derived from CParameterUI";
725 qCritical(log) << szMsg;
727 Q_ASSERT_X(check,
"CParameterDlgSettings", szMsg.toStdString().c_str());
[Declare CParameterFreeRDP]