- Timestamp:
- Apr 5, 2016 10:50:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp
r60276 r60329 103 103 /* Translate text-browser contents: */ 104 104 QStringList info; 105 info << tr("Certificate Version Number: %1").arg(m_certificate.GetVersionNumber()); 105 KCertificateVersion ver = (m_certificate.GetVersionNumber()); 106 info << tr("Certificate Version Number: %1").arg(ver); 106 107 info << tr("Certificate Serial Number: 0x%1").arg(m_certificate.GetSerialNumber()); 107 108 info << tr("Certificate Authority (CA): %1").arg(m_certificate.GetCertificateAuthority() ? tr("True") : tr("False")); … … 174 175 CCertificate certificate = pAppliance->GetCertificate(); 175 176 /* Check whether certificate exists and verified: */ 176 if (certificate. CheckExistence() && !certificate.IsVerified())177 if (certificate.GetPresence()) 177 178 { 178 /* Create certificate viewer to notify user about it is not verified: */ 179 QPointer<UIApplianceCertificateViewer> pDialog = 180 new UIApplianceCertificateViewer(this, certificate); 181 AssertPtrReturnVoid(pDialog.data()); 182 { 183 /* Show viewer in modal mode: */ 184 pDialog->exec(); 185 /* Leave if destroyed prematurely: */ 186 if (!pDialog) 187 return; 188 /* Delete viewer finally: */ 189 delete pDialog; 190 pDialog = 0; 179 if(certificate.GetVerified()) 180 { 181 if(!certificate.GetTrusted() || certificate.GetSelfSigned()) 182 { 183 /* Create certificate viewer to notify user about it is not verified: */ 184 QPointer<UIApplianceCertificateViewer> pDialog = 185 new UIApplianceCertificateViewer(this, certificate); 186 AssertPtrReturnVoid(pDialog.data()); 187 { 188 /* Show viewer in modal mode: */ 189 pDialog->exec(); 190 /* Leave if destroyed prematurely: */ 191 if (!pDialog) 192 return; 193 /* Delete viewer finally: */ 194 delete pDialog; 195 pDialog = 0; 196 } 197 } 198 } 199 else 200 { 201 /* Translate page: */ 202 retranslateUi(); 203 /* Create dialog: */ 204 QDialog *pDialog = new QDialog(this, Qt::Dialog); 205 AssertPtrReturnVoid(pDialog); 206 /* Create layout: */ 207 QVBoxLayout *pLayout = new QVBoxLayout(pDialog); 208 AssertPtrReturnVoid(pLayout); 209 { 210 /* Prepare dialog: */ 211 pDialog->resize(500, 100); 212 /*todo: show an error message and prohibit OVF import */ 213 { 214 /* Create text-label: */ 215 QLabel *m_pTextLabel = new QLabel; 216 AssertPtrReturnVoid(m_pTextLabel); 217 { 218 /* Configure text-label: */ 219 m_pTextLabel->setWordWrap(true); 220 m_pTextLabel->setText(tr("<b>The X509 certificate exists but hasn't been verified." 221 "You should stop here and interrupt the importing process.</b>")); 222 /* Add text-label into layout: */ 223 pLayout->addWidget(m_pTextLabel); 224 } 225 226 pLayout->addStretch(); 227 228 /* Create button-box: */ 229 QIDialogButtonBox *pButtonBox = new QIDialogButtonBox; 230 AssertPtrReturnVoid(pButtonBox); 231 { 232 /* Configure button-box: */ 233 pButtonBox->setStandardButtons(QDialogButtonBox::Ok); 234 pButtonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::Key_Enter); 235 connect(pButtonBox, SIGNAL(accepted()), this, SLOT(close())); 236 /* Add button-box into layout: */ 237 pLayout->addWidget(pButtonBox); 238 } 239 } 240 /* Show dialog in modal mode: */ 241 pDialog->exec(); 242 /* Delete dialog finally: */ 243 delete pDialog; 244 pDialog = 0; 245 } 191 246 } 192 247 }
Note:
See TracChangeset
for help on using the changeset viewer.