VirtualBox

Changeset 91149 in vbox for trunk/src


Ignore:
Timestamp:
Sep 8, 2021 12:01:42 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Moving Cloud Profile Manager messages from UIMessageCenter to UINotificationCenter.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileManager.cpp

    r87352 r91149  
    3535#include "UIIconPool.h"
    3636#include "UIMessageCenter.h"
     37#include "UINotificationCenter.h"
    3738#include "UIVirtualBoxEventHandler.h"
    3839
     
    286287            /* Show error message if necessary: */
    287288            if (!comCloudProfile.isOk())
    288                 msgCenter().cannotAssignCloudProfileParameter(comCloudProfile, this);
     289                UINotificationMessage::cannotChangeCloudProfileParameter(comCloudProfile);
    289290            else
    290291            {
     
    302303                        if (!comCloudProfile.isOk())
    303304                        {
    304                             msgCenter().cannotAssignCloudProfileParameter(comCloudProfile, this);
     305                            UINotificationMessage::cannotChangeCloudProfileParameter(comCloudProfile);
    305306                            break;
    306307                        }
     
    316317                /* Show error message if necessary: */
    317318                if (!comCloudProvider.isOk())
    318                     msgCenter().cannotSaveCloudProfiles(comCloudProvider, this);
     319                    UINotificationMessage::cannotSaveCloudProfiles(comCloudProvider);
    319320            }
    320321        }
     
    363364        /* Show error message if necessary: */
    364365        if (!comCloudProvider.isOk())
    365             msgCenter().cannotCreateCloudProfile(comCloudProvider, this);
     366            UINotificationMessage::cannotCreateCloudProfile(comCloudProvider);
    366367        else
    367368        {
     
    370371            /* Show error message if necessary: */
    371372            if (!comCloudProvider.isOk())
    372                 msgCenter().cannotSaveCloudProfiles(comCloudProvider, this);
     373                UINotificationMessage::cannotSaveCloudProfiles(comCloudProvider);
    373374        }
    374375    }
     
    398399        /* Show error message if necessary: */
    399400        if (!comCloudProvider.isOk())
    400             msgCenter().cannotImportCloudProfiles(comCloudProvider, this);
     401            UINotificationMessage::cannotImportCloudProfiles(comCloudProvider);
    401402    }
    402403}
     
    434435            /* Show error message if necessary: */
    435436            if (!comCloudProfile.isOk())
    436                 msgCenter().cannotRemoveCloudProfile(comCloudProfile, this);
     437                UINotificationMessage::cannotRemoveCloudProfile(comCloudProfile);
    437438            else
    438439            {
     
    441442                /* Show error message if necessary: */
    442443                if (!comCloudProvider.isOk())
    443                     msgCenter().cannotSaveCloudProfiles(comCloudProvider, this);
     444                    UINotificationMessage::cannotSaveCloudProfiles(comCloudProvider);
    444445            }
    445446        }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r91146 r91149  
    13881388}
    13891389
    1390 void UIMessageCenter::cannotAssignCloudProfileParameter(const CCloudProfile &comProfile, QWidget *pParent /* = 0 */) const
    1391 {
    1392     error(pParent, MessageType_Error,
    1393           tr("Failed to assign cloud profile parameter."),
    1394           UIErrorString::formatErrorInfo(comProfile));
    1395 }
    1396 
    13971390bool UIMessageCenter::cannotRestoreSnapshot(const CMachine &machine, const QString &strSnapshotName, const QString &strMachineName) const
    13981391{
     
    14111404          UIErrorString::formatErrorInfo(progress));
    14121405    return false;
    1413 }
    1414 
    1415 void UIMessageCenter::cannotCreateCloudProfile(const CCloudProvider &comProvider, QWidget *pParent /* = 0 */) const
    1416 {
    1417     error(pParent, MessageType_Error,
    1418           tr("Failed to create cloud profile."),
    1419           UIErrorString::formatErrorInfo(comProvider));
    1420 }
    1421 
    1422 void UIMessageCenter::cannotRemoveCloudProfile(const CCloudProfile &comProfile, QWidget *pParent /* = 0 */) const
    1423 {
    1424     error(pParent, MessageType_Error,
    1425           tr("Failed to remove cloud profile."),
    1426           UIErrorString::formatErrorInfo(comProfile));
    1427 }
    1428 
    1429 void UIMessageCenter::cannotSaveCloudProfiles(const CCloudProvider &comProvider, QWidget *pParent /* = 0 */) const
    1430 {
    1431     error(pParent, MessageType_Error,
    1432           tr("Failed to save cloud profiles."),
    1433           UIErrorString::formatErrorInfo(comProvider));
    1434 }
    1435 
    1436 void UIMessageCenter::cannotImportCloudProfiles(const CCloudProvider &comProvider, QWidget *pParent /* = 0 */) const
    1437 {
    1438     error(pParent, MessageType_Error,
    1439           tr("Failed to import cloud profiles."),
    1440           UIErrorString::formatErrorInfo(comProvider));
    14411406}
    14421407
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r91146 r91149  
    381381        void cannotAcquireCloudProviderParameter(const CCloudProvider &comProvider, QWidget *pParent = 0) const;
    382382        void cannotAcquireCloudProfileParameter(const CCloudProfile &comProfile, QWidget *pParent = 0) const;
    383         void cannotAssignCloudProfileParameter(const CCloudProfile &comProfile, QWidget *pParent = 0) const;
    384383    /** @} */
    385384
     
    389388        bool cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const;
    390389    /** @} */
    391 
    392     /* API: Cloud Profile Manager warnings: */
    393     void cannotCreateCloudProfile(const CCloudProvider &comProvider, QWidget *pParent = 0) const;
    394     void cannotRemoveCloudProfile(const CCloudProfile &comProfile, QWidget *pParent = 0) const;
    395     void cannotSaveCloudProfiles(const CCloudProvider &comProvider, QWidget *pParent = 0) const;
    396     void cannotImportCloudProfiles(const CCloudProvider &comProvider, QWidget *pParent = 0) const;
    397390
    398391    void cannotCreateCloudClient(const CCloudProfile &comProfile, QWidget *pParent = 0) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r91142 r91149  
    3636/* COM includes: */
    3737#include "CAudioAdapter.h"
     38#include "CCloudProfile.h"
     39#include "CCloudProvider.h"
    3840#include "CConsole.h"
    3941#include "CDHCPServer.h"
     
    585587
    586588/* static */
     589void UINotificationMessage::cannotChangeCloudProfileParameter(const CCloudProfile &comProfile)
     590{
     591    createMessage(
     592        QApplication::translate("UIMessageCenter", "Cloud profile failure ..."),
     593        QApplication::translate("UIMessageCenter", "Failed to assign cloud profile parameter.") +
     594        UIErrorString::formatErrorInfo(comProfile));
     595}
     596
     597/* static */
    587598void UINotificationMessage::cannotEnumerateHostUSBDevices(const CHost &comHost)
    588599{
     
    667678
    668679/* static */
     680void UINotificationMessage::cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName)
     681{
     682    createMessage(
     683        QApplication::translate("UIMessageCenter", "Can't find host network interface ..."),
     684        QApplication::translate("UIMessageCenter", "Unable to find the host network interface <b>%1</b>.")
     685                                                   .arg(strInterfaceName) +
     686        UIErrorString::formatErrorInfo(comHost));
     687}
     688
     689/* static */
     690void UINotificationMessage::cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName)
     691{
     692    createMessage(
     693        QApplication::translate("UIMessageCenter", "Can't find NAT network ..."),
     694        QApplication::translate("UIMessageCenter", "Unable to find the NAT network <b>%1</b>.")
     695                                                   .arg(strNetworkName) +
     696        UIErrorString::formatErrorInfo(comVBox));
     697}
     698
     699/* static */
    669700void UINotificationMessage::cannotCreateDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName)
    670701{
     
    706737
    707738/* static */
     739void UINotificationMessage::cannotCreateCloudProfile(const CCloudProvider &comProvider)
     740{
     741    createMessage(
     742        QApplication::translate("UIMessageCenter", "Can't create cloud profile ..."),
     743        QApplication::translate("UIMessageCenter", "Failed to create cloud profile.") +
     744        UIErrorString::formatErrorInfo(comProvider));
     745}
     746
     747/* static */
     748void UINotificationMessage::cannotRemoveCloudProfile(const CCloudProfile &comProfile)
     749{
     750    createMessage(
     751        QApplication::translate("UIMessageCenter", "Can't remove cloud profile ..."),
     752        QApplication::translate("UIMessageCenter", "Failed to remove cloud profile.") +
     753        UIErrorString::formatErrorInfo(comProfile));
     754}
     755
     756/* static */
     757void UINotificationMessage::cannotSaveCloudProfiles(const CCloudProvider &comProvider)
     758{
     759    createMessage(
     760        QApplication::translate("UIMessageCenter", "Can't save cloud profiles ..."),
     761        QApplication::translate("UIMessageCenter", "Failed to save cloud profiles.") +
     762        UIErrorString::formatErrorInfo(comProvider));
     763}
     764
     765/* static */
     766void UINotificationMessage::cannotImportCloudProfiles(const CCloudProvider &comProvider)
     767{
     768    createMessage(
     769        QApplication::translate("UIMessageCenter", "Can't import cloud profiles ..."),
     770        QApplication::translate("UIMessageCenter", "Failed to import cloud profiles.") +
     771        UIErrorString::formatErrorInfo(comProvider));
     772}
     773
     774/* static */
    708775void UINotificationMessage::cannotCloseMedium(const CMedium &comMedium)
    709776{
     
    756823                                                   .arg(strSnapshotName, strMachineName) +
    757824        UIErrorString::formatErrorInfo(comSnapshot));
    758 }
    759 
    760 /* static */
    761 void UINotificationMessage::cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName)
    762 {
    763     createMessage(
    764         QApplication::translate("UIMessageCenter", "Can't find host network interface ..."),
    765         QApplication::translate("UIMessageCenter", "Unable to find the host network interface <b>%1</b>.")
    766                                                    .arg(strInterfaceName) +
    767         UIErrorString::formatErrorInfo(comHost));
    768 }
    769 
    770 /* static */
    771 void UINotificationMessage::cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName)
    772 {
    773     createMessage(
    774         QApplication::translate("UIMessageCenter", "Can't find NAT network ..."),
    775         QApplication::translate("UIMessageCenter", "Unable to find the NAT network <b>%1</b>.")
    776                                                    .arg(strNetworkName) +
    777         UIErrorString::formatErrorInfo(comVBox));
    778825}
    779826
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r91142 r91149  
    233233          * @param  comNetwork  Brings the object parameter being changed for. */
    234234        static void cannotChangeNATNetworkParameter(const CNATNetwork &comNetwork);
     235        /** Notifies about inability to change ICloudProfile parameter.
     236          * @param  comProfile  Brings the object parameter being changed for. */
     237        static void cannotChangeCloudProfileParameter(const CCloudProfile &comProfile);
    235238
    236239        /** Notifies about inability to enumerate host USB devices.
     
    263266          * @param  strLocation  Brings the machine location. */
    264267        static void cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation);
     268
     269        /** Notifies about inability to find host network interface.
     270          * @param  comHost  Brings the host being search through.
     271          * @param  strInterfaceName  Brings interface name. */
     272        static void cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName);
     273        /** Notifies about inability to find NAT network.
     274          * @param  comVBox         Brings common VBox object being search through.
     275          * @param  strNetworkName  Brings network name. */
     276        static void cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName);
    265277        /** Notifies about inability to create DHCP server.
    266278          * @param  comVBox           Brings common VBox object trying to create DHCP server.
     
    279291        static void cannotRemoveNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName);
    280292
     293        /** Notifies about inability to create cloud profile.
     294          * @param  comProvider  Brings the provider profile being created for. */
     295        static void cannotCreateCloudProfile(const CCloudProvider &comProvider);
     296        /** Notifies about inability to remove cloud profile.
     297          * @param  comProvider  Brings the provider profile being removed from. */
     298        static void cannotRemoveCloudProfile(const CCloudProfile &comProfile);
     299        /** Notifies about inability to save cloud profiles.
     300          * @param  comProvider  Brings the provider profiles being saved for. */
     301        static void cannotSaveCloudProfiles(const CCloudProvider &comProvider);
     302        /** Notifies about inability to import cloud profiles.
     303          * @param  comProvider  Brings the provider profiles being imported for. */
     304        static void cannotImportCloudProfiles(const CCloudProvider &comProvider);
     305
    281306        /** Notifies about inability to open machine.
    282307          * @param  comMedium  Brings the medium being closed. */
     
    299324          * @param  strMachineName   Brings machine name. */
    300325        static void cannotChangeSnapshot(const CSnapshot &comSnapshot, const QString &strSnapshotName, const QString &strMachineName);
    301 
    302         /** Notifies about inability to find host network interface.
    303           * @param  comHost  Brings the host being search through.
    304           * @param  strInterfaceName  Brings interface name. */
    305         static void cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName);
    306         /** Notifies about inability to find NAT network.
    307           * @param  comVBox         Brings common VBox object being search through.
    308           * @param  strNetworkName  Brings network name. */
    309         static void cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName);
    310326    /** @} */
    311327
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