VirtualBox

Changeset 90410 in vbox for trunk/src


Ignore:
Timestamp:
Jul 29, 2021 1:54:28 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Notification signature for virtual cloud machine shutdown progress (in UIVirtualBoxManager) which should now go to center instead of modal dialogs.

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  
    18131813        else if (pItem->itemType() == UIVirtualMachineItemType_CloudReal)
    18141814        {
    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);
    18301819        }
    18311820    }
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90409 r90410  
    709709
    710710/*********************************************************************************************************************************
     711*   Class UINotificationProgressCloudMachineShutdown implementation.                                                             *
     712*********************************************************************************************************************************/
     713
     714UINotificationProgressCloudMachineShutdown::UINotificationProgressCloudMachineShutdown(const CCloudMachine &comMachine)
     715    : m_comMachine(comMachine)
     716{
     717}
     718
     719QString UINotificationProgressCloudMachineShutdown::name() const
     720{
     721    return   UINotificationProgress::tr("Shutting cloud VM down ...");
     722}
     723
     724QString UINotificationProgressCloudMachineShutdown::details() const
     725{
     726    return UINotificationProgress::tr("<b>VM Name:</b> %1").arg(m_strName);
     727}
     728
     729CProgress 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/*********************************************************************************************************************************
    711751*   Class UINotificationProgressCloudConsoleConnectionCreate implementation.                                                     *
    712752*********************************************************************************************************************************/
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90409 r90410  
    560560};
    561561
     562/** UINotificationProgress extension for cloud machine shutdown functionality. */
     563class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineShutdown : public UINotificationProgress
     564{
     565    Q_OBJECT;
     566
     567public:
     568
     569    /** Constructs cloud machine shutdown notification-progress.
     570      * @param  comMachine  Brings the machine being shutdown. */
     571    UINotificationProgressCloudMachineShutdown(const CCloudMachine &comMachine);
     572
     573protected:
     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
     582private:
     583
     584    /** Holds the machine being shutdown. */
     585    CCloudMachine  m_comMachine;
     586    /** Holds the machine name. */
     587    QString        m_strName;
     588};
     589
    562590/** UINotificationProgress extension for cloud console connection create functionality. */
    563591class SHARED_LIBRARY_STUFF UINotificationProgressCloudConsoleConnectionCreate : public UINotificationProgress
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette