- Timestamp:
- Jul 29, 2021 1:54:28 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r90409 r90410 1813 1813 else if (pItem->itemType() == UIVirtualMachineItemType_CloudReal) 1814 1814 { 1815 /* Acquire cloud machine: */ 1816 CCloudMachine comCloudMachine = pItem->toCloud()->machine(); 1817 /* Prepare machine ACPI shutdown: */ 1818 CProgress comProgress = comCloudMachine.Shutdown(); 1819 if (!comCloudMachine.isOk()) 1820 msgCenter().cannotACPIShutdownCloudMachine(comCloudMachine); 1821 else 1822 { 1823 /* Show machine ACPI shutdown progress: */ 1824 msgCenter().showModalProgressDialog(comProgress, pItem->name(), ":/progress_poweroff_90px.png", 0, 0); 1825 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 1826 msgCenter().cannotACPIShutdownCloudMachine(comProgress, pItem->name()); 1827 /* Update info in any case: */ 1828 pItem->toCloud()->updateInfoAsync(false /* delayed? */); 1829 } 1815 /* Shutting cloud VM down: */ 1816 UINotificationProgressCloudMachineShutdown *pNotification = 1817 new UINotificationProgressCloudMachineShutdown(pItem->toCloud()->machine()); 1818 notificationCenter().append(pNotification); 1830 1819 } 1831 1820 } -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90409 r90410 709 709 710 710 /********************************************************************************************************************************* 711 * Class UINotificationProgressCloudMachineShutdown implementation. * 712 *********************************************************************************************************************************/ 713 714 UINotificationProgressCloudMachineShutdown::UINotificationProgressCloudMachineShutdown(const CCloudMachine &comMachine) 715 : m_comMachine(comMachine) 716 { 717 } 718 719 QString UINotificationProgressCloudMachineShutdown::name() const 720 { 721 return UINotificationProgress::tr("Shutting cloud VM down ..."); 722 } 723 724 QString UINotificationProgressCloudMachineShutdown::details() const 725 { 726 return UINotificationProgress::tr("<b>VM Name:</b> %1").arg(m_strName); 727 } 728 729 CProgress UINotificationProgressCloudMachineShutdown::createProgress(COMResult &comResult) 730 { 731 /* Acquire cloud VM name: */ 732 m_strName = m_comMachine.GetName(); 733 if (!m_comMachine.isOk()) 734 { 735 /* Store COM result: */ 736 comResult = m_comMachine; 737 /* Return progress-wrapper: */ 738 return CProgress(); 739 } 740 741 /* Initialize progress-wrapper: */ 742 CProgress comProgress = m_comMachine.Shutdown(); 743 /* Store COM result: */ 744 comResult = m_comMachine; 745 /* Return progress-wrapper: */ 746 return comProgress; 747 } 748 749 750 /********************************************************************************************************************************* 711 751 * Class UINotificationProgressCloudConsoleConnectionCreate implementation. * 712 752 *********************************************************************************************************************************/ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90409 r90410 560 560 }; 561 561 562 /** UINotificationProgress extension for cloud machine shutdown functionality. */ 563 class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineShutdown : public UINotificationProgress 564 { 565 Q_OBJECT; 566 567 public: 568 569 /** Constructs cloud machine shutdown notification-progress. 570 * @param comMachine Brings the machine being shutdown. */ 571 UINotificationProgressCloudMachineShutdown(const CCloudMachine &comMachine); 572 573 protected: 574 575 /** Returns object name. */ 576 virtual QString name() const /* override final */; 577 /** Returns object details. */ 578 virtual QString details() const /* override final */; 579 /** Creates and returns started progress-wrapper. */ 580 virtual CProgress createProgress(COMResult &comResult) /* override final */; 581 582 private: 583 584 /** Holds the machine being shutdown. */ 585 CCloudMachine m_comMachine; 586 /** Holds the machine name. */ 587 QString m_strName; 588 }; 589 562 590 /** UINotificationProgress extension for cloud console connection create functionality. */ 563 591 class SHARED_LIBRARY_STUFF UINotificationProgressCloudConsoleConnectionCreate : public UINotificationProgress
Note:
See TracChangeset
for help on using the changeset viewer.