Changeset 90760 in vbox for trunk/src/VBox
- Timestamp:
- Aug 20, 2021 3:06:17 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r90564 r90760 2510 2510 } 2511 2511 2512 bool UICommon::launchMachine(CCloudMachine &comMachine)2513 {2514 /* Acquire machine name: */2515 const QString strName = comMachine.GetName();2516 if (!comMachine.isOk())2517 {2518 msgCenter().cannotAcquireCloudMachineParameter(comMachine);2519 return false;2520 }2521 2522 /* Prepare machine power up: */2523 CProgress comProgress = comMachine.PowerUp();2524 if (!comMachine.isOk())2525 {2526 msgCenter().cannotPowerUpCloudMachine(comMachine);2527 return false;2528 }2529 2530 /* Show machine power up progress: */2531 msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_start_90px.png", 0, 0);2532 if (!comProgress.isOk() || comProgress.GetResultCode() != 0)2533 {2534 msgCenter().cannotPowerUpCloudMachine(comProgress, strName);2535 return false;2536 }2537 2538 /* Success by default: */2539 return true;2540 }2541 2542 2512 CSession UICommon::openSession(const QUuid &uId, KLockType lockType /* = KLockType_Shared */) 2543 2513 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r90538 r90760 509 509 /** Launches certain @a comMachine in specified @a enmLaunchMode. */ 510 510 bool launchMachine(CMachine &comMachine, LaunchMode enmLaunchMode = LaunchMode_Default); 511 /** Launches certain @a comMachine. */512 bool launchMachine(CCloudMachine &comMachine);513 511 514 512 /** Opens session of certain @a enmLockType for VM with certain @a uId. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r90714 r90760 2478 2478 } 2479 2479 2480 void UIVirtualBoxManager::launchMachine(CCloudMachine &comMachine) 2481 { 2482 /* Powering cloud VM up: */ 2483 UINotificationProgressCloudMachinePowerUp *pNotification = 2484 new UINotificationProgressCloudMachinePowerUp(comMachine); 2485 gpNotificationCenter->append(pNotification); 2486 } 2487 2480 2488 void UIVirtualBoxManager::startUnattendedInstall(CUnattended &comUnattendedInstaller, const UIUnattendedInstallData &unattendedData) 2481 2489 { … … 2574 2582 CCloudMachine comCloudMachine = pItem->toCloud()->machine(); 2575 2583 /* Launch current VM: */ 2576 uiCommon().launchMachine(comCloudMachine); 2577 /* Update info in any case: */ 2578 pItem->toCloud()->updateInfoAsync(false /* delayed? */); 2584 launchMachine(comCloudMachine); 2579 2585 } 2580 2586 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r89851 r90760 40 40 class UIVirtualBoxManagerWidget; 41 41 class UIVirtualMachineItem; 42 class CCloudMachine; 42 43 43 44 /* Type definitions: */ … … 361 362 /** Opens add machine dialog specifying initial name with @a strFileName. */ 362 363 void openAddMachineDialog(const QString &strFileName = QString()); 364 365 /** Launches certain @a comMachine. */ 366 void launchMachine(CCloudMachine &comMachine); 363 367 364 368 /** Creates an unattended installer and uses it to install guest os to newly created vm. */ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90695 r90760 1122 1122 1123 1123 /********************************************************************************************************************************* 1124 * Class UINotificationProgressCloudMachinePowerUp implementation. * 1125 *********************************************************************************************************************************/ 1126 1127 UINotificationProgressCloudMachinePowerUp::UINotificationProgressCloudMachinePowerUp(const CCloudMachine &comMachine) 1128 : m_comMachine(comMachine) 1129 { 1130 } 1131 1132 QString UINotificationProgressCloudMachinePowerUp::name() const 1133 { 1134 return UINotificationProgress::tr("Powering cloud VM up ..."); 1135 } 1136 1137 QString UINotificationProgressCloudMachinePowerUp::details() const 1138 { 1139 return UINotificationProgress::tr("<b>VM Name:</b> %1").arg(m_strName); 1140 } 1141 1142 CProgress UINotificationProgressCloudMachinePowerUp::createProgress(COMResult &comResult) 1143 { 1144 /* Acquire cloud VM name: */ 1145 m_strName = m_comMachine.GetName(); 1146 if (!m_comMachine.isOk()) 1147 { 1148 /* Store COM result: */ 1149 comResult = m_comMachine; 1150 /* Return progress-wrapper: */ 1151 return CProgress(); 1152 } 1153 1154 /* Initialize progress-wrapper: */ 1155 CProgress comProgress = m_comMachine.PowerUp(); 1156 /* Store COM result: */ 1157 comResult = m_comMachine; 1158 /* Return progress-wrapper: */ 1159 return comProgress; 1160 } 1161 1162 1163 /********************************************************************************************************************************* 1124 1164 * Class UINotificationProgressCloudMachinePowerDown implementation. * 1125 1165 *********************************************************************************************************************************/ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90695 r90760 749 749 }; 750 750 751 /** UINotificationProgress extension for cloud machine power-up functionality. */ 752 class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachinePowerUp : public UINotificationProgress 753 { 754 Q_OBJECT; 755 756 public: 757 758 /** Constructs cloud machine power-up notification-progress. 759 * @param comMachine Brings the machine being powered-up. */ 760 UINotificationProgressCloudMachinePowerUp(const CCloudMachine &comMachine); 761 762 protected: 763 764 /** Returns object name. */ 765 virtual QString name() const /* override final */; 766 /** Returns object details. */ 767 virtual QString details() const /* override final */; 768 /** Creates and returns started progress-wrapper. */ 769 virtual CProgress createProgress(COMResult &comResult) /* override final */; 770 771 private: 772 773 /** Holds the machine being powered-up. */ 774 CCloudMachine m_comMachine; 775 /** Holds the machine name. */ 776 QString m_strName; 777 }; 778 751 779 /** UINotificationProgress extension for cloud machine power-down functionality. */ 752 780 class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachinePowerDown : public UINotificationProgress
Note:
See TracChangeset
for help on using the changeset viewer.