- Timestamp:
- Jul 26, 2021 6:26:53 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145908
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90334 r90344 289 289 290 290 /********************************************************************************************************************************* 291 * Class UINotificationProgressApplianceExport implementation. * 292 *********************************************************************************************************************************/ 293 294 UINotificationProgressApplianceExport::UINotificationProgressApplianceExport(const CAppliance &comAppliance, 295 const QString &strFormat, 296 const QVector<KExportOptions> &options, 297 const QString &strPath) 298 : m_comAppliance(comAppliance) 299 , m_strFormat(strFormat) 300 , m_options(options) 301 , m_strPath(strPath) 302 { 303 } 304 305 QString UINotificationProgressApplianceExport::name() const 306 { 307 return UINotificationProgress::tr("Exporting appliance ..."); 308 } 309 310 QString UINotificationProgressApplianceExport::details() const 311 { 312 return UINotificationProgress::tr("<b>To:</b> %1").arg(m_strPath); 313 } 314 315 CProgress UINotificationProgressApplianceExport::createProgress(COMResult &comResult) 316 { 317 /* Initialize progress-wrapper: */ 318 CProgress comProgress = m_comAppliance.Write(m_strFormat, m_options, m_strPath); 319 /* Store COM result: */ 320 comResult = m_comAppliance; 321 /* Return progress-wrapper: */ 322 return comProgress; 323 } 324 325 326 /********************************************************************************************************************************* 291 327 * Class UINotificationProgressApplianceImport implementation. * 292 328 *********************************************************************************************************************************/ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90334 r90344 318 318 }; 319 319 320 /** UINotificationProgress extension for export appliance functionality. */ 321 class SHARED_LIBRARY_STUFF UINotificationProgressApplianceExport : public UINotificationProgress 322 { 323 Q_OBJECT; 324 325 public: 326 327 /** Constructs export appliance notification-progress. 328 * @param comAppliance Brings the appliance being exported. 329 * @param strFormat Brings the appliance format. 330 * @param options Brings the export options to be taken into account. 331 * @param strPath Brings the appliance path. */ 332 UINotificationProgressApplianceExport(const CAppliance &comAppliance, 333 const QString &strFormat, 334 const QVector<KExportOptions> &options, 335 const QString &strPath); 336 337 protected: 338 339 /** Returns object name. */ 340 virtual QString name() const /* override final */; 341 /** Returns object details. */ 342 virtual QString details() const /* override final */; 343 /** Creates and returns started progress-wrapper. */ 344 virtual CProgress createProgress(COMResult &comResult) /* override final */; 345 346 private: 347 348 /** Holds the appliance being exported. */ 349 CAppliance m_comAppliance; 350 /** Holds the appliance format. */ 351 QString m_strFormat; 352 /** Holds the export options to be taken into account. */ 353 QVector<KExportOptions> m_options; 354 /** Holds the appliance path. */ 355 QString m_strPath; 356 }; 357 320 358 /** UINotificationProgress extension for import appliance functionality. */ 321 359 class SHARED_LIBRARY_STUFF UINotificationProgressApplianceImport : public UINotificationProgress … … 342 380 private: 343 381 344 /** Holds the medium being moved. */382 /** Holds the appliance being imported. */ 345 383 CAppliance m_comAppliance; 346 /** Holds the i nitial location. */384 /** Holds the import options to be taken into account. */ 347 385 QVector<KImportOptions> m_options; 348 386 }; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r89979 r90344 25 25 #include "UIMessageCenter.h" 26 26 #include "UIModalWindowManager.h" 27 #include "UINotificationCenter.h" 27 28 #include "UIWizardExportApp.h" 28 29 #include "UIWizardExportAppDefs.h" … … 349 350 if (iWizardResult == QDialog::Rejected) 350 351 break; 351 } 352 353 /* Prepare Export VM progress: */ 354 CProgress comProgress = comAppliance.Write(field("format").toString(), options, uri()); 355 if (!comAppliance.isOk()) 356 { 357 msgCenter().cannotExportAppliance(comAppliance, this); 358 break; 359 } 360 361 /* Show Export VM progress: */ 362 msgCenter().showModalProgressDialog(comProgress, QApplication::translate("UIWizardExportApp", "Exporting Appliance ..."), 363 ":/progress_export_90px.png", this); 364 if (comProgress.GetCanceled()) 365 break; 366 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 367 { 368 msgCenter().cannotExportAppliance(comProgress, comAppliance.GetPath(), this); 369 break; 370 } 371 372 /* Is this VM being exported to cloud? */ 373 if (field("isFormatCloudOne").toBool()) 374 { 352 353 /* Prepare Export VM progress: */ 354 CProgress comProgress = comAppliance.Write(field("format").toString(), options, uri()); 355 if (!comAppliance.isOk()) 356 { 357 msgCenter().cannotExportAppliance(comAppliance, this); 358 break; 359 } 360 361 /* Show Export VM progress: */ 362 msgCenter().showModalProgressDialog(comProgress, QApplication::translate("UIWizardExportApp", "Exporting Appliance ..."), 363 ":/progress_export_90px.png", this); 364 if (comProgress.GetCanceled()) 365 break; 366 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 367 { 368 msgCenter().cannotExportAppliance(comProgress, comAppliance.GetPath(), this); 369 break; 370 } 371 375 372 /* We can have wizard and it's result 376 373 * should be distinguishable: */ 377 i nt iWizardResult = -1;374 iWizardResult = -1; 378 375 379 376 switch (field("cloudExportMode").value<CloudExportMode>()) … … 410 407 break; 411 408 } 409 /* Is this VM being exported locally? */ 410 else 411 { 412 /* Export appliance: */ 413 UINotificationProgressApplianceExport *pNotification = new UINotificationProgressApplianceExport(comAppliance, 414 field("format").toString(), 415 options, 416 uri()); 417 notificationCenter().append(pNotification); 418 } 412 419 413 420 /* Success finally: */
Note:
See TracChangeset
for help on using the changeset viewer.