- Timestamp:
- Jul 7, 2019 11:32:06 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.cpp
r79312 r79574 67 67 bool UIWizardNewCloudVM::createCloudVM() 68 68 { 69 /* Acquire prepared client and description: */ 70 CCloudClient comCloudClient = field("client").value<CCloudClient>(); 71 CVirtualSystemDescription comDescription = field("vsd").value<CVirtualSystemDescription>(); 72 AssertReturn(comCloudClient.isNotNull() && comDescription.isNotNull(), false); 69 /* Prepare result: */ 70 bool fResult = false; 73 71 74 /* Initiate cloud VM creation porocedure: */ 75 CProgress comProgress = comCloudClient.LaunchVM(comDescription); 72 /* Main API request sequence, can be interrupted after any step: */ 73 do 74 { 75 /* Acquire prepared client and description: */ 76 CCloudClient comClient = field("client").value<CCloudClient>(); 77 CVirtualSystemDescription comDescription = field("vsd").value<CVirtualSystemDescription>(); 78 AssertReturn(comClient.isNotNull() && comDescription.isNotNull(), false); 76 79 77 /* Show error message if necessary: */ 78 if (!comCloudClient.isOk()) 79 msgCenter().cannotCreateCloudMachine(comCloudClient, this); 80 else 81 { 80 /* Initiate cloud VM creation procedure: */ 81 CProgress comProgress = comClient.LaunchVM(comDescription); 82 if (!comClient.isOk()) 83 { 84 msgCenter().cannotCreateCloudMachine(comClient, this); 85 break; 86 } 87 82 88 /* Show "Create Cloud Machine" progress: */ 83 msgCenter().showModalProgressDialog(comProgress, tr("Create Cloud Machine ..."), ":/progress_new_cloud_vm_90px.png", this, 0); 84 if (!comProgress.GetCanceled()) 89 msgCenter().showModalProgressDialog(comProgress, tr("Create Cloud Machine ..."), 90 ":/progress_new_cloud_vm_90px.png", this, 0); 91 if (comProgress.GetCanceled()) 92 break; 93 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 85 94 { 86 /* Show error message if necessary: */ 87 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 88 msgCenter().cannotCreateCloudMachine(comProgress, this); 89 else 90 return true; 95 msgCenter().cannotCreateCloudMachine(comProgress, this); 96 break; 91 97 } 98 99 /* Finally, success: */ 100 fResult = true; 92 101 } 102 while (0); 93 103 94 /* Failure by default: */95 return f alse;104 /* Return result: */ 105 return fResult; 96 106 } 97 107 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.h
r79256 r79574 51 51 virtual void prepare() /* override */; 52 52 53 /** Create cloud VM. */53 /** Create New Cloud VM. */ 54 54 bool createCloudVM(); 55 55
Note:
See TracChangeset
for help on using the changeset viewer.