Changeset 91578 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp
- Timestamp:
- Oct 5, 2021 5:24:33 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp
r91567 r91578 142 142 143 143 UIWizardImportAppPageBasic2::UIWizardImportAppPageBasic2(const QString &strFileName) 144 : m_enmCertText(kCertText_Uninitialized) 144 : m_strFileName(strFileName) 145 , m_enmCertText(kCertText_Uninitialized) 145 146 { 146 147 /* Create main layout: */ … … 174 175 { 175 176 m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); 176 m_pApplianceWidget->setFile(strFileName);177 177 pApplianceWidgetLayout->addWidget(m_pApplianceWidget, 0, 0, 1, 3); 178 178 } … … 370 370 /* Update widget visibility: */ 371 371 updatePageAppearance(); 372 /* Populate MAC address import combo: */373 populateMACAddressImportPolicies();374 372 375 373 /* Check whether there was cloud source selected: */ 376 374 const bool fIsSourceCloudOne = field("isSourceCloudOne").toBool(); 377 375 if (fIsSourceCloudOne) 376 { 377 /* Refresh form properties table: */ 378 378 refreshFormPropertiesTable(); 379 } 379 380 else 380 381 { 381 /* Acquire appliance: */ 382 CAppliance *pAppliance = m_pApplianceWidget->appliance(); 383 384 /* Check if pAppliance is alive. If not just return here. 385 * This prevents crashes when an invalid ova file is supllied: */ 386 if (!pAppliance) 382 /* Populate MAC address import combo: */ 383 populateMACAddressImportPolicies(); 384 385 /* If we have file name passed, 386 * check if specified file contains valid appliance: */ 387 if ( !m_strFileName.isEmpty() 388 && !qobject_cast<UIWizardImportApp*>(wizard())->setFile(m_strFileName)) 387 389 { 388 if (wizard()) 389 wizard()->reject(); 390 wizard()->reject(); 390 391 return; 391 392 } 392 393 393 /* Make sure we initialize model items with correct base folder path: */ 394 /* Acquire appliance: */ 395 CAppliance comAppliance = qobject_cast<UIWizardImportApp*>(wizard())->appliance(); 396 397 /* Initialize appliance widget: */ 398 m_pApplianceWidget->setAppliance(comAppliance); 399 /* Make sure we initialize appliance widget model with correct base folder path: */ 394 400 if (m_pEditorImportFilePath) 395 401 sltHandlePathChanged(m_pEditorImportFilePath->path()); 396 402 397 403 /* Acquire certificate: */ 398 CCertificate comCertificate = pAppliance->GetCertificate();404 CCertificate comCertificate = comAppliance.GetCertificate(); 399 405 if (comCertificate.isNull()) 400 406 m_enmCertText = kCertText_Unsigned; … … 421 427 422 428 /* Instantiate the dialog: */ 423 QPointer<UIApplianceUnverifiedCertificateViewer> pDialog = new UIApplianceUnverifiedCertificateViewer(this, comCertificate);424 AssertPtrReturnVoid(pDialog.data());429 QPointer<UIApplianceUnverifiedCertificateViewer> pDialog = 430 new UIApplianceUnverifiedCertificateViewer(this, comCertificate); 425 431 426 432 /* Show viewer in modal mode: */ … … 481 487 } 482 488 } 489 else 490 { 491 /* Make sure widget has own data committed: */ 492 m_pApplianceWidget->prepareImport(); 493 } 483 494 484 495 /* Try to import appliance: */
Note:
See TracChangeset
for help on using the changeset viewer.