VirtualBox

Changeset 90760 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 20, 2021 3:06:17 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Notification signature for cloud VM power-up progress which should now go to center instead of modal dialogs.

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  
    25102510}
    25112511
    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 
    25422512CSession UICommon::openSession(const QUuid &uId, KLockType lockType /* = KLockType_Shared */)
    25432513{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r90538 r90760  
    509509        /** Launches certain @a comMachine in specified @a enmLaunchMode. */
    510510        bool launchMachine(CMachine &comMachine, LaunchMode enmLaunchMode = LaunchMode_Default);
    511         /** Launches certain @a comMachine. */
    512         bool launchMachine(CCloudMachine &comMachine);
    513511
    514512        /** Opens session of certain @a enmLockType for VM with certain @a uId. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r90714 r90760  
    24782478}
    24792479
     2480void UIVirtualBoxManager::launchMachine(CCloudMachine &comMachine)
     2481{
     2482    /* Powering cloud VM up: */
     2483    UINotificationProgressCloudMachinePowerUp *pNotification =
     2484        new UINotificationProgressCloudMachinePowerUp(comMachine);
     2485    gpNotificationCenter->append(pNotification);
     2486}
     2487
    24802488void UIVirtualBoxManager::startUnattendedInstall(CUnattended &comUnattendedInstaller, const UIUnattendedInstallData &unattendedData)
    24812489{
     
    25742582                CCloudMachine comCloudMachine = pItem->toCloud()->machine();
    25752583                /* Launch current VM: */
    2576                 uiCommon().launchMachine(comCloudMachine);
    2577                 /* Update info in any case: */
    2578                 pItem->toCloud()->updateInfoAsync(false /* delayed? */);
     2584                launchMachine(comCloudMachine);
    25792585            }
    25802586        }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r89851 r90760  
    4040class UIVirtualBoxManagerWidget;
    4141class UIVirtualMachineItem;
     42class CCloudMachine;
    4243
    4344/* Type definitions: */
     
    361362        /** Opens add machine dialog specifying initial name with @a strFileName. */
    362363        void openAddMachineDialog(const QString &strFileName = QString());
     364
     365        /** Launches certain @a comMachine. */
     366        void launchMachine(CCloudMachine &comMachine);
    363367
    364368        /** 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  
    11221122
    11231123/*********************************************************************************************************************************
     1124*   Class UINotificationProgressCloudMachinePowerUp implementation.                                                              *
     1125*********************************************************************************************************************************/
     1126
     1127UINotificationProgressCloudMachinePowerUp::UINotificationProgressCloudMachinePowerUp(const CCloudMachine &comMachine)
     1128    : m_comMachine(comMachine)
     1129{
     1130}
     1131
     1132QString UINotificationProgressCloudMachinePowerUp::name() const
     1133{
     1134    return   UINotificationProgress::tr("Powering cloud VM up ...");
     1135}
     1136
     1137QString UINotificationProgressCloudMachinePowerUp::details() const
     1138{
     1139    return UINotificationProgress::tr("<b>VM Name:</b> %1").arg(m_strName);
     1140}
     1141
     1142CProgress 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/*********************************************************************************************************************************
    11241164*   Class UINotificationProgressCloudMachinePowerDown implementation.                                                            *
    11251165*********************************************************************************************************************************/
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90695 r90760  
    749749};
    750750
     751/** UINotificationProgress extension for cloud machine power-up functionality. */
     752class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachinePowerUp : public UINotificationProgress
     753{
     754    Q_OBJECT;
     755
     756public:
     757
     758    /** Constructs cloud machine power-up notification-progress.
     759      * @param  comMachine  Brings the machine being powered-up. */
     760    UINotificationProgressCloudMachinePowerUp(const CCloudMachine &comMachine);
     761
     762protected:
     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
     771private:
     772
     773    /** Holds the machine being powered-up. */
     774    CCloudMachine  m_comMachine;
     775    /** Holds the machine name. */
     776    QString        m_strName;
     777};
     778
    751779/** UINotificationProgress extension for cloud machine power-down functionality. */
    752780class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachinePowerDown : 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