VirtualBox

Changeset 91104 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 3, 2021 12:43:53 PM (3 years ago)
Author:
vboxsync
Message:

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

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

Legend:

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

    r91094 r91104  
    570570}
    571571
    572 void UIMessageCenter::cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName) const
    573 {
    574     alert(0, MessageType_Error,
    575           tr("Failed to add virtual machine <b>%1</b> located in <i>%2</i> because its already present.")
    576              .arg(strMachineName, strMachinePath));
    577 }
    578 
    579 void UIMessageCenter::cannotResolveCollisionAutomatically(const QString &strCollisionName, const QString &strGroupName) const
    580 {
    581     alert(0, MessageType_Error,
    582           tr("<p>You are trying to move machine <nobr><b>%1</b></nobr> to group "
    583              "<nobr><b>%2</b></nobr> which already have another item with the same name.</p>"
    584              "<p>Please resolve this name conflict and try again.</p>")
    585              .arg(strCollisionName, strGroupName));
    586 }
    587 
    588572bool UIMessageCenter::confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName) const
    589573{
     
    731715}
    732716
    733 void UIMessageCenter::cannotRemoveMachine(const CMachine &machine) const
    734 {
    735     error(0, MessageType_Error,
    736           tr("Failed to remove the virtual machine <b>%1</b>.")
    737              .arg(CMachine(machine).GetName()),
    738           UIErrorString::formatErrorInfo(machine));
    739 }
    740 
    741 void UIMessageCenter::cannotRemoveMachine(const CMachine &machine, const CProgress &progress) const
    742 {
    743     error(0, MessageType_Error,
    744           tr("Failed to remove the virtual machine <b>%1</b>.")
    745              .arg(CMachine(machine).GetName()),
    746           UIErrorString::formatErrorInfo(progress));
    747 }
    748 
    749 void UIMessageCenter::cannotRemoveCloudMachine(const CCloudMachine &comMachine) const
    750 {
    751     error(0, MessageType_Error,
    752           tr("Failed to remove the cloud virtual machine <b>%1</b>.")
    753              .arg(CCloudMachine(comMachine).GetName()),
    754           UIErrorString::formatErrorInfo(comMachine));
    755 }
    756 
    757 void UIMessageCenter::cannotRemoveCloudMachine(const CCloudMachine &comMachine, const CProgress &comProgress) const
    758 {
    759     error(0, MessageType_Error,
    760           tr("Failed to remove the cloud virtual machine <b>%1</b>.")
    761              .arg(CCloudMachine(comMachine).GetName()),
    762           UIErrorString::formatErrorInfo(comProgress));
    763 }
    764 
    765717bool UIMessageCenter::warnAboutInaccessibleMedia() const
    766718{
     
    830782}
    831783
    832 void UIMessageCenter::cannotPauseMachine(const CConsole &console) const
    833 {
    834     error(0, MessageType_Error,
    835           tr("Failed to pause the execution of the virtual machine <b>%1</b>.")
    836              .arg(CConsole(console).GetMachine().GetName()),
    837           UIErrorString::formatErrorInfo(console));
    838 }
    839 
    840 void UIMessageCenter::cannotResumeMachine(const CConsole &console) const
    841 {
    842     error(0, MessageType_Error,
    843           tr("Failed to resume the execution of the virtual machine <b>%1</b>.")
    844              .arg(CConsole(console).GetMachine().GetName()),
    845           UIErrorString::formatErrorInfo(console));
    846 }
    847 
    848 void UIMessageCenter::cannotDiscardSavedState(const CMachine &machine) const
    849 {
    850     error(0, MessageType_Error,
    851           tr("Failed to discard the saved state of the virtual machine <b>%1</b>.")
    852              .arg(CMachine(machine).GetName()),
    853           UIErrorString::formatErrorInfo(machine));
    854 }
    855 
    856 void UIMessageCenter::cannotTerminateCloudInstance(const CCloudMachine &comMachine) const
    857 {
    858     error(0, MessageType_Error,
    859           tr("Failed to terminate the cloud instance of the virtual machine <b>%1</b>.")
    860              .arg(CCloudMachine(comMachine).GetName()),
    861           UIErrorString::formatErrorInfo(comMachine));
    862 }
    863 
    864 void UIMessageCenter::cannotTerminateCloudInstance(const CProgress &comProgress, const QString &strMachineName) const
    865 {
    866     error(0, MessageType_Error,
    867           tr("Failed to terminate the cloud instance of the virtual machine <b>%1</b>.")
    868              .arg(strMachineName),
    869           UIErrorString::formatErrorInfo(comProgress));
    870 }
    871 
    872 void UIMessageCenter::cannotSaveMachineState(const CMachine &machine)
    873 {
    874     error(0, MessageType_Error,
    875           tr("Failed to save the state of the virtual machine <b>%1</b>.")
    876              .arg(CMachine(machine).GetName()),
    877           UIErrorString::formatErrorInfo(machine));
    878 }
    879 
    880 void UIMessageCenter::cannotSaveMachineState(const CProgress &progress, const QString &strMachineName)
    881 {
    882     error(0, MessageType_Error,
    883           tr("Failed to save the state of the virtual machine <b>%1</b>.")
    884              .arg(strMachineName),
    885           UIErrorString::formatErrorInfo(progress));
    886 }
    887 
    888 void UIMessageCenter::cannotACPIShutdownMachine(const CConsole &console) const
    889 {
    890     error(0, MessageType_Error,
    891           tr("Failed to send the ACPI Power Button press event to the virtual machine <b>%1</b>.")
    892              .arg(CConsole(console).GetMachine().GetName()),
    893           UIErrorString::formatErrorInfo(console));
    894 }
    895 
    896 void UIMessageCenter::cannotACPIShutdownCloudMachine(const CCloudMachine &comMachine) const
    897 {
    898     error(0, MessageType_Error,
    899           tr("Failed to send the ACPI Power Button press event to the virtual machine <b>%1</b>.")
    900              .arg(CCloudMachine(comMachine).GetName()),
    901           UIErrorString::formatErrorInfo(comMachine));
    902 }
    903 
    904 void UIMessageCenter::cannotACPIShutdownCloudMachine(const CProgress &comProgress, const QString &strMachineName) const
    905 {
    906     error(0, MessageType_Error,
    907           tr("Failed to send the ACPI Power Button press event to the virtual machine <b>%1</b>.")
    908              .arg(strMachineName),
    909           UIErrorString::formatErrorInfo(comProgress));
    910 }
    911 
    912 void UIMessageCenter::cannotPowerUpCloudMachine(const CCloudMachine &comMachine) const
    913 {
    914     error(0, MessageType_Error,
    915           tr("Failed to start the virtual machine <b>%1</b>.")
    916              .arg(CCloudMachine(comMachine).GetName()),
    917           UIErrorString::formatErrorInfo(comMachine));
    918 }
    919 
    920 void UIMessageCenter::cannotPowerUpCloudMachine(const CProgress &comProgress, const QString &strMachineName) const
    921 {
    922     error(0, MessageType_Error,
    923           tr("Failed to start the virtual machine <b>%1</b>.")
    924              .arg(strMachineName),
    925           UIErrorString::formatErrorInfo(comProgress));
    926 }
    927 
    928 void UIMessageCenter::cannotPowerOffMachine(const CConsole &comConsole) const
    929 {
    930     error(0, MessageType_Error,
    931           tr("Failed to stop the virtual machine <b>%1</b>.")
    932              .arg(CConsole(comConsole).GetMachine().GetName()),
    933           UIErrorString::formatErrorInfo(comConsole));
    934 }
    935 
    936 void UIMessageCenter::cannotPowerOffMachine(const CProgress &comProgress, const QString &strMachineName) const
    937 {
    938     error(0, MessageType_Error,
    939           tr("Failed to stop the virtual machine <b>%1</b>.")
    940              .arg(strMachineName),
    941           UIErrorString::formatErrorInfo(comProgress));
    942 }
    943 
    944 void UIMessageCenter::cannotPowerDownCloudMachine(const CCloudMachine &comMachine) const
    945 {
    946     error(0, MessageType_Error,
    947           tr("Failed to stop the virtual machine <b>%1</b>.")
    948              .arg(CCloudMachine(comMachine).GetName()),
    949           UIErrorString::formatErrorInfo(comMachine));
    950 }
    951 
    952 void UIMessageCenter::cannotPowerDownCloudMachine(const CProgress &comProgress, const QString &strMachineName) const
    953 {
    954     error(0, MessageType_Error,
    955           tr("Failed to stop the virtual machine <b>%1</b>.")
    956              .arg(strMachineName),
    957           UIErrorString::formatErrorInfo(comProgress));
    958 }
    959 
    960784bool UIMessageCenter::confirmStartMultipleMachines(const QString &strNames) const
    961785{
     
    965789                             "host system resources. Do you wish to proceed?</p>").arg(strNames),
    966790                          "confirmStartMultipleMachines" /* auto-confirm id */);
    967 }
    968 
    969 void UIMessageCenter::cannotMoveMachine(const CMachine &machine, QWidget *pParent /* = 0 */) const
    970 {
    971     error(pParent, MessageType_Error,
    972           tr("Failed to move the virtual machine <b>%1</b>.")
    973           .arg(CMachine(machine).GetName()),
    974           UIErrorString::formatErrorInfo(machine));
    975 }
    976 
    977 void UIMessageCenter::cannotMoveMachine(const CProgress &progress, const QString &strMachineName, QWidget *pParent /* = 0 */) const
    978 {
    979     error(pParent, MessageType_Error,
    980           tr("Failed to move the virtual machine <b>%1</b>.")
    981           .arg(strMachineName),
    982           UIErrorString::formatErrorInfo(progress));
    983 }
    984 
    985 void UIMessageCenter::cannotCreateConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */)
    986 {
    987     error(pParent, MessageType_Error,
    988           tr("Failed to create console connection for cloud machine <b>%1</b>.")
    989              .arg(CCloudMachine(comMachine).GetName()),
    990           UIErrorString::formatErrorInfo(comMachine));
    991 }
    992 
    993 void UIMessageCenter::cannotCreateConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent /* = 0 */)
    994 {
    995     error(pParent, MessageType_Error,
    996           tr("Failed to create console connection for cloud machine <b>%1</b>.")
    997              .arg(strMachineName),
    998           UIErrorString::formatErrorInfo(comProgress));
    999 }
    1000 
    1001 void UIMessageCenter::cannotDeleteConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */)
    1002 {
    1003     error(pParent, MessageType_Error,
    1004           tr("Failed to delete console connection for cloud machine <b>%1</b>.")
    1005              .arg(CCloudMachine(comMachine).GetName()),
    1006           UIErrorString::formatErrorInfo(comMachine));
    1007 }
    1008 
    1009 void UIMessageCenter::cannotDeleteConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent /* = 0 */)
    1010 {
    1011     error(pParent, MessageType_Error,
    1012           tr("Failed to delete console connection for cloud machine <b>%1</b>.")
    1013              .arg(strMachineName),
    1014           UIErrorString::formatErrorInfo(comProgress));
    1015 }
    1016 
    1017 void UIMessageCenter::publicKeyFilePathIsEmpty(QWidget *pParent /* = 0 */) const
    1018 {
    1019     alert(pParent, MessageType_Error,
    1020           tr("Public key file path is empty."));
    1021 }
    1022 
    1023 void UIMessageCenter::publicKeyFileDoesntExist(const QString &strPath, QWidget *pParent /* = 0 */) const
    1024 {
    1025     alert(pParent, MessageType_Error,
    1026           tr("Failed to open the public key file <nobr><b>%1</b></nobr>. File doesn't exist.")
    1027              .arg(strPath));
    1028 }
    1029 
    1030 void UIMessageCenter::publicKeyFileIsOfTooLargeSize(const QString &strPath, QWidget *pParent /* = 0 */) const
    1031 {
    1032     alert(pParent, MessageType_Error,
    1033           tr("Failed to open the public key file <nobr><b>%1</b></nobr>. File is too large for the key.")
    1034              .arg(strPath));
    1035 }
    1036 
    1037 void UIMessageCenter::publicKeyFileIsntReadable(const QString &strPath, QWidget *pParent /* = 0 */) const
    1038 {
    1039     alert(pParent, MessageType_Error,
    1040           tr("Failed to open the public key file <nobr><b>%1</b></nobr>. Check file permissions.")
    1041              .arg(strPath));
    1042791}
    1043792
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r91094 r91104  
    277277
    278278    /* API: Selector warnings: */
    279     void cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName) const;
    280     void cannotResolveCollisionAutomatically(const QString &strCollisionName, const QString &strGroupName) const;
    281279    bool confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName) const;
     280    /// @todo move after fixing thread stuff
    282281    void cannotSetGroups(const CMachine &machine) const;
    283282    bool confirmMachineItemRemoval(const QStringList &names) const;
    284283    int confirmMachineRemoval(const QList<CMachine> &machines) const;
    285284    int confirmCloudMachineRemoval(const QList<CCloudMachine> &machines) const;
    286     void cannotRemoveMachine(const CMachine &machine) const;
    287     void cannotRemoveMachine(const CMachine &machine, const CProgress &progress) const;
    288     void cannotRemoveCloudMachine(const CCloudMachine &comMachine) const;
    289     void cannotRemoveCloudMachine(const CCloudMachine &comMachine, const CProgress &comProgress) const;
    290285    bool warnAboutInaccessibleMedia() const;
    291286    bool confirmDiscardSavedState(const QString &strNames) const;
     
    294289    bool confirmACPIShutdownMachine(const QString &strNames) const;
    295290    bool confirmPowerOffMachine(const QString &strNames) const;
    296     void cannotPauseMachine(const CConsole &console) const;
    297     void cannotResumeMachine(const CConsole &console) const;
    298     void cannotDiscardSavedState(const CMachine &machine) const;
    299     void cannotTerminateCloudInstance(const CCloudMachine &comMachine) const;
    300     void cannotTerminateCloudInstance(const CProgress &comProgress, const QString &strMachineName) const;
    301     void cannotSaveMachineState(const CMachine &machine);
    302     void cannotSaveMachineState(const CProgress &progress, const QString &strMachineName);
    303     void cannotACPIShutdownMachine(const CConsole &console) const;
    304     void cannotACPIShutdownCloudMachine(const CCloudMachine &comMachine) const;
    305     void cannotACPIShutdownCloudMachine(const CProgress &comProgress, const QString &strMachineName) const;
    306     void cannotPowerUpCloudMachine(const CCloudMachine &comMachine) const;
    307     void cannotPowerUpCloudMachine(const CProgress &comProgress, const QString &strMachineName) const;
    308     void cannotPowerOffMachine(const CConsole &comConsole) const;
    309     void cannotPowerOffMachine(const CProgress &comProgress, const QString &strMachineName) const;
    310     void cannotPowerDownCloudMachine(const CCloudMachine &comMachine) const;
    311     void cannotPowerDownCloudMachine(const CProgress &comProgress, const QString &strMachineName) const;
    312291    bool confirmStartMultipleMachines(const QString &strNames) const;
    313     void cannotMoveMachine(const CMachine &machine, QWidget *pParent = 0) const;
    314     void cannotMoveMachine(const CProgress &progress, const QString &strMachineName, QWidget *pParent = 0) const;
    315     void cannotCreateConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent = 0);
    316     void cannotCreateConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent = 0);
    317     void cannotDeleteConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent = 0);
    318     void cannotDeleteConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent = 0);
    319     void publicKeyFilePathIsEmpty(QWidget *pParent = 0) const;
    320     void publicKeyFileDoesntExist(const QString &strPath, QWidget *pParent = 0) const;
    321     void publicKeyFileIsOfTooLargeSize(const QString &strPath, QWidget *pParent = 0) const;
    322     void publicKeyFileIsntReadable(const QString &strPath, QWidget *pParent = 0) const;
    323292
    324293    /* API: Snapshot warnings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r91094 r91104  
    392392    {
    393393        if (!fIgnoreErrors)
    394             msgCenter().publicKeyFilePathIsEmpty();
     394            UINotificationMessage::warnAboutPublicKeyFilePathIsEmpty();
    395395        return false;
    396396    }
     
    401401    {
    402402        if (!fIgnoreErrors)
    403             msgCenter().publicKeyFileDoesntExist(strPath);
     403            UINotificationMessage::warnAboutPublicKeyFileDoesntExist(strPath);
    404404        return false;
    405405    }
     
    407407    {
    408408        if (!fIgnoreErrors)
    409             msgCenter().publicKeyFileIsOfTooLargeSize(strPath);
     409            UINotificationMessage::warnAboutPublicKeyFileIsOfTooLargeSize(strPath);
    410410        return false;
    411411    }
     
    416416    {
    417417        if (!fIgnoreErrors)
    418             msgCenter().publicKeyFileIsntReadable(strPath);
     418            UINotificationMessage::warnAboutPublicKeyFileIsntReadable(strPath);
    419419        return false;
    420420    }
     
    15431543        comMachine.DiscardSavedState(true);
    15441544        if (!comMachine.isOk())
    1545             msgCenter().cannotDiscardSavedState(comMachine);
     1545            UINotificationMessage::cannotDiscardSavedState(comMachine);
    15461546
    15471547        /* Unlock machine finally: */
     
    16011601        {
    16021602            if (fPause)
    1603                 msgCenter().cannotPauseMachine(comConsole);
     1603                UINotificationMessage::cannotPauseMachine(comConsole);
    16041604            else
    1605                 msgCenter().cannotResumeMachine(comConsole);
     1605                UINotificationMessage::cannotResumeMachine(comConsole);
    16061606        }
    16071607
     
    17721772            comConsole.PowerButton();
    17731773            if (!comConsole.isOk())
    1774                 msgCenter().cannotACPIShutdownMachine(comConsole);
     1774                UINotificationMessage::cannotACPIShutdownMachine(comConsole);
    17751775
    17761776            /* Unlock machine finally: */
     
    24692469    if (!comMachineOld.isNull())
    24702470    {
    2471         msgCenter().cannotReregisterExistingMachine(strTmpFile, comMachineOld.GetName());
     2471        UINotificationMessage::cannotReregisterExistingMachine(comMachineOld.GetName(), strTmpFile);
    24722472        return;
    24732473    }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r90564 r91104  
    678678                case UIChooserNodeType_Machine:
    679679                {
    680                     msgCenter().cannotResolveCollisionAutomatically(strChildName, pParentNode->name());
     680                    UINotificationMessage::cannotResolveCollisionAutomatically(strChildName, pParentNode->name());
    681681                    return;
    682682                }
     
    18851885            if (!comMachine.isOk())
    18861886            {
    1887                 msgCenter().cannotRemoveMachine(comMachine);
     1887                UINotificationMessage::cannotRemoveMachine(comMachine);
    18881888                continue;
    18891889            }
     
    18981898            if (!comMachine.isOk())
    18991899            {
    1900                 msgCenter().cannotRemoveMachine(comMachine);
     1900                UINotificationMessage::cannotRemoveMachine(comMachine);
    19011901                continue;
    19021902            }
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r91103 r91104  
    101101        QApplication::translate("UIMessageCenter", "Encryption password for <nobr>ID = '%1'</nobr> is invalid.")
    102102                                                   .arg(strPasswordId));
     103}
     104
     105/* static */
     106void UINotificationMessage::cannotReregisterExistingMachine(const QString &strName, const QString &strLocation)
     107{
     108    createMessage(
     109        QApplication::translate("UIMessageCenter", "Can't add machine ..."),
     110        QApplication::translate("UIMessageCenter", "Failed to add virtual machine <b>%1</b> located in <i>%2</i> because its "
     111                                                   "already present.")
     112                                                   .arg(strName, strLocation));
     113}
     114
     115/* static */
     116void UINotificationMessage::cannotResolveCollisionAutomatically(const QString &strCollisionName, const QString &strGroupName)
     117{
     118    createMessage(
     119        QApplication::translate("UIMessageCenter", "Can't resolve collision ..."),
     120        QApplication::translate("UIMessageCenter", "<p>You are trying to move machine <nobr><b>%1</b></nobr> to group "
     121                                                   "<nobr><b>%2</b></nobr> which already have another item with the same "
     122                                                   "name.</p><p>Please resolve this name conflict and try again.</p>")
     123                                                   .arg(strCollisionName, strGroupName));
     124}
     125
     126/* static */
     127void UINotificationMessage::warnAboutPublicKeyFilePathIsEmpty()
     128{
     129    createMessage(
     130        QApplication::translate("UIMessageCenter", "Public key missing ..."),
     131        QApplication::translate("UIMessageCenter", "Public key file path is empty."));
     132}
     133
     134/* static */
     135void UINotificationMessage::warnAboutPublicKeyFileDoesntExist(const QString &strPath)
     136{
     137    createMessage(
     138        QApplication::translate("UIMessageCenter", "Public key missing ..."),
     139        QApplication::translate("UIMessageCenter", "Failed to open the public key file <nobr><b>%1</b></nobr>. "
     140                                                   "File doesn't exist.").arg(strPath));
     141}
     142
     143/* static */
     144void UINotificationMessage::warnAboutPublicKeyFileIsOfTooLargeSize(const QString &strPath)
     145{
     146    createMessage(
     147        QApplication::translate("UIMessageCenter", "Public key too large ..."),
     148        QApplication::translate("UIMessageCenter", "Failed to open the public key file <nobr><b>%1</b></nobr>. File is too "
     149                                                   "large for the key.").arg(strPath));
     150}
     151
     152/* static */
     153void UINotificationMessage::warnAboutPublicKeyFileIsntReadable(const QString &strPath)
     154{
     155    createMessage(
     156        QApplication::translate("UIMessageCenter", "Public key isn't readable ..."),
     157        QApplication::translate("UIMessageCenter", "Failed to open the public key file <nobr><b>%1</b></nobr>. Check file "
     158                                                   "permissions.").arg(strPath));
    103159}
    104160
     
    302358
    303359/* static */
     360void UINotificationMessage::cannotPauseMachine(const CConsole &comConsole)
     361{
     362    createMessage(
     363        QApplication::translate("UIMessageCenter", "Can't pause machine ..."),
     364        QApplication::translate("UIMessageCenter", "Failed to pause the execution of the virtual machine <b>%1</b>.")
     365                                                   .arg(CConsole(comConsole).GetMachine().GetName()) +
     366        UIErrorString::formatErrorInfo(comConsole));
     367}
     368
     369/* static */
     370void UINotificationMessage::cannotResumeMachine(const CConsole &comConsole)
     371{
     372    createMessage(
     373        QApplication::translate("UIMessageCenter", "Can't resume machine ..."),
     374        QApplication::translate("UIMessageCenter", "Failed to resume the execution of the virtual machine <b>%1</b>.")
     375                                                   .arg(CConsole(comConsole).GetMachine().GetName()) +
     376        UIErrorString::formatErrorInfo(comConsole));
     377}
     378
     379/* static */
     380void UINotificationMessage::cannotACPIShutdownMachine(const CConsole &comConsole)
     381{
     382    createMessage(
     383        QApplication::translate("UIMessageCenter", "Can't shutdown machine ..."),
     384        QApplication::translate("UIMessageCenter", "Failed to send the ACPI Power Button press event to the virtual machine "
     385                                                   "<b>%1</b>.").arg(CConsole(comConsole).GetMachine().GetName()) +
     386        UIErrorString::formatErrorInfo(comConsole));
     387}
     388
     389/* static */
    304390void UINotificationMessage::cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation)
    305391{
     
    309395                                                   .arg(strLocation) +
    310396        UIErrorString::formatErrorInfo(comVBox));
     397}
     398
     399/* static */
     400void UINotificationMessage::cannotDiscardSavedState(const CMachine &comMachine)
     401{
     402    createMessage(
     403        QApplication::translate("UIMessageCenter", "Can't discard saved state ..."),
     404        QApplication::translate("UIMessageCenter", "Failed to discard the saved state of the virtual machine <b>%1</b>.")
     405                                                   .arg(CMachine(comMachine).GetName()) +
     406        UIErrorString::formatErrorInfo(comMachine));
     407}
     408
     409/* static */
     410void UINotificationMessage::cannotRemoveMachine(const CMachine &comMachine)
     411{
     412    createMessage(
     413        QApplication::translate("UIMessageCenter", "Can't remove machine ..."),
     414        QApplication::translate("UIMessageCenter", "Failed to remove the virtual machine <b>%1</b>.")
     415                                                   .arg(CMachine(comMachine).GetName()) +
     416        UIErrorString::formatErrorInfo(comMachine));
    311417}
    312418
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r91102 r91104  
    7878    /** @} */
    7979
     80    /** @name Simple VirtualBox Manager warnings.
     81      * @{ */
     82        /** Notifies about inability to register existing machine.
     83          * @param  streName     Brings the machine name.
     84          * @param  strLocation  Brings the machine location. */
     85        static void cannotReregisterExistingMachine(const QString &strName, const QString &strLocation);
     86
     87        /** Notifies about inability to resolve collision automatically.
     88          * @param  strCollisionName  Brings the collision VM name.
     89          * @param  strGroupName      Brings the group name. */
     90        static void cannotResolveCollisionAutomatically(const QString &strCollisionName, const QString &strGroupName);
     91
     92        /** Notifies about inability to remove machine.
     93          * @param  comMachine  Brings machine being removed. */
     94        static void warnAboutPublicKeyFilePathIsEmpty();
     95        /** Notifies about inability to remove machine.
     96          * @param  comMachine  Brings machine being removed. */
     97        static void warnAboutPublicKeyFileDoesntExist(const QString &strPath);
     98        /** Notifies about inability to remove machine.
     99          * @param  comMachine  Brings machine being removed. */
     100        static void warnAboutPublicKeyFileIsOfTooLargeSize(const QString &strPath);
     101        /** Notifies about inability to remove machine.
     102          * @param  comMachine  Brings machine being removed. */
     103        static void warnAboutPublicKeyFileIsntReadable(const QString &strPath);
     104    /** @} */
    80105
    81106    /** @name Simple Runtime UI warnings.
     
    134159          * @param  strLocation  Brings the medium location. */
    135160        static void cannotOpenMedium(const CVirtualBox &comVBox, const QString &strLocation);
     161
     162        /** Notifies about inability to pause machine.
     163          * @param  comConsole  Brings console trying to pause machine. */
     164        static void cannotPauseMachine(const CConsole &comConsole);
     165        /** Notifies about inability to resume machine.
     166          * @param  comConsole  Brings console trying to resume machine. */
     167        static void cannotResumeMachine(const CConsole &comConsole);
     168        /** Notifies about inability to ACPI shutdown machine.
     169          * @param  comConsole  Brings console trying to shutdown machine. */
     170        static void cannotACPIShutdownMachine(const CConsole &comConsole);
    136171    /** @} */
    137172
     
    142177          * @param  strLocation  Brings the machine location. */
    143178        static void cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation);
     179
     180        /** Notifies about inability to discard saved state.
     181          * @param  comMachine  Brings the collision VM name. */
     182        static void cannotDiscardSavedState(const CMachine &comMachine);
     183        /** Notifies about inability to remove machine.
     184          * @param  comMachine  Brings machine being removed. */
     185        static void cannotRemoveMachine(const CMachine &comMachine);
    144186    /** @} */
    145187
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r91076 r91104  
    366366    console().PowerButton();
    367367    if (!console().isOk())
    368         msgCenter().cannotACPIShutdownMachine(console());
     368        UINotificationMessage::cannotACPIShutdownMachine(console());
    369369}
    370370
     
    435435    {
    436436        if (fOn)
    437             msgCenter().cannotPauseMachine(console());
     437            UINotificationMessage::cannotPauseMachine(console());
    438438        else
    439             msgCenter().cannotResumeMachine(console());
     439            UINotificationMessage::cannotResumeMachine(console());
    440440    }
    441441
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