Changeset 78852 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 29, 2019 2:16:05 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.cpp
r78063 r78852 19 19 #include <QDialogButtonBox> 20 20 #include <QLabel> 21 #include <QPrintDialog> 22 #include <QPrinter> 21 23 #include <QPushButton> 22 24 #include <QTextEdit> … … 25 27 26 28 /* GUI includes: */ 29 #include "QIDialog.h" 30 #include "QIFileDialog.h" 31 #include "VBoxGlobal.h" 32 #include "UIMessageCenter.h" 27 33 #include "UIWizardImportApp.h" 28 34 #include "UIWizardImportAppPageBasic1.h" 29 35 #include "UIWizardImportAppPageBasic2.h" 30 36 #include "UIWizardImportAppPageExpert.h" 31 #include "VBoxGlobal.h" 32 #include "QIDialog.h" 33 #include "QIFileDialog.h" 34 35 #include <QPrintDialog> 36 #include <QPrinter> 37 38 /* COM includes: */ 39 #include "CProgress.h" 37 40 38 41 … … 194 197 bool UIWizardImportApp::importAppliance() 195 198 { 196 /* Get import appliance widget: */ 197 UIApplianceImportEditorWidget *pImportApplianceWidget = field("applianceWidget").value<ImportAppliancePointer>(); 198 /* Make sure the final values are puted back: */ 199 pImportApplianceWidget->prepareImport(); 200 /* Check if there are license agreements the user must confirm: */ 201 QList < QPair <QString, QString> > licAgreements = pImportApplianceWidget->licenseAgreements(); 202 if (!licAgreements.isEmpty()) 203 { 204 UIImportLicenseViewer ilv(this); 205 for (int i = 0; i < licAgreements.size(); ++ i) 206 { 207 const QPair <QString, QString> &lic = licAgreements.at(i); 208 ilv.setContents(lic.first, lic.second); 209 if (ilv.exec() == QDialog::Rejected) 210 return false; 211 } 212 } 213 /* Now import all virtual systems: */ 214 return pImportApplianceWidget->import(); 199 /* Check whether there was cloud source selected: */ 200 const bool fIsSourceCloudOne = field("isSourceCloudOne").toBool(); 201 if (fIsSourceCloudOne) 202 { 203 /* Acquire prepared appliance: */ 204 CAppliance comAppliance = field("appliance").value<CAppliance>(); 205 AssertReturn(!comAppliance.isNull(), false); 206 207 /* No options for cloud VMs for now: */ 208 QVector<KImportOptions> options; 209 210 /* Initiate import porocedure: */ 211 CProgress comProgress = comAppliance.ImportMachines(options); 212 213 /* Show error message if necessary: */ 214 if (!comAppliance.isOk()) 215 msgCenter().cannotImportAppliance(comAppliance, this); 216 else 217 { 218 /* Show "Import appliance" progress: */ 219 msgCenter().showModalProgressDialog(comProgress, tr("Importing Appliance ..."), ":/progress_import_90px.png", this, 0); 220 if (!comProgress.GetCanceled()) 221 { 222 /* Show error message if necessary: */ 223 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 224 msgCenter().cannotImportAppliance(comProgress, comAppliance.GetPath(), this); 225 else 226 return true; 227 } 228 } 229 230 /* Failure by default: */ 231 return false; 232 } 233 else 234 { 235 /* Get import appliance widget: */ 236 UIApplianceImportEditorWidget *pImportApplianceWidget = field("applianceWidget").value<ImportAppliancePointer>(); 237 /* Make sure the final values are puted back: */ 238 pImportApplianceWidget->prepareImport(); 239 /* Check if there are license agreements the user must confirm: */ 240 QList < QPair <QString, QString> > licAgreements = pImportApplianceWidget->licenseAgreements(); 241 if (!licAgreements.isEmpty()) 242 { 243 UIImportLicenseViewer ilv(this); 244 for (int i = 0; i < licAgreements.size(); ++ i) 245 { 246 const QPair <QString, QString> &lic = licAgreements.at(i); 247 ilv.setContents(lic.first, lic.second); 248 if (ilv.exec() == QDialog::Rejected) 249 return false; 250 } 251 } 252 /* Now import all virtual systems: */ 253 return pImportApplianceWidget->import(); 254 } 215 255 } 216 256
Note:
See TracChangeset
for help on using the changeset viewer.