- Timestamp:
- Jul 29, 2021 1:40:19 PM (3 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
r90406 r90409 1865 1865 { 1866 1866 /* Powering VM down: */ 1867 UINotificationProgressMachinePowerDown *pNotification = new UINotificationProgressMachinePowerDown(pItem->id()); 1867 UINotificationProgressMachinePowerDown *pNotification = 1868 new UINotificationProgressMachinePowerDown(pItem->id()); 1868 1869 notificationCenter().append(pNotification); 1869 1870 } … … 1871 1872 else if (pItem->itemType() == UIVirtualMachineItemType_CloudReal) 1872 1873 { 1873 /* Acquire cloud machine: */ 1874 CCloudMachine comCloudMachine = pItem->toCloud()->machine(); 1875 /* Prepare machine power down: */ 1876 CProgress comProgress = comCloudMachine.PowerDown(); 1877 if (!comCloudMachine.isOk()) 1878 msgCenter().cannotPowerDownCloudMachine(comCloudMachine); 1879 else 1880 { 1881 /* Show machine power down progress: */ 1882 msgCenter().showModalProgressDialog(comProgress, pItem->name(), ":/progress_poweroff_90px.png", 0, 0); 1883 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 1884 msgCenter().cannotPowerDownCloudMachine(comProgress, pItem->name()); 1885 /* Update info in any case: */ 1886 pItem->toCloud()->updateInfoAsync(false /* delayed? */); 1887 } 1874 /* Powering cloud VM down: */ 1875 UINotificationProgressCloudMachinePowerDown *pNotification = 1876 new UINotificationProgressCloudMachinePowerDown(pItem->toCloud()->machine()); 1877 notificationCenter().append(pNotification); 1888 1878 } 1889 1879 } -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90406 r90409 581 581 QString UINotificationProgressCloudMachineCreate::details() const 582 582 { 583 return UINotificationProgress::tr("<b>Provider:</b> %1<br><b>Profile:</b> %2<br><b> Name:</b> %3")583 return UINotificationProgress::tr("<b>Provider:</b> %1<br><b>Profile:</b> %2<br><b>VM Name:</b> %3") 584 584 .arg(m_strProviderShortName, m_strProfileName, m_strName); 585 585 } … … 611 611 612 612 /********************************************************************************************************************************* 613 * Class UINotificationProgressCloudMachine Create implementation. *613 * Class UINotificationProgressCloudMachineRemove implementation. * 614 614 *********************************************************************************************************************************/ 615 615 … … 636 636 QString UINotificationProgressCloudMachineRemove::details() const 637 637 { 638 return UINotificationProgress::tr("<b> Name:</b> %1").arg(m_strName);638 return UINotificationProgress::tr("<b>VM Name:</b> %1").arg(m_strName); 639 639 } 640 640 … … 665 665 if (error().isEmpty()) 666 666 emit sigCloudMachineRemoved(m_strProviderShortName, m_strProfileName, m_strName); 667 } 668 669 670 /********************************************************************************************************************************* 671 * Class UINotificationProgressCloudMachinePowerDown implementation. * 672 *********************************************************************************************************************************/ 673 674 UINotificationProgressCloudMachinePowerDown::UINotificationProgressCloudMachinePowerDown(const CCloudMachine &comMachine) 675 : m_comMachine(comMachine) 676 { 677 } 678 679 QString UINotificationProgressCloudMachinePowerDown::name() const 680 { 681 return UINotificationProgress::tr("Powering cloud VM down ..."); 682 } 683 684 QString UINotificationProgressCloudMachinePowerDown::details() const 685 { 686 return UINotificationProgress::tr("<b>VM Name:</b> %1").arg(m_strName); 687 } 688 689 CProgress UINotificationProgressCloudMachinePowerDown::createProgress(COMResult &comResult) 690 { 691 /* Acquire cloud VM name: */ 692 m_strName = m_comMachine.GetName(); 693 if (!m_comMachine.isOk()) 694 { 695 /* Store COM result: */ 696 comResult = m_comMachine; 697 /* Return progress-wrapper: */ 698 return CProgress(); 699 } 700 701 /* Initialize progress-wrapper: */ 702 CProgress comProgress = m_comMachine.PowerDown(); 703 /* Store COM result: */ 704 comResult = m_comMachine; 705 /* Return progress-wrapper: */ 706 return comProgress; 667 707 } 668 708 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90406 r90409 271 271 272 272 /** Constructs machine save-state notification-progress. 273 * @param comMachine Brings the machine being saved. */273 * @param uId Brings the machine id. */ 274 274 UINotificationProgressMachineSaveState(const QUuid &uId); 275 275 … … 306 306 307 307 /** Constructs machine power-down notification-progress. 308 * @param comMachine Brings the machine being powered-down. */308 * @param uId Brings the machine id. */ 309 309 UINotificationProgressMachinePowerDown(const QUuid &uId); 310 310 … … 532 532 }; 533 533 534 /** UINotificationProgress extension for cloud machine power-down functionality. */ 535 class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachinePowerDown : public UINotificationProgress 536 { 537 Q_OBJECT; 538 539 public: 540 541 /** Constructs cloud machine power-down notification-progress. 542 * @param comMachine Brings the machine being powered-down. */ 543 UINotificationProgressCloudMachinePowerDown(const CCloudMachine &comMachine); 544 545 protected: 546 547 /** Returns object name. */ 548 virtual QString name() const /* override final */; 549 /** Returns object details. */ 550 virtual QString details() const /* override final */; 551 /** Creates and returns started progress-wrapper. */ 552 virtual CProgress createProgress(COMResult &comResult) /* override final */; 553 554 private: 555 556 /** Holds the machine being powered-down. */ 557 CCloudMachine m_comMachine; 558 /** Holds the machine name. */ 559 QString m_strName; 560 }; 561 534 562 /** UINotificationProgress extension for cloud console connection create functionality. */ 535 563 class SHARED_LIBRARY_STUFF UINotificationProgressCloudConsoleConnectionCreate : public UINotificationProgress
Note:
See TracChangeset
for help on using the changeset viewer.