VirtualBox

Changeset 84098 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 30, 2020 10:38:09 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137687
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Details pane: Handle errors while acquiring settings form for details editing tasks.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r83963 r84098  
    610610    error(pParent, MessageType_Error,
    611611          tr("Failed to acquire machine parameter."), UIErrorString::formatErrorInfo(comMachine));
    612 }
    613 
    614 void UIMessageCenter::cannotAcquireCloudInstanceList(const QString &strErrorDetails, QWidget *pParent /* = 0 */) const
    615 {
    616     error(pParent, MessageType_Error,
    617           tr("Failed to acquire cloud intance list."), strErrorDetails);
    618612}
    619613
     
    18931887}
    18941888
     1889void UIMessageCenter::cannotAcquireCloudMachineParameter(const QString &strErrorDetails, QWidget *pParent /* = 0 */) const
     1890{
     1891    error(pParent, MessageType_Error,
     1892          tr("Failed to acquire cloud machine parameter."),
     1893          strErrorDetails);
     1894}
     1895
    18951896bool UIMessageCenter::confirmCloudProfileRemoval(const QString &strName, QWidget *pParent /* = 0 */) const
    18961897{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r83963 r84098  
    265265    void cannotAcquireVirtualBoxParameter(const CVirtualBox &comVBox, QWidget *pParent = 0) const;
    266266    void cannotAcquireMachineParameter(const CMachine &comMachine, QWidget *pParent = 0) const;
    267 
    268     /* API: Global cloud warnings: */
    269     void cannotAcquireCloudInstanceList(const QString &strErrorDetails, QWidget *pParent = 0) const;
    270267
    271268    /* API: Selector warnings: */
     
    403400    void cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent = 0) const;
    404401    void cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent = 0) const;
     402    void cannotAcquireCloudMachineParameter(const QString &strErrorDetails, QWidget *pParent = 0) const;
    405403    bool confirmCloudProfileRemoval(const QString &strName, QWidget *pParent = 0) const;
    406404    bool confirmCloudProfilesImport(QWidget *pParent = 0) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudGetSettingsForm.cpp

    r84020 r84098  
    1616 */
    1717
     18/* Qt includes: */
     19#include <QWidget>
     20
    1821/* GUI includes: */
    1922#include "UICommon.h"
    2023#include "UICloudNetworkingStuff.h"
     24#include "UIMessageCenter.h"
    2125#include "UITaskCloudGetSettingsForm.h"
    2226#include "UIThreadPool.h"
     
    6165*********************************************************************************************************************************/
    6266
    63 UIReceiverCloudGetSettingsForm::UIReceiverCloudGetSettingsForm(QObject *pParent)
     67UIReceiverCloudGetSettingsForm::UIReceiverCloudGetSettingsForm(QWidget *pParent)
    6468    : QObject(pParent)
     69    , m_pParent(pParent)
    6570{
    6671    /* Connect receiver: */
     
    7984
    8085    /* Redirect to another listeners: */
    81     emit sigTaskComplete(pSettingsTask->result());
     86    if (pSettingsTask->errorInfo().isNull())
     87        emit sigTaskComplete(pSettingsTask->result());
     88    else
     89    {
     90        msgCenter().cannotAcquireCloudMachineParameter(pSettingsTask->errorInfo(), m_pParent);
     91        emit sigTaskFailed(pSettingsTask->errorInfo());
     92    }
    8293}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudGetSettingsForm.h

    r84020 r84098  
    8383    /** Notifies about task is complete with certain comResult. */
    8484    void sigTaskComplete(const CForm &comResult);
     85    /** Notifies about task is failed with certain strErrorMessage. */
     86    void sigTaskFailed(const QString &strErrorMessage);
    8587
    8688public:
    8789
    8890    /** Constructs receiver passing @a pParent to the base-class. */
    89     UIReceiverCloudGetSettingsForm(QObject *pParent);
     91    UIReceiverCloudGetSettingsForm(QWidget *pParent);
    9092
    9193public slots:
     
    9395    /** Handles thread-pool signal about @a pTask is complete. */
    9496    void sltHandleTaskComplete(UITask *pTask);
     97
     98private:
     99
     100    /** Holds the parent widget reference. */
     101    QWidget *m_pParent;
    95102};
    96103
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp

    r84021 r84098  
    991991                    UIReceiverCloudGetSettingsForm *pReceiver = new UIReceiverCloudGetSettingsForm(pEditor);
    992992                    if (pReceiver)
     993                    {
    993994                        connect(pReceiver, &UIReceiverCloudGetSettingsForm::sigTaskComplete,
    994995                                pEditor.data(), &UICloudMachineSettingsDialogPage::setForm);
     996                        connect(pReceiver, &UIReceiverCloudGetSettingsForm::sigTaskFailed,
     997                                pPopup.data(), &QIDialogContainer::close);
     998                    }
    995999                    /* Start task: */
    9961000                    if (pTask && pReceiver)
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