| 117 | } |
| 118 | |
| 119 | int CParameterPluginUI::SetParameter(CParameter *pParameter) |
| 120 | { |
| 121 | m_pPara = qobject_cast<CParameterPlugin*>(pParameter); |
| 122 | if(!m_pPara) |
| 123 | return -1; |
| 124 | ui->gbCaptureAllKeyboard->setChecked(m_pPara->GetCaptureAllKeyboard()); |
| 125 | ui->gpDesktopShortcutsSctipt->setEnabled(ui->gbCaptureAllKeyboard->isChecked()); |
| 126 | ui->gpDesktopShortcutsSctipt->setChecked(m_pPara->GetDesktopShortcutsScript()); |
| 127 | ui->leDesktopShortcutsDisableScript->setText(m_pPara->GetDisableDesktopShortcutsScript()); |
| 128 | ui->leDesktopShortcutsRestoreScript->setText(m_pPara->GetRestoreDesktopShortcutsScript()); |
| 129 | ui->cbEnableLocalInputMethod->setChecked(m_pPara->GetEnableLocalInputMethod()); |
| 130 | ui->cbPromptAdminPrivilege->setChecked( |
| 131 | m_pPara->GetPromptAdministratorPrivilege()); |
| 132 | ui->cbEnableUserName->setChecked(m_pPara->GetEnableSystemUserToUser()); |
| 133 | ui->cbViewZoom->addItem(QIcon::fromTheme("zoom-original"), |
| 134 | tr("Original"), |
| 135 | (int)CFrmViewer::ADAPT_WINDOWS::Original); |
| 136 | /*ui->cbViewZoom->addItem(tr("Original Center"), |
| 137 | (int)CFrmViewer::ADAPT_WINDOWS::OriginalCenter);*/ |
| 138 | ui->cbViewZoom->addItem(QIcon::fromTheme("zoom"), tr("Zoom"), |
| 139 | (int)CFrmViewer::ADAPT_WINDOWS::Zoom); |
| 140 | ui->cbViewZoom->addItem(QIcon::fromTheme("zoom-fit-best"), |
| 141 | tr("Zoom to window"), |
| 142 | (int)CFrmViewer::ADAPT_WINDOWS::ZoomToWindow); |
| 143 | ui->cbViewZoom->addItem(QIcon::fromTheme("zoom-aspect-ratio"), |
| 144 | tr("Keep aspect ratio to window"), |
| 145 | (int)CFrmViewer::ADAPT_WINDOWS::KeepAspectRationToWindow); |
| 146 | int nIndex = ui->cbViewZoom->findData((int)m_pPara->GetAdaptWindows()); |
| 147 | if(-1 != nIndex) |
| 148 | ui->cbViewZoom->setCurrentIndex(nIndex); |
| 149 | |
| 150 | #if HAVE_QTKEYCHAIN |
| 151 | ui->cbSystemCredential->setChecked(m_pPara->GetUseSystemCredential()); |
| 152 | #else |
| 153 | ui->cbSystemCredential->hide(); |
| 154 | #endif |
| 155 | ui->leEncryptKey->setText(m_pPara->GetEncryptKey()); |
| 156 | ui->cbSavePassword->setChecked(m_pPara->GetSavePassword()); |
| 157 | |
| 158 | ui->cbEnableViewPassword->setChecked(m_pPara->GetViewPassowrd()); |
| 159 | ui->pbEncryptKey->setEnabled(ui->cbEnableViewPassword->isChecked()); |
| 160 | switch (m_pPara->GetPromptType()) { |
| 161 | case CParameterPlugin::PromptType::First: |
| 162 | ui->rbPromptFirst->setChecked(true); |
| 163 | break; |
| 164 | case CParameterPlugin::PromptType::No: |
| 165 | ui->rbPromptNo->setChecked(true); |
| 166 | break; |
| 167 | } |
| 168 | |
| 169 | ui->cbShowProtocol->setChecked( |
| 170 | m_pPara->GetNameStyles() & CParameterPlugin::NameStyle::Protocol); |
| 171 | ui->cbShowServerName->setChecked( |
| 172 | m_pPara->GetNameStyles() & CParameterPlugin::NameStyle::ServerName); |
| 173 | ui->cbShowSecurityLevel->setChecked( |
| 174 | m_pPara->GetNameStyles() & CParameterPlugin::NameStyle::SecurityLevel); |
| 175 | |
| 176 | return 0; |
nothing calls this directly
no test coverage detected