VirtualBox

Changeset 90409 in vbox for trunk


Ignore:
Timestamp:
Jul 29, 2021 1:40:19 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Notification signature for virtual cloud machine power-down 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

    r90406 r90409  
    18651865        {
    18661866            /* Powering VM down: */
    1867             UINotificationProgressMachinePowerDown *pNotification = new UINotificationProgressMachinePowerDown(pItem->id());
     1867            UINotificationProgressMachinePowerDown *pNotification =
     1868                new UINotificationProgressMachinePowerDown(pItem->id());
    18681869            notificationCenter().append(pNotification);
    18691870        }
     
    18711872        else if (pItem->itemType() == UIVirtualMachineItemType_CloudReal)
    18721873        {
    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);
    18881878        }
    18891879    }
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90406 r90409  
    581581QString UINotificationProgressCloudMachineCreate::details() const
    582582{
    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")
    584584                                      .arg(m_strProviderShortName, m_strProfileName, m_strName);
    585585}
     
    611611
    612612/*********************************************************************************************************************************
    613 *   Class UINotificationProgressCloudMachineCreate implementation.                                                               *
     613*   Class UINotificationProgressCloudMachineRemove implementation.                                                               *
    614614*********************************************************************************************************************************/
    615615
     
    636636QString UINotificationProgressCloudMachineRemove::details() const
    637637{
    638     return UINotificationProgress::tr("<b>Name:</b> %1").arg(m_strName);
     638    return UINotificationProgress::tr("<b>VM Name:</b> %1").arg(m_strName);
    639639}
    640640
     
    665665    if (error().isEmpty())
    666666        emit sigCloudMachineRemoved(m_strProviderShortName, m_strProfileName, m_strName);
     667}
     668
     669
     670/*********************************************************************************************************************************
     671*   Class UINotificationProgressCloudMachinePowerDown implementation.                                                            *
     672*********************************************************************************************************************************/
     673
     674UINotificationProgressCloudMachinePowerDown::UINotificationProgressCloudMachinePowerDown(const CCloudMachine &comMachine)
     675    : m_comMachine(comMachine)
     676{
     677}
     678
     679QString UINotificationProgressCloudMachinePowerDown::name() const
     680{
     681    return   UINotificationProgress::tr("Powering cloud VM down ...");
     682}
     683
     684QString UINotificationProgressCloudMachinePowerDown::details() const
     685{
     686    return UINotificationProgress::tr("<b>VM Name:</b> %1").arg(m_strName);
     687}
     688
     689CProgress 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;
    667707}
    668708
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90406 r90409  
    271271
    272272    /** Constructs machine save-state notification-progress.
    273       * @param  comMachine  Brings the machine being saved. */
     273      * @param  uId  Brings the machine id. */
    274274    UINotificationProgressMachineSaveState(const QUuid &uId);
    275275
     
    306306
    307307    /** Constructs machine power-down notification-progress.
    308       * @param  comMachine  Brings the machine being powered-down. */
     308      * @param  uId  Brings the machine id. */
    309309    UINotificationProgressMachinePowerDown(const QUuid &uId);
    310310
     
    532532};
    533533
     534/** UINotificationProgress extension for cloud machine power-down functionality. */
     535class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachinePowerDown : public UINotificationProgress
     536{
     537    Q_OBJECT;
     538
     539public:
     540
     541    /** Constructs cloud machine power-down notification-progress.
     542      * @param  comMachine  Brings the machine being powered-down. */
     543    UINotificationProgressCloudMachinePowerDown(const CCloudMachine &comMachine);
     544
     545protected:
     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
     554private:
     555
     556    /** Holds the machine being powered-down. */
     557    CCloudMachine  m_comMachine;
     558    /** Holds the machine name. */
     559    QString        m_strName;
     560};
     561
    534562/** UINotificationProgress extension for cloud console connection create functionality. */
    535563class 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