VirtualBox

Changeset 92100 in vbox for trunk/src


Ignore:
Timestamp:
Oct 27, 2021 12:51:43 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: UIWizardCloneVD: Migrate UIMessageCenter stuff to UINotificationCenter.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r92098 r92100  
    210210        QApplication::translate("UIMessageCenter", "Failed to acquire cloud machine settings.") +
    211211        strErrorDetails);
     212}
     213
     214/* static */
     215void UINotificationMessage::cannotOverwriteMediumStorage(const QString &strPath,
     216                                                         UINotificationCenter *pParent /* = 0 */)
     217{
     218    createMessage(
     219        QApplication::translate("UIMessageCenter", "Can't overwrite medium ..."),
     220        QApplication::translate("UIMessageCenter", "Failed to overwrite medium storage at <nobr><b>%1</b></nobr>.")
     221                                                   .arg(strPath),
     222        QString(), QString(), pParent);
    212223}
    213224
     
    843854
    844855/* static */
     856void UINotificationMessage::cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation)
     857{
     858    createMessage(
     859        QApplication::translate("UIMessageCenter", "Can't open machine ..."),
     860        QApplication::translate("UIMessageCenter", "Failed to open virtual machine located in %1.")
     861                                                   .arg(strLocation) +
     862        UIErrorString::formatErrorInfo(comVBox));
     863}
     864
     865/* static */
     866void UINotificationMessage::cannotCreateMediumStorage(const CVirtualBox &comVBox,
     867                                                      const QString &strPath,
     868                                                      UINotificationCenter *pParent /* = 0 */)
     869{
     870    createMessage(
     871        QApplication::translate("UIMessageCenter", "Can't create medium storage ..."),
     872        QApplication::translate("UIMessageCenter", "Failed to create medium storage at <nobr><b>%1</b></nobr>.")
     873                                                   .arg(strPath) +
     874        UIErrorString::formatErrorInfo(comVBox),
     875        QString(), QString(), pParent);
     876}
     877
     878/* static */
    845879void UINotificationMessage::cannotOpenKnownMedium(const CVirtualBox &comVBox, const QUuid &uMediumId)
    846880{
     
    849883        QApplication::translate("UIMessageCenter", "Failed to open the medium with following ID: <nobr><b>%1</b></nobr>.")
    850884                                                   .arg(uMediumId.toString()) +
    851         UIErrorString::formatErrorInfo(comVBox));
    852 }
    853 
    854 /* static */
    855 void UINotificationMessage::cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation)
    856 {
    857     createMessage(
    858         QApplication::translate("UIMessageCenter", "Can't open machine ..."),
    859         QApplication::translate("UIMessageCenter", "Failed to open virtual machine located in %1.")
    860                                                    .arg(strLocation) +
    861885        UIErrorString::formatErrorInfo(comVBox));
    862886}
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r92098 r92100  
    131131          * @param  strErrorDetails  Brings the error details. */
    132132        static void cannotAcquireCloudMachineSettings(const QString &strErrorDetails);
     133
     134        /** Notifies about inability to overwrite medium storage.
     135          * @param  strPath  Brings the medium path. */
     136        static void cannotOverwriteMediumStorage(const QString &strPath,
     137                                                 UINotificationCenter *pParent = 0);
    133138
    134139        /** Notifies about inability to open license file.
     
    337342                                          const QUuid &uMachineId,
    338343                                          UINotificationCenter *pParent = 0);
     344        /** Notifies about inability to open machine.
     345          * @param  comVBox      Brings common VBox object trying to open machine.
     346          * @param  strLocation  Brings the machine location. */
     347        static void cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation);
     348        /** Notifies about inability to create medium storage.
     349          * @param  comVBox  Brings common VBox object trying to create medium storage.
     350          * @param  strPath  Brings the medium path. */
     351        static void cannotCreateMediumStorage(const CVirtualBox &comVBox,
     352                                              const QString &strPath,
     353                                              UINotificationCenter *pParent = 0);
    339354        /** Notifies about inability to open known medium.
    340355          * @param  comVBox    Brings common VBox object trying to open medium.
    341356          * @param  uMediumId  Brings the medium ID. */
    342357        static void cannotOpenKnownMedium(const CVirtualBox &comVBox, const QUuid &uMediumId);
    343         /** Notifies about inability to open machine.
    344           * @param  comVBox      Brings common VBox object trying to open machine.
    345           * @param  strLocation  Brings the machine location. */
    346         static void cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation);
    347358        /** Notifies about inability to get ext pack manager.
    348359          * @param  comVBox      Brings common VBox object trying to open machine. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVD.cpp

    r91062 r92100  
    1919#include "UICommon.h"
    2020#include "UIMedium.h"
    21 #include "UIMessageCenter.h"
    2221#include "UINotificationCenter.h"
    2322#include "UIWizardCloneVD.h"
     
    6867    if (!comVBox.isOk())
    6968    {
    70         msgCenter().cannotCreateMediumStorage(comVBox, m_strMediumPath, this);
     69        UINotificationMessage::cannotCreateMediumStorage(comVBox, m_strMediumPath, notificationCenter());
    7170        return false;
    7271    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp

    r91294 r92100  
    2222/* GUI includes: */
    2323#include "UICommon.h"
    24 #include "UIMessageCenter.h"
     24#include "UINotificationCenter.h"
    2525#include "UIWizardCloneVD.h"
    2626#include "UIWizardCloneVDExpertPage.h"
     
    179179    if (QFileInfo(strMediumPath).exists())
    180180    {
    181         msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this);
     181        UINotificationMessage::cannotOverwriteMediumStorage(strMediumPath, wizard()->notificationCenter());
    182182        return false;
    183183    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPathSizePage.cpp

    r91294 r92100  
    2121
    2222/* GUI includes: */
     23#include "UINotificationCenter.h"
    2324#include "UIWizardCloneVDPathSizePage.h"
    2425#include "UIWizardDiskEditors.h"
    2526#include "UIWizardCloneVD.h"
    26 #include "UIMessageCenter.h"
    2727
    2828UIWizardCloneVDPathSizePage::UIWizardCloneVDPathSizePage(qulonglong uSourceDiskLogicaSize)
     
    101101    if (QFileInfo(strMediumPath).exists())
    102102    {
    103         msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this);
     103        UINotificationMessage::cannotOverwriteMediumStorage(strMediumPath, wizard()->notificationCenter());
    104104        return false;
    105105    }
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