Rabbit Remote Control 0.1.0-bate8
Loading...
Searching...
No Matches
Public Member Functions | Private Slots | Private Attributes | List of all members
CParameterDatabaseUI Class Reference
Inheritance diagram for CParameterDatabaseUI:
Inheritance graph
[legend]
Collaboration diagram for CParameterDatabaseUI:
Collaboration graph
[legend]

Public Member Functions

 CParameterDatabaseUI (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.
 
virtual bool eventFilter (QObject *watched, QEvent *event) override
 
- Public Member Functions inherited from CParameterUI
 CParameterUI (QWidget *parent=nullptr)
 

Private Slots

void slotTypeCurrentTextChanged (const QString &text)
 
void on_pbBrowser_clicked ()
 
void on_rbSaveSettingsToDatabase_toggled (bool checked)
 
void on_pbTest_clicked ()
 

Private Attributes

Ui::CParameterDatabaseUI * ui
 
CParameterDatabasem_pParaDB
 
CParameterGlobalm_pParaGlobal
 
CParameterNet m_Net
 

Additional Inherited Members

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

Detailed Description

Definition at line 11 of file ParameterDatabaseUI.h.

Constructor & Destructor Documentation

◆ ~CParameterDatabaseUI()

CParameterDatabaseUI::~CParameterDatabaseUI ( )

Definition at line 48 of file ParameterDatabaseUI.cpp.

Member Function Documentation

◆ Accept()

int CParameterDatabaseUI::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 109 of file ParameterDatabaseUI.cpp.

◆ CheckValidity()

bool CParameterDatabaseUI::CheckValidity ( bool  validity)
overridevirtual

Check parameters validity.

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

Reimplemented from CParameterUI.

Definition at line 83 of file ParameterDatabaseUI.cpp.

◆ eventFilter()

bool CParameterDatabaseUI::eventFilter ( QObject *  watched,
QEvent *  event 
)
overridevirtual

Definition at line 181 of file ParameterDatabaseUI.cpp.

◆ on_pbBrowser_clicked

void CParameterDatabaseUI::on_pbBrowser_clicked ( )
privateslot

Definition at line 167 of file ParameterDatabaseUI.cpp.

◆ on_pbTest_clicked

void CParameterDatabaseUI::on_pbTest_clicked ( )
privateslot

Definition at line 200 of file ParameterDatabaseUI.cpp.

◆ on_rbSaveSettingsToDatabase_toggled

void CParameterDatabaseUI::on_rbSaveSettingsToDatabase_toggled ( bool  checked)
privateslot

Definition at line 195 of file ParameterDatabaseUI.cpp.

◆ SetParameter()

int CParameterDatabaseUI::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 53 of file ParameterDatabaseUI.cpp.

◆ slotTypeCurrentTextChanged

void CParameterDatabaseUI::slotTypeCurrentTextChanged ( const QString &  text)
privateslot

Definition at line 127 of file ParameterDatabaseUI.cpp.

Member Data Documentation

◆ m_Net

CParameterNet CParameterDatabaseUI::m_Net
private

Definition at line 37 of file ParameterDatabaseUI.h.

◆ m_pParaDB

CParameterDatabase* CParameterDatabaseUI::m_pParaDB
private

Definition at line 35 of file ParameterDatabaseUI.h.

◆ m_pParaGlobal

CParameterGlobal* CParameterDatabaseUI::m_pParaGlobal
private

Definition at line 36 of file ParameterDatabaseUI.h.

◆ ui

Ui::CParameterDatabaseUI* CParameterDatabaseUI::ui
private

Definition at line 34 of file ParameterDatabaseUI.h.


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