VirtualBox

Changeset 91165 in vbox


Ignore:
Timestamp:
Sep 8, 2021 3:34:03 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146819
Message:

FE/Qt: bugref:10067: Moving cloud async task messages from UIMessageCenter to UINotificationCenter; A bit of refactoring for UIMessageCenter and UINotificationMessage stuff as well.

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

Legend:

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

    r91159 r91165  
    13671367}
    13681368
     1369void UIMessageCenter::cannotCreateCloudClient(const CCloudProfile &comProfile, QWidget *pParent /* = 0 */) const
     1370{
     1371    error(pParent, MessageType_Error,
     1372          tr("Failed to create cloud client."),
     1373          UIErrorString::formatErrorInfo(comProfile));
     1374}
     1375
    13691376void UIMessageCenter::cannotAcquireCloudProviderManagerParameter(const CCloudProviderManager &comManager, QWidget *pParent /* = 0 */) const
    13701377{
     
    14021409}
    14031410
    1404 void UIMessageCenter::cannotCreateCloudClient(const CCloudProfile &comProfile, QWidget *pParent /* = 0 */) const
    1405 {
    1406     error(pParent, MessageType_Error,
    1407           tr("Failed to create cloud client."),
    1408           UIErrorString::formatErrorInfo(comProfile));
     1411void UIMessageCenter::cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */) const
     1412{
     1413    error(pParent, MessageType_Error,
     1414          tr("Failed to acquire cloud machine parameter."),
     1415          UIErrorString::formatErrorInfo(comMachine));
     1416}
     1417
     1418void UIMessageCenter::cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
     1419{
     1420    error(pParent, MessageType_Error,
     1421          tr("Failed to acquire cloud machine parameter."),
     1422          UIErrorString::formatErrorInfo(comProgress));
     1423}
     1424
     1425void UIMessageCenter::cannotAssignFormValue(const QString &strError, QWidget *pParent /* = 0 */) const
     1426{
     1427    error(pParent, MessageType_Error,
     1428          tr("Failed to assign form value."),
     1429          strError);
    14091430}
    14101431
     
    14251446          UIErrorString::formatErrorInfo(progress));
    14261447    return false;
    1427 }
    1428 
    1429 void UIMessageCenter::cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */) const
    1430 {
    1431     error(pParent, MessageType_Error,
    1432           tr("Failed to acquire cloud machine parameter."),
    1433           UIErrorString::formatErrorInfo(comMachine));
    1434 }
    1435 
    1436 void UIMessageCenter::cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
    1437 {
    1438     error(pParent, MessageType_Error,
    1439           tr("Failed to acquire cloud machine parameter."),
    1440           UIErrorString::formatErrorInfo(comProgress));
    1441 }
    1442 
    1443 void UIMessageCenter::cannotAcquireCloudMachineParameter(const QString &strErrorDetails, QWidget *pParent /* = 0 */) const
    1444 {
    1445     error(pParent, MessageType_Error,
    1446           tr("Failed to acquire cloud machine parameter."),
    1447           strErrorDetails);
    1448 }
    1449 
    1450 void UIMessageCenter::cannotAssignFormValue(const QString &strError, QWidget *pParent /* = 0 */) const
    1451 {
    1452     error(pParent, MessageType_Error,
    1453           tr("Failed to assign form value."),
    1454           strError);
    14551448}
    14561449
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r91159 r91165  
    374374      * @{ */
    375375        void cannotAcquireCloudProviderManager(const CVirtualBox &comVBox, QWidget *pParent = 0) const;
    376 
    377376        void cannotFindCloudProvider(const CCloudProviderManager &comManager, const QUuid &uId, QWidget *pParent = 0) const;
    378377        void cannotFindCloudProfile(const CCloudProvider &comProvider, const QString &strName, QWidget *pParent = 0) const;
    379 
     378        void cannotCreateCloudClient(const CCloudProfile &comProfile, QWidget *pParent = 0) const;
    380379        void cannotAcquireCloudProviderManagerParameter(const CCloudProviderManager &comManager, QWidget *pParent = 0) const;
    381380        void cannotAcquireCloudProviderParameter(const CCloudProvider &comProvider, QWidget *pParent = 0) const;
     
    383382        void cannotAcquireCloudClientParameter(const CCloudClient &comClient, QWidget *pParent = 0) const;
    384383        void cannotAcquireCloudClientParameter(const CProgress &comProgress, QWidget *pParent = 0) const;
    385 
    386         void cannotCreateCloudClient(const CCloudProfile &comProfile, QWidget *pParent = 0) const;
     384        void cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent = 0) const;
     385        void cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent = 0) const;
     386    /** @} */
     387
     388    /** @name VirtualBox Manager / Cloud machine settings.
     389      * @{ */
     390        void cannotAssignFormValue(const QString &strError, QWidget *pParent = 0) const;
    387391    /** @} */
    388392
     
    392396        bool cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const;
    393397    /** @} */
    394 
    395     void cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent = 0) const;
    396     void cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent = 0) const;
    397     void cannotAcquireCloudMachineParameter(const QString &strErrorDetails, QWidget *pParent = 0) const;
    398     void cannotAssignFormValue(const QString &strError, QWidget *pParent = 0) const;
    399398
    400399    /* API: Cloud Console Manager warnings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudGetSettingsForm.cpp

    r84098 r91165  
    2222#include "UICommon.h"
    2323#include "UICloudNetworkingStuff.h"
    24 #include "UIMessageCenter.h"
     24#include "UINotificationCenter.h"
    2525#include "UITaskCloudGetSettingsForm.h"
    2626#include "UIThreadPool.h"
     
    8888    else
    8989    {
    90         msgCenter().cannotAcquireCloudMachineParameter(pSettingsTask->errorInfo(), m_pParent);
     90        UINotificationMessage::cannotAcquireCloudMachineSettings(pSettingsTask->errorInfo());
    9191        emit sigTaskFailed(pSettingsTask->errorInfo());
    9292    }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp

    r91125 r91165  
    2626#include "UIErrorString.h"
    2727#include "UIIconPool.h"
    28 #include "UIMessageCenter.h"
     28#include "UINotificationCenter.h"
    2929#include "UIProgressTask.h"
    3030#include "UIThreadPool.h"
     
    3636
    3737
    38 /** UIProgressTask extension performing cloud machine refresh task. */
     38/** UIProgressTask extension performing cloud machine refresh task.
     39  * @todo rework this task to be a part of notification-center. */
    3940class UIProgressTaskRefreshCloudMachine : public UIProgressTask
    4041{
     
    7879    CProgress comProgress = m_comCloudMachine.Refresh();
    7980    if (!m_comCloudMachine.isOk())
    80         msgCenter().cannotAcquireCloudMachineParameter(m_comCloudMachine);
     81        UINotificationMessage::cannotRefreshCloudMachine(m_comCloudMachine);
    8182    else
    8283        comResult = comProgress;
     
    9091    /* Handle progress-wrapper errors: */
    9192    if (!comProgress.GetCanceled() && (!comProgress.isOk() || comProgress.GetResultCode() != 0))
    92         msgCenter().cannotAcquireCloudMachineParameter(comProgress);
     93        UINotificationMessage::cannotRefreshCloudMachine(comProgress);
    9394}
    9495
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r91149 r91165  
    129129                                                   "name.</p><p>Please resolve this name conflict and try again.</p>")
    130130                                                   .arg(strCollisionName, strGroupName));
     131}
     132
     133/* static */
     134void UINotificationMessage::cannotAcquireCloudMachineSettings(const QString &strErrorDetails)
     135{
     136    createMessage(
     137        QApplication::translate("UIMessageCenter", "Cloud machine failure ..."),
     138        QApplication::translate("UIMessageCenter", "Failed to acquire cloud machine settings.") +
     139        strErrorDetails);
    131140}
    132141
     
    770779        QApplication::translate("UIMessageCenter", "Failed to import cloud profiles.") +
    771780        UIErrorString::formatErrorInfo(comProvider));
     781}
     782
     783/* static */
     784void UINotificationMessage::cannotRefreshCloudMachine(const CCloudMachine &comMachine)
     785{
     786    createMessage(
     787        QApplication::translate("UIMessageCenter", "Can't refresh cloud machine ..."),
     788        QApplication::translate("UIMessageCenter", "Failed to refresh cloud machine.") +
     789        UIErrorString::formatErrorInfo(comMachine));
     790}
     791
     792/* static */
     793void UINotificationMessage::cannotRefreshCloudMachine(const CProgress &comProgress)
     794{
     795    createMessage(
     796        QApplication::translate("UIMessageCenter", "Can't refresh cloud machine ..."),
     797        QApplication::translate("UIMessageCenter", "Failed to refresh cloud machine.") +
     798        UIErrorString::formatErrorInfo(comProgress));
    772799}
    773800
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r91149 r91165  
    8989          * @param  strGroupName      Brings the group name. */
    9090        static void cannotResolveCollisionAutomatically(const QString &strCollisionName, const QString &strGroupName);
     91
     92        /** Notifies about inability to acquire cloud machine settings.
     93          * @param  strErrorDetails  Brings the error details. */
     94        static void cannotAcquireCloudMachineSettings(const QString &strErrorDetails);
    9195
    9296        /** Notifies about public key path is empty. */
     
    303307          * @param  comProvider  Brings the provider profiles being imported for. */
    304308        static void cannotImportCloudProfiles(const CCloudProvider &comProvider);
     309        /** Notifies about inability to refresh cloud machine.
     310          * @param  comMachine  Brings the machine being refreshed. */
     311        static void cannotRefreshCloudMachine(const CCloudMachine &comMachine);
     312        /** Notifies about inability to refresh cloud machine.
     313          * @param  comProgress  Brings the progress of machine being refreshed. */
     314        static void cannotRefreshCloudMachine(const CProgress &comProgress);
    305315
    306316        /** Notifies about inability to open machine.
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