VirtualBox

Changeset 90389 in vbox for trunk/src


Ignore:
Timestamp:
Jul 29, 2021 7:59:31 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145975
Message:

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

    r90386 r90389  
    12511251                                if (cloudMachineName(comMachine, strName))
    12521252                                {
    1253                                     /* Prepare "create console connection" progress: */
    1254                                     CProgress comProgress = comMachine.CreateConsoleConnection(pDialog->publicKey());
    1255                                     if (!comMachine.isOk())
    1256                                         msgCenter().cannotCreateConsoleConnection(comMachine);
    1257                                     else
    1258                                     {
    1259                                         /* Show "create console connection" progress: */
    1260                                         msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_new_cloud_vm_90px.png", 0, 0);
    1261                                         if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    1262                                             msgCenter().cannotCreateConsoleConnection(comProgress, strName);
    1263                                     }
     1253                                    /* Create cloud console connection: */
     1254                                    UINotificationProgressCloudConsoleConnectionCreate *pNotification =
     1255                                        new UINotificationProgressCloudConsoleConnectionCreate(comMachine,
     1256                                                                                               pDialog->publicKey());
     1257                                    notificationCenter().append(pNotification);
    12641258                                }
    12651259                            }
     
    13041298                        if (cloudMachineName(comMachine, strName))
    13051299                        {
    1306                             /* Prepare "create console connection" progress: */
    1307                             CProgress comProgress = comMachine.CreateConsoleConnection(pDialog->publicKey());
    1308                             if (!comMachine.isOk())
    1309                                 msgCenter().cannotCreateConsoleConnection(comMachine);
    1310                             else
    1311                             {
    1312                                 /* Show "create console connection" progress: */
    1313                                 msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_new_cloud_vm_90px.png", 0, 0);
    1314                                 if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    1315                                     msgCenter().cannotCreateConsoleConnection(comProgress, strName);
    1316                             }
     1300                            /* Create cloud console connection: */
     1301                            UINotificationProgressCloudConsoleConnectionCreate *pNotification =
     1302                                new UINotificationProgressCloudConsoleConnectionCreate(comMachine,
     1303                                                                                       pDialog->publicKey());
     1304                            notificationCenter().append(pNotification);
    13171305                        }
    13181306                    }
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90376 r90389  
    443443
    444444/*********************************************************************************************************************************
     445*   Class UINotificationProgressCloudConsoleConnectionCreate implementation.                                                     *
     446*********************************************************************************************************************************/
     447
     448UINotificationProgressCloudConsoleConnectionCreate::UINotificationProgressCloudConsoleConnectionCreate(const CCloudMachine &comMachine,
     449                                                                                                       const QString &strPublicKey)
     450    : m_comMachine(comMachine)
     451    , m_strPublicKey(strPublicKey)
     452{
     453}
     454
     455QString UINotificationProgressCloudConsoleConnectionCreate::name() const
     456{
     457    return UINotificationProgress::tr("Creating cloud console connection ...");
     458}
     459
     460QString UINotificationProgressCloudConsoleConnectionCreate::details() const
     461{
     462    return UINotificationProgress::tr("<b>Cloud VM Name:</b> %1").arg(m_strName);
     463}
     464
     465CProgress UINotificationProgressCloudConsoleConnectionCreate::createProgress(COMResult &comResult)
     466{
     467    /* Acquire cloud VM name: */
     468    m_strName = m_comMachine.GetName();
     469    if (!m_comMachine.isOk())
     470    {
     471        comResult = m_comMachine;
     472        return CProgress();
     473    }
     474
     475    /* Initialize progress-wrapper: */
     476    CProgress comProgress = m_comMachine.CreateConsoleConnection(m_strPublicKey);
     477    /* Store COM result: */
     478    comResult = m_comMachine;
     479    /* Return progress-wrapper: */
     480    return comProgress;
     481}
     482
     483
     484/*********************************************************************************************************************************
    445485*   Class UINotificationProgressApplianceExport implementation.                                                                  *
    446486*********************************************************************************************************************************/
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90376 r90389  
    450450};
    451451
     452/** UINotificationProgress extension for cloud console connection create functionality. */
     453class SHARED_LIBRARY_STUFF UINotificationProgressCloudConsoleConnectionCreate : public UINotificationProgress
     454{
     455    Q_OBJECT;
     456
     457public:
     458
     459    /** Constructs cloud console connection create notification-progress.
     460      * @param  comMachine    Brings the cloud machine for which console connection being created.
     461      * @param  strPublicKey  Brings the public key used for console connection being created. */
     462    UINotificationProgressCloudConsoleConnectionCreate(const CCloudMachine &comMachine,
     463                                                       const QString &strPublicKey);
     464
     465protected:
     466
     467    /** Returns object name. */
     468    virtual QString name() const /* override final */;
     469    /** Returns object details. */
     470    virtual QString details() const /* override final */;
     471    /** Creates and returns started progress-wrapper. */
     472    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     473
     474private:
     475
     476    /** Holds the cloud machine for which console connection being created. */
     477    CCloudMachine  m_comMachine;
     478    /** Holds the name acquired from cloud machine. */
     479    QString        m_strName;
     480    /** Holds the public key used for console connection being created. */
     481    QString        m_strPublicKey;
     482};
     483
    452484/** UINotificationProgress extension for export appliance functionality. */
    453485class SHARED_LIBRARY_STUFF UINotificationProgressApplianceExport : public UINotificationProgress
Note: See TracChangeset for help on using the changeset viewer.

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