VirtualBox

Changeset 90394 in vbox


Ignore:
Timestamp:
Jul 29, 2021 8:38:39 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Notification signature for cloud console connection delete progress 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

    r90389 r90394  
    13421342                        if (cloudMachineName(comMachine, strName))
    13431343                        {
    1344                             /* Prepare "delete console connection" progress: */
    1345                             CProgress comProgress = comMachine.DeleteConsoleConnection();
    1346                             if (!comMachine.isOk())
    1347                                 msgCenter().cannotDeleteConsoleConnection(comMachine);
    1348                             else
    1349                             {
    1350                                 /* Show "delete console connection" progress: */
    1351                                 msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_delete_cloud_vm_90px.png", 0, 0);
    1352                                 if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    1353                                     msgCenter().cannotDeleteConsoleConnection(comProgress, strName);
    1354                             }
     1344                            /* Delete cloud console connection: */
     1345                            UINotificationProgressCloudConsoleConnectionDelete *pNotification =
     1346                                new UINotificationProgressCloudConsoleConnectionDelete(comMachine);
     1347                            notificationCenter().append(pNotification);
    13551348                        }
    13561349                    }
     
    13861379                if (cloudMachineName(comMachine, strName))
    13871380                {
    1388                     /* Prepare "delete console connection" progress: */
    1389                     CProgress comProgress = comMachine.DeleteConsoleConnection();
    1390                     if (!comMachine.isOk())
    1391                         msgCenter().cannotDeleteConsoleConnection(comMachine);
    1392                     else
    1393                     {
    1394                         /* Show "delete console connection" progress: */
    1395                         msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_delete_cloud_vm_90px.png", 0, 0);
    1396                         if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    1397                             msgCenter().cannotDeleteConsoleConnection(comProgress, strName);
    1398                     }
     1381                    /* Delete cloud console connection: */
     1382                    UINotificationProgressCloudConsoleConnectionDelete *pNotification =
     1383                        new UINotificationProgressCloudConsoleConnectionDelete(comMachine);
     1384                    notificationCenter().append(pNotification);
    13991385                }
    14001386            }
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90393 r90394  
    544544
    545545/*********************************************************************************************************************************
     546*   Class UINotificationProgressCloudConsoleConnectionDelete implementation.                                                     *
     547*********************************************************************************************************************************/
     548
     549UINotificationProgressCloudConsoleConnectionDelete::UINotificationProgressCloudConsoleConnectionDelete(const CCloudMachine &comMachine)
     550    : m_comMachine(comMachine)
     551{
     552}
     553
     554QString UINotificationProgressCloudConsoleConnectionDelete::name() const
     555{
     556    return UINotificationProgress::tr("Deleting cloud console connection ...");
     557}
     558
     559QString UINotificationProgressCloudConsoleConnectionDelete::details() const
     560{
     561    return UINotificationProgress::tr("<b>Cloud VM Name:</b> %1").arg(m_strName);
     562}
     563
     564CProgress UINotificationProgressCloudConsoleConnectionDelete::createProgress(COMResult &comResult)
     565{
     566    /* Acquire cloud VM name: */
     567    m_strName = m_comMachine.GetName();
     568    if (!m_comMachine.isOk())
     569    {
     570        comResult = m_comMachine;
     571        return CProgress();
     572    }
     573
     574    /* Initialize progress-wrapper: */
     575    CProgress comProgress = m_comMachine.DeleteConsoleConnection();
     576    /* Store COM result: */
     577    comResult = m_comMachine;
     578    /* Return progress-wrapper: */
     579    return comProgress;
     580}
     581
     582
     583/*********************************************************************************************************************************
    546584*   Class UINotificationProgressApplianceExport implementation.                                                                  *
    547585*********************************************************************************************************************************/
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90393 r90394  
    494494};
    495495
     496/** UINotificationProgress extension for cloud console connection delete functionality. */
     497class SHARED_LIBRARY_STUFF UINotificationProgressCloudConsoleConnectionDelete : public UINotificationProgress
     498{
     499    Q_OBJECT;
     500
     501public:
     502
     503    /** Constructs cloud console connection delete notification-progress.
     504      * @param  comMachine  Brings the cloud machine for which console connection being deleted. */
     505    UINotificationProgressCloudConsoleConnectionDelete(const CCloudMachine &comMachine);
     506
     507protected:
     508
     509    /** Returns object name. */
     510    virtual QString name() const /* override final */;
     511    /** Returns object details. */
     512    virtual QString details() const /* override final */;
     513    /** Creates and returns started progress-wrapper. */
     514    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     515
     516private:
     517
     518    /** Holds the cloud machine for which console connection being deleted. */
     519    CCloudMachine  m_comMachine;
     520    /** Holds the cloud machine name. */
     521    QString        m_strName;
     522};
     523
    496524/** UINotificationProgress extension for export appliance functionality. */
    497525class SHARED_LIBRARY_STUFF UINotificationProgressApplianceExport : 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