VirtualBox

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


Ignore:
Timestamp:
Mar 5, 2020 5:53:37 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Rework UITaskCloudAcquireInstances to provide interested parties with error-information.

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

Legend:

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

    r83203 r83212  
    1919#include "UICloudNetworkingStuff.h"
    2020#include "UICommon.h"
     21#include "UIErrorString.h"
    2122#include "UIMessageCenter.h"
    2223
     
    3031
    3132QList<UICloudMachine> UICloudNetworkingStuff::listInstances(const CCloudClient &comCloudClient,
     33                                                            QString &strErrorMessage,
    3234                                                            QWidget *pParent /* = 0 */)
    3335{
     
    4749            msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent);
    4850        else
    49         {
    50             /// @todo fetch error info
    51         }
     51            strErrorMessage = UIErrorString::formatErrorInfo(comCloudClient);
    5252    }
    5353    else
     
    6565                msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent);
    6666            else
    67             {
    68                 /// @todo fetch error info
    69             }
     67                strErrorMessage = UIErrorString::formatErrorInfo(comProgress);
    7068        }
    7169        else
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r83190 r83212  
    3838      *                         if no parent set, progress will be executed in blocking way. */
    3939    SHARED_LIBRARY_STUFF QList<UICloudMachine> listInstances(const CCloudClient &comCloudClient,
     40                                                             QString &strErrorMessage,
    4041                                                             QWidget *pParent = 0);
    4142
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r82968 r83212  
    601601    error(pParent, MessageType_Error,
    602602          tr("Failed to acquire machine parameter."), UIErrorString::formatErrorInfo(comMachine));
     603}
     604
     605void UIMessageCenter::cannotAcquireCloudInstanceList(const QString &strErrorDetails, QWidget *pParent /* = 0 */) const
     606{
     607    error(pParent, MessageType_Error,
     608          tr("Failed to acquire cloud intance list."), strErrorDetails);
    603609}
    604610
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r82968 r83212  
    264264    void warnAboutInvalidEncryptionPassword(const QString &strPasswordId, QWidget *pParent = 0);
    265265    void cannotAcquireMachineParameter(const CMachine &comMachine, QWidget *pParent = 0) const;
     266
     267    /* API: Global cloud warnings: */
     268    void cannotAcquireCloudInstanceList(const QString &strErrorDetails, QWidget *pParent = 0) const;
    266269
    267270    /* API: Selector warnings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudAcquireInstances.cpp

    r83111 r83212  
    3636}
    3737
    38 CVirtualBoxErrorInfo UITaskCloudAcquireInstances::errorInfo()
     38QString UITaskCloudAcquireInstances::errorInfo()
    3939{
    4040    m_mutex.lock();
    41     CVirtualBoxErrorInfo comErrorInfo = m_comErrorInfo;
     41    QString strErrorInfo = m_strErrorInfo;
    4242    m_mutex.unlock();
    43     return comErrorInfo;
     43    return strErrorInfo;
    4444}
    4545
     
    4747{
    4848    m_mutex.lock();
    49     m_result = listInstances(m_comCloudClient);
     49    m_result = listInstances(m_comCloudClient, m_strErrorInfo);
    5050    m_mutex.unlock();
    5151}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudAcquireInstances.h

    r83111 r83212  
    3232#include "COMEnums.h"
    3333#include "CCloudClient.h"
    34 #include "CVirtualBoxErrorInfo.h"
    3534
    3635/* Forward declaratiuons: */
     
    5554
    5655    /** Returns error info. */
    57     CVirtualBoxErrorInfo errorInfo();
     56    QString errorInfo();
    5857
    5958    /** Returns the task result. */
     
    7574    UIChooserNode *m_pParentNode;
    7675
    77     /** Holds the error info object. */
    78     CVirtualBoxErrorInfo  m_comErrorInfo;
     76    /** Holds the error info. */
     77    QString  m_strErrorInfo;
    7978
    8079    /** Holds the task result. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r83198 r83212  
    275275    /* Cast task to corresponding sub-class: */
    276276    UITaskCloudAcquireInstances *pAcquiringTask = static_cast<UITaskCloudAcquireInstances*>(pTask);
     277
     278    /* Check whether there was an error: */
     279    if (!pAcquiringTask->errorInfo().isNull())
     280        return msgCenter().cannotAcquireCloudInstanceList(pAcquiringTask->errorInfo());
    277281
    278282    /* Acquire parent node we referencing: */
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