Rabbit Remote Control 0.1.0-bate10
Loading...
Searching...
No Matches
Public Member Functions | Private Slots | Private Attributes | List of all members
CParameterServerUI Class Reference

The server base parameters UI. More...

#include <ParameterServerUI.h>

Inheritance diagram for CParameterServerUI:
Inheritance graph
[legend]
Collaboration diagram for CParameterServerUI:
Collaboration graph
[legend]

Public Member Functions

 CParameterServerUI (QWidget *parent=nullptr)
 
virtual int SetParameter (CParameter *pParameter) override
 [override functions]
 
virtual bool CheckValidity (bool validity) override
 Check parameters validity.
 
virtual int Accept () override
 Accept parameters.
 
- Public Member Functions inherited from CParameterUI
 CParameterUI (QWidget *parent=nullptr)
 

Private Slots

void on_cbListenAll_checkStateChanged (const Qt::CheckState &arg1)
 

Private Attributes

Ui::CParameterServerUI * ui
 
CParameterServerm_pPara
 
QStandardItemModel m_ModelNetWorkInterface
 
CParameterFilterUIm_pWhitelist
 
CParameterFilterUIm_pBlacklist
 

Additional Inherited Members

- Public Slots inherited from CParameterUI
virtual void slotSetParameter (CParameter *pParameter)
 [override functions]
 
virtual void slotAccept ()
 Accept parameters.
 

Detailed Description

The server base parameters UI.

Definition at line 18 of file ParameterServerUI.h.

Constructor & Destructor Documentation

◆ ~CParameterServerUI()

CParameterServerUI::~CParameterServerUI ( )

Definition at line 30 of file ParameterServerUI.cpp.

Member Function Documentation

◆ Accept()

int CParameterServerUI::Accept ( )
overridevirtual

Accept parameters.

If necessary, you can call CheckValidity first.

void CDlgSetFreeRDP::on_pbOk_clicked()
{
int nRet = 0;
if(!ui->wNet->CheckValidity(true)) {
ui->tabWidget->setCurrentIndex(0);
return;
}
if(!m_pProxyUI->CheckValidity(true)) {
ui->tabWidget->setCurrentWidget(m_pProxyUI);
return;
}
if(!m_pRecordUI->CheckValidity(true)) {
ui->tabWidget->setCurrentWidget(m_pRecordUI);
return;
}
m_pSettings->SetName(ui->leName->text());
// Server
m_pSettings->SetDomain(ui->leDomain->text());
nRet = ui->wNet->Accept();
if(nRet) return;
nRet = m_pProxyUI->Accept();
if(nRet) return;
nRet = m_pRecordUI->Accept();
if(nRet) return;
m_pSettings->SetOnlyView(ui->cbOnlyView->isChecked());
m_pSettings->SetClipboard(ui->cbClipboard->isChecked());
m_pSettings->SetShowServerName(ui->cbShowServerName->isChecked());
// Display
m_pSettings->SetUseMultimon(ui->cbAllMonitor->isChecked());
QString szSize = ui->cbDesktopSize->currentText();
int index = szSize.indexOf("×");
if(-1 < index)
{
UINT32 width = szSize.left(index).toInt();
UINT32 height = szSize.right(szSize.length() - index - 1).toInt();
m_pSettings->SetDesktopWidth(width);
m_pSettings->SetDesktopHeight(height);
}
m_pSettings->SetColorDepth(ui->cbColorDepth->currentData().toInt());
m_pSettings->SetReconnectInterval(ui->sbReconnect->value());
// Redirection
m_pSettings->SetRedirectionPrinter(ui->cbPrinter->isChecked());
m_pSettings->SetEnableLocalInputMethod(ui->cbEnableLocalInputMethod->isChecked());
if(HasAudioOutput()) {
CParameterFreeRDP::RedirecionSoundType tRdirectionSound
= CParameterFreeRDP::RedirecionSoundType::Disable;
if(ui->rbAudioDisable->isChecked())
tRdirectionSound = CParameterFreeRDP::RedirecionSoundType::Disable;
else if(ui->rbAudioLocal->isChecked())
tRdirectionSound = CParameterFreeRDP::RedirecionSoundType::Local;
else if(ui->rbAudioRemote->isChecked())
tRdirectionSound = CParameterFreeRDP::RedirecionSoundType::Remote;
m_pSettings->SetRedirectionSound(tRdirectionSound);
} else {
m_pSettings->SetRedirectionSound(
CParameterFreeRDP::RedirecionSoundType::Disable);
}
m_pSettings->SetRedirectionSoundParameters(ui->leRdpSnd->text());
if(HasAudioInput())
m_pSettings->SetRedirectionMicrophone(ui->cbAudin->isChecked());
else
m_pSettings->SetRedirectionMicrophone(false);
m_pSettings->SetRedirectionMicrophoneParameters(ui->leAudin->text());
QStringList lstDrives;
//获取选中的行,默认获取选中行的第一列数据(0),列的索引值和上面一样0、1、2、3......
QModelIndexList selected = ui->tvDrive->selectionModel()->selectedRows(0);
QList<QModelIndex>::iterator it;
QModelIndex modelIndex;
QString szPath;
for (it = selected.begin(); it != selected.end(); ++it)
{
modelIndex = *it;
szPath = m_pFileModel->filePath(modelIndex);
if(!szPath.isEmpty())
lstDrives.append(szPath);
}
m_pSettings->SetRedirectionDrives(lstDrives);
// Security
m_pSettings->SetNegotiateSecurityLayer(ui->cbSecurityEnable->isChecked());
uint security = 0;
if(ui->cbSecurityRDP->isChecked())
security |= CParameterFreeRDP::Security::RDP;
if(ui->cbSecurityTls->isChecked())
security |= CParameterFreeRDP::Security::TLS;
if(ui->cbSecurityNLA->isChecked())
security |= CParameterFreeRDP::Security::NLA;
if(ui->cbSecurityNlaExt->isChecked())
security |= CParameterFreeRDP::Security::NLA_Ext;
if(ui->cbSecurityRDSTLS->isChecked())
security |= CParameterFreeRDP::Security::RDSTLS;
if(ui->cbSecurityRDSAAD->isChecked())
security |= CParameterFreeRDP::Security::RDSAAD;
m_pSettings->SetSecurity((CParameterFreeRDP::Security)security);
// Tls version
if(ui->rbTls1_0->isChecked())
m_pSettings->SetTlsVersion(TLS1_VERSION);
else if(ui->rbTls1_1->isChecked())
m_pSettings->SetTlsVersion(TLS1_1_VERSION);
else if(ui->rbTls1_2->isChecked())
m_pSettings->SetTlsVersion(TLS1_2_VERSION);
else if(ui->rbTls1_3->isChecked())
m_pSettings->SetTlsVersion(TLS1_3_VERSION);
// Connect type
m_pSettings->SetConnectType(ui->cbConnectType->currentData().toUInt());
// Performance flags
UINT32 performanceFlags = 0;
if(!ui->cbDesktopBackground->isChecked())
performanceFlags |= PERF_DISABLE_WALLPAPER;
if(!ui->cbWindowDrag->isChecked())
performanceFlags |= PERF_DISABLE_FULLWINDOWDRAG;
if(!ui->cbMenuAnims->isChecked())
performanceFlags |= PERF_DISABLE_MENUANIMATIONS;
if(!ui->cbThemes->isChecked())
performanceFlags |= PERF_DISABLE_THEMING;
if(ui->cbFontSmoothing->isChecked())
performanceFlags |= PERF_ENABLE_FONT_SMOOTHING;
if(ui->cbDesktopCompositing->isChecked())
performanceFlags |= PERF_ENABLE_DESKTOP_COMPOSITION;
m_pSettings->SetPerformanceFlags(performanceFlags);
accept();
}
Returns
0 is success. otherwise is fail

Implements CParameterUI.

Definition at line 83 of file ParameterServerUI.cpp.

◆ CheckValidity()

bool CParameterServerUI::CheckValidity ( bool  validity)
overridevirtual

Check parameters validity.

Parameters
validity
  • true: Check parameters
  • false: Not check parameters

Reimplemented from CParameterUI.

Definition at line 110 of file ParameterServerUI.cpp.

◆ on_cbListenAll_checkStateChanged

void CParameterServerUI::on_cbListenAll_checkStateChanged ( const Qt::CheckState &  arg1)
privateslot

Definition at line 118 of file ParameterServerUI.cpp.

◆ SetParameter()

int CParameterServerUI::SetParameter ( CParameter pParameter)
overridevirtual

[override functions]

Set the parameters and initialize the user interface

Parameters
pParameterRelated parameters. Convert to the appropriate type in the overloaded function.

Implements CParameterUI.

Definition at line 35 of file ParameterServerUI.cpp.

Member Data Documentation

◆ m_ModelNetWorkInterface

QStandardItemModel CParameterServerUI::m_ModelNetWorkInterface
private

Definition at line 36 of file ParameterServerUI.h.

◆ m_pBlacklist

CParameterFilterUI* CParameterServerUI::m_pBlacklist
private

Definition at line 38 of file ParameterServerUI.h.

◆ m_pPara

CParameterServer* CParameterServerUI::m_pPara
private

Definition at line 35 of file ParameterServerUI.h.

◆ m_pWhitelist

CParameterFilterUI* CParameterServerUI::m_pWhitelist
private

Definition at line 37 of file ParameterServerUI.h.

◆ ui

Ui::CParameterServerUI* CParameterServerUI::ui
private

Definition at line 34 of file ParameterServerUI.h.


The documentation for this class was generated from the following files: