VirtualBox

Changeset 91169 in vbox


Ignore:
Timestamp:
Sep 8, 2021 6:45:58 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146823
Message:

FE/Qt: bugref:10067: Moving Runtime UI messages from UIMessageCenter to UINotificationCenter; A bit of refactoring for UIMessageCenter Cloud Console Manager, Runtime UI and wizards stuff as well.

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

Legend:

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

    r91165 r91169  
    723723}
    724724
     725void UIMessageCenter::cannotAddDiskEncryptionPassword(const CConsole &console)
     726{
     727    error(0, MessageType_Error,
     728          tr("Bad password or authentication failure."),
     729          UIErrorString::formatErrorInfo(console));
     730}
     731
    725732bool UIMessageCenter::confirmResetMachine(const QString &strNames) const
    726733{
     
    12971304}
    12981305
     1306bool UIMessageCenter::confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent /* = 0 */) const
     1307{
     1308    return questionBinary(pParent, MessageType_Question,
     1309                          tr("<p>Do you want to remove the cloud console application <nobr><b>%1</b>?</nobr></p>")
     1310                             .arg(strName),
     1311                          0 /* auto-confirm id */,
     1312                          tr("Remove") /* ok button text */,
     1313                          QString() /* cancel button text */,
     1314                          false /* ok button by default? */);
     1315}
     1316
     1317bool UIMessageCenter::confirmCloudConsoleProfileRemoval(const QString &strName, QWidget *pParent /* = 0 */) const
     1318{
     1319    return questionBinary(pParent, MessageType_Question,
     1320                          tr("<p>Do you want to remove the cloud console profile <nobr><b>%1</b>?</nobr></p>")
     1321                             .arg(strName),
     1322                          0 /* auto-confirm id */,
     1323                          tr("Remove") /* ok button text */,
     1324                          QString() /* cancel button text */,
     1325                          false /* ok button by default? */);
     1326}
     1327
    12991328void UIMessageCenter::cannotAcquireHardDiskLocation(const CMedium &comMedium, QWidget *pParent /* = 0 */) const
    13001329{
     
    14481477}
    14491478
    1450 bool UIMessageCenter::confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent /* = 0 */) const
    1451 {
    1452     return questionBinary(pParent, MessageType_Question,
    1453                           tr("<p>Do you want to remove the cloud console application <nobr><b>%1</b>?</nobr></p>")
    1454                              .arg(strName),
    1455                           0 /* auto-confirm id */,
    1456                           tr("Remove") /* ok button text */,
    1457                           QString() /* cancel button text */,
    1458                           false /* ok button by default? */);
    1459 }
    1460 
    1461 bool UIMessageCenter::confirmCloudConsoleProfileRemoval(const QString &strName, QWidget *pParent /* = 0 */) const
    1462 {
    1463     return questionBinary(pParent, MessageType_Question,
    1464                           tr("<p>Do you want to remove the cloud console profile <nobr><b>%1</b>?</nobr></p>")
    1465                              .arg(strName),
    1466                           0 /* auto-confirm id */,
    1467                           tr("Remove") /* ok button text */,
    1468                           QString() /* cancel button text */,
    1469                           false /* ok button by default? */);
    1470 }
    1471 
    1472 bool UIMessageCenter::confirmHardDisklessMachine(QWidget *pParent /* = 0*/) const
    1473 {
    1474     return questionBinary(pParent, MessageType_Warning,
    1475                           tr("You are about to create a new virtual machine without a hard disk. "
    1476                              "You will not be able to install an operating system on the machine "
    1477                              "until you add one. In the mean time you will only be able to start the "
    1478                              "machine using a virtual optical disk or from the network."),
    1479                           0 /* auto-confirm id */,
    1480                           tr("Continue", "no hard disk attached"),
    1481                           tr("Go Back", "no hard disk attached"));
    1482 }
    1483 
    1484 void UIMessageCenter::cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent /* = 0*/) const
    1485 {
    1486     error(pParent, MessageType_Error,
    1487           tr("Failed to create a new virtual machine."),
    1488           UIErrorString::formatErrorInfo(vbox));
    1489 }
    1490 
    1491 void UIMessageCenter::cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent /* = 0*/) const
    1492 {
    1493     error(pParent, MessageType_Error,
    1494           tr("Failed to register the virtual machine <b>%1</b>.")
    1495              .arg(strMachineName),
    1496           UIErrorString::formatErrorInfo(vbox));
    1497 }
    1498 
    1499 void UIMessageCenter::cannotCreateClone(const CMachine &machine, QWidget *pParent /* = 0*/) const
    1500 {
    1501     error(pParent, MessageType_Error,
    1502           tr("Failed to clone the virtual machine <b>%1</b>.")
    1503              .arg(CMachine(machine).GetName()),
    1504           UIErrorString::formatErrorInfo(machine));
    1505 }
    1506 
    1507 void UIMessageCenter::cannotCreateClone(const CProgress &progress, const QString &strMachineName, QWidget *pParent /* = 0*/) const
    1508 {
    1509     error(pParent, MessageType_Error,
    1510           tr("Failed to clone the virtual machine <b>%1</b>.")
    1511              .arg(strMachineName),
     1479void UIMessageCenter::cannotStartMachine(const CConsole &console, const QString &strName) const
     1480{
     1481    error(0, MessageType_Error,
     1482          tr("Failed to start the virtual machine <b>%1</b>.")
     1483             .arg(strName),
     1484          UIErrorString::formatErrorInfo(console));
     1485}
     1486
     1487void UIMessageCenter::cannotStartMachine(const CProgress &progress, const QString &strName) const
     1488{
     1489    error(0, MessageType_Error,
     1490          tr("Failed to start the virtual machine <b>%1</b>.")
     1491             .arg(strName),
    15121492          UIErrorString::formatErrorInfo(progress));
    15131493}
    15141494
    1515 void UIMessageCenter::cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent /* = 0*/) const
    1516 {
    1517     alert(pParent, MessageType_Info,
    1518           tr("<p>The hard disk storage unit at location <b>%1</b> already exists. "
    1519              "You cannot create a new virtual hard disk that uses this location "
    1520              "because it can be already used by another virtual hard disk.</p>"
    1521              "<p>Please specify a different location.</p>")
    1522              .arg(strLocation));
    1523 }
    1524 
    1525 void UIMessageCenter::cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation, QWidget *pParent /* = 0*/) const
    1526 {
    1527     error(pParent, MessageType_Error,
    1528           tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    1529              .arg(strLocation),
    1530           UIErrorString::formatErrorInfo(vbox));
    1531 }
    1532 
    1533 void UIMessageCenter::cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /* = 0*/) const
    1534 {
    1535     error(pParent, MessageType_Error,
    1536           tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    1537              .arg(strLocation),
    1538           UIErrorString::formatErrorInfo(medium));
    1539 }
    1540 
    1541 void UIMessageCenter::cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /* = 0*/) const
    1542 {
    1543     error(pParent, MessageType_Error,
    1544           tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    1545              .arg(strLocation),
    1546           UIErrorString::formatErrorInfo(progress));
    1547 }
    1548 
    1549 void UIMessageCenter::cannotCreateHardDiskStorageInFAT(const QString &strLocation, QWidget *pParent /* = 0 */) const
    1550 {
    1551     alert(pParent, MessageType_Info,
    1552           tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr> FAT file systems have 4GB file size limit.")
    1553           .arg(strLocation));
    1554 }
    1555 
    1556 void UIMessageCenter::cannotCreateMediumStorage(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent /* = 0 */) const
    1557 {
    1558     error(pParent, MessageType_Error,
    1559           tr("Failed to create the virtual disk image storage <nobr><b>%1</b>.</nobr>")
    1560              .arg(strLocation),
    1561           UIErrorString::formatErrorInfo(comVBox));
    1562 }
    1563 
    1564 void UIMessageCenter::cannotCreateMediumStorage(const CMedium &comMedium, const QString &strLocation, QWidget *pParent /* = 0 */) const
    1565 {
    1566     error(pParent, MessageType_Error,
    1567           tr("Failed to create the virtual disk image storage <nobr><b>%1</b>.</nobr>")
    1568              .arg(strLocation),
    1569           UIErrorString::formatErrorInfo(comMedium));
    1570 }
    1571 
    1572 void UIMessageCenter::cannotCreateMediumStorage(const CProgress &comProgress, const QString &strLocation, QWidget *pParent /* = 0 */) const
    1573 {
    1574     error(pParent, MessageType_Error,
    1575           tr("Failed to create the virtual disk image storage <nobr><b>%1</b>.</nobr>")
    1576              .arg(strLocation),
    1577           UIErrorString::formatErrorInfo(comProgress));
    1578 }
    1579 
    1580 void UIMessageCenter::cannotRemoveMachineFolder(const QString &strFolderName, QWidget *pParent /* = 0*/) const
    1581 {
    1582     alert(pParent, MessageType_Critical,
    1583           tr("<p>Cannot remove the machine folder <nobr><b>%1</b>.</nobr></p>"
    1584              "<p>Please check that this folder really exists and that you have permissions to remove it.</p>")
    1585              .arg(QFileInfo(strFolderName).fileName()));
    1586 }
    1587 
    1588 void UIMessageCenter::cannotRewriteMachineFolder(const QString &strFolderName, QWidget *pParent /* = 0*/) const
    1589 {
    1590     QFileInfo fi(strFolderName);
    1591     alert(pParent, MessageType_Critical,
    1592           tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
    1593              "<p>This folder already exists and possibly belongs to another machine.</p>")
    1594              .arg(fi.fileName()).arg(fi.absolutePath()));
    1595 }
    1596 
    1597 void UIMessageCenter::cannotCreateMachineFolder(const QString &strFolderName, QWidget *pParent /* = 0*/) const
    1598 {
    1599     QFileInfo fi(strFolderName);
    1600     alert(pParent, MessageType_Critical,
    1601           tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
    1602              "<p>Please check that the parent really exists and that you have permissions to create the machine folder.</p>")
    1603              .arg(fi.fileName()).arg(fi.absolutePath()));
    1604 }
    1605 
    1606 void UIMessageCenter::cannotCreateAppliance(const CVirtualBox &comVBox, QWidget *pParent /* = 0 */) const
    1607 {
    1608     error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual appliance.</p>"),
    1609           UIErrorString::formatErrorInfo(comVBox));
    1610 }
    1611 
    1612 void UIMessageCenter::cannotCreateVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
    1613 {
    1614     error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual system description.</p>"),
    1615           UIErrorString::formatErrorInfo(comAppliance));
    1616 }
    1617 
    1618 void UIMessageCenter::cannotAcquireVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
    1619 {
    1620     error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual system description.</p>"),
    1621           UIErrorString::formatErrorInfo(comAppliance));
    1622 }
    1623 
    1624 void UIMessageCenter::cannotAddVirtualSystemDescriptionValue(const CVirtualSystemDescription &comDescription,
    1625                                                              QWidget *pParent /* = 0 */) const
    1626 {
    1627     error(pParent, MessageType_Critical, tr("<p>Cannot add a virtual system description value.</p>"),
    1628           UIErrorString::formatErrorInfo(comDescription));
    1629 }
    1630 
    1631 void UIMessageCenter::cannotAcquireVirtualSystemDescriptionFormProperty(const CVirtualSystemDescriptionForm &comForm,
    1632                                                                         QWidget *pParent /* = 0 */) const
    1633 {
    1634     error(pParent, MessageType_Critical, tr("<p>Cannot acquire a virtual system description property.</p>"),
    1635           UIErrorString::formatErrorInfo(comForm));
    1636 }
    1637 
    1638 void UIMessageCenter::cannotImportAppliance(CAppliance &appliance, QWidget *pParent /* = 0*/) const
    1639 {
    1640     /* Preserve error-info: */
    1641     QString strErrorInfo = UIErrorString::formatErrorInfo(appliance);
    1642     /* Add the warnings in the case of an early error: */
    1643     QString strWarningInfo;
    1644     foreach(const QString &strWarning, appliance.GetWarnings())
    1645         strWarningInfo += QString("<br />Warning: %1").arg(strWarning);
    1646     if (!strWarningInfo.isEmpty())
    1647         strWarningInfo = "<br />" + strWarningInfo;
    1648     /* Show the error: */
    1649     error(pParent, MessageType_Error,
    1650           tr("Failed to open/interpret appliance <b>%1</b>.")
    1651              .arg(appliance.GetPath()),
    1652           strWarningInfo + strErrorInfo);
    1653 }
    1654 
    1655 void UIMessageCenter::cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /* = 0*/) const
    1656 {
    1657     error(pParent, MessageType_Error,
    1658           tr("Failed to import appliance <b>%1</b>.")
    1659              .arg(strPath),
    1660           UIErrorString::formatErrorInfo(progress));
    1661 }
    1662 
    1663 bool UIMessageCenter::cannotCheckFiles(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
    1664 {
    1665     error(pParent, MessageType_Error,
    1666           tr("Failed to check files."),
    1667           UIErrorString::formatErrorInfo(comAppliance));
    1668     return false;
    1669 }
    1670 
    1671 bool UIMessageCenter::cannotCheckFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent /* = 0 */) const
    1672 {
    1673     error(pParent, MessageType_Error,
    1674           tr("Failed to check files."),
    1675           UIErrorString::formatErrorInfo(comVFSExplorer));
    1676     return false;
    1677 }
    1678 
    1679 bool UIMessageCenter::cannotCheckFiles(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
    1680 {
    1681     error(pParent, MessageType_Error,
    1682           tr("Failed to check files."),
    1683           UIErrorString::formatErrorInfo(comProgress));
    1684     return false;
    1685 }
    1686 
    1687 bool UIMessageCenter::cannotRemoveFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent /* = 0 */) const
    1688 {
    1689     error(pParent, MessageType_Error,
    1690           tr("Failed to remove file."),
    1691           UIErrorString::formatErrorInfo(comVFSExplorer));
    1692     return false;
    1693 }
    1694 
    1695 bool UIMessageCenter::cannotRemoveFiles(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
    1696 {
    1697     error(pParent, MessageType_Error,
    1698           tr("Failed to remove file."),
    1699           UIErrorString::formatErrorInfo(comProgress));
    1700     return false;
    1701 }
    1702 
    1703 bool UIMessageCenter::confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent /* = 0*/) const
    1704 {
    1705     return questionBinary(pParent, MessageType_Warning,
    1706                           tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>"
    1707                              "<p>If you continue the runtime state of the exported machine(s) will be discarded. "
    1708                              "The other machine(s) will not be changed.</p>",
    1709                              "This text is never used with n == 0. Feel free to drop the %n where possible, "
    1710                              "we only included it because of problems with Qt Linguist (but the user can see "
    1711                              "how many machines are in the list and doesn't need to be told).", machineNames.size())
    1712                              .arg(machineNames.join(", ")),
    1713                           0 /* auto-confirm id */,
    1714                           tr("Continue"));
    1715 }
    1716 
    1717 bool UIMessageCenter::cannotExportAppliance(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
    1718 {
    1719     error(pParent, MessageType_Error,
    1720           tr("Failed to prepare the export of the appliance <b>%1</b>.")
    1721              .arg(CAppliance(comAppliance).GetPath()),
    1722           UIErrorString::formatErrorInfo(comAppliance));
    1723     return false;
    1724 }
    1725 
    1726 void UIMessageCenter::cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent /* = 0 */) const
    1727 {
    1728     error(pParent, MessageType_Error,
    1729           tr("Failed to prepare the export of the appliance <b>%1</b>.")
    1730              .arg(strPath),
    1731           UIErrorString::formatErrorInfo(machine));
    1732 }
    1733 
    1734 bool UIMessageCenter::cannotExportAppliance(const CProgress &comProgress, const QString &strPath, QWidget *pParent /* = 0 */) const
    1735 {
    1736     error(pParent, MessageType_Error,
    1737           tr("Failed to export appliance <b>%1</b>.")
    1738              .arg(strPath),
    1739           UIErrorString::formatErrorInfo(comProgress));
    1740     return false;
    1741 }
    1742 
    1743 bool UIMessageCenter::cannotAddDiskEncryptionPassword(const CAppliance &comAppliance, QWidget *pParent /* = 0 */)
    1744 {
    1745     error(pParent, MessageType_Error,
    1746           tr("Bad password or authentication failure."),
    1747           UIErrorString::formatErrorInfo(comAppliance));
    1748     return false;
    1749 }
    1750 
    1751 void UIMessageCenter::cannotRunUnattendedGuestInstall(const CUnattended &comUnattendedInstall, QWidget *pParent /* = 0 */)
    1752 {
    1753     COMErrorInfo comErrorInfo =  comUnattendedInstall.errorInfo();    \
    1754     error(pParent, MessageType_Error,
    1755           tr("An error has occured during unattended guest install setup."),
    1756           UIErrorString::formatErrorInfo(comErrorInfo));
    1757 }
    1758 
    1759 
    1760 void UIMessageCenter::showRuntimeError(const CConsole &console, bool fFatal, const QString &strErrorId, const QString &strErrorMsg) const
    1761 {
    1762     /* Prepare auto-confirm id: */
    1763     QByteArray autoConfimId = "showRuntimeError.";
    1764 
    1765     /* Prepare variables: */
    1766     CConsole console1 = console;
    1767     KMachineState state = console1.GetState();
    1768     MessageType enmType;
    1769     QString severity;
    1770 
    1771     /// @todo Move to Runtime UI!
    1772     /* Preprocessing: */
    1773     if (fFatal)
    1774     {
    1775         /* The machine must be paused on fFatal errors: */
    1776         Assert(state == KMachineState_Paused);
    1777         if (state != KMachineState_Paused)
    1778             console1.Pause();
    1779     }
    1780 
    1781     /* Compose type, severity, advance confirm id: */
    1782     if (fFatal)
    1783     {
    1784         enmType = MessageType_Critical;
    1785         severity = tr("<nobr>Fatal Error</nobr>", "runtime error info");
    1786         autoConfimId += "fatal.";
    1787     }
    1788     else if (state == KMachineState_Paused)
    1789     {
    1790         enmType = MessageType_Error;
    1791         severity = tr("<nobr>Non-Fatal Error</nobr>", "runtime error info");
    1792         autoConfimId += "error.";
    1793     }
     1495bool UIMessageCenter::warnAboutNetworkInterfaceNotFound(const QString &strMachineName, const QString &strIfNames) const
     1496{
     1497    return questionBinary(0, MessageType_Error,
     1498                          tr("<p>Could not start the machine <b>%1</b> because the following "
     1499                             "physical network interfaces were not found:</p><p><b>%2</b></p>"
     1500                             "<p>You can either change the machine's network settings or stop the machine.</p>")
     1501                             .arg(strMachineName, strIfNames),
     1502                          0 /* auto-confirm id */,
     1503                          tr("Change Network Settings"), tr("Close VM"));
     1504}
     1505
     1506bool UIMessageCenter::warnAboutVirtExInactiveFor64BitsGuest(bool fHWVirtExSupported) const
     1507{
     1508    if (fHWVirtExSupported)
     1509        return questionBinary(0, MessageType_Error,
     1510                              tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "
     1511                                 "Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.</p>"
     1512                                 "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"),
     1513                              0 /* auto-confirm id */,
     1514                              tr("Close VM"), tr("Continue"));
    17941515    else
    1795     {
    1796         enmType = MessageType_Warning;
    1797         severity = tr("<nobr>Warning</nobr>", "runtime error info");
    1798         autoConfimId += "warning.";
    1799     }
    1800     /* Advance auto-confirm id: */
    1801     autoConfimId += strErrorId.toUtf8();
    1802 
    1803     /* Format error-details: */
    1804     QString formatted("<!--EOM-->");
    1805     if (!strErrorMsg.isEmpty())
    1806         formatted.prepend(QString("<p>%1.</p>").arg(UITranslator::emphasize(strErrorMsg)));
    1807     if (!strErrorId.isEmpty())
    1808         formatted += QString("<table bgcolor=%1 border=0 cellspacing=5 "
    1809                              "cellpadding=0 width=100%>"
    1810                              "<tr><td>%2</td><td>%3</td></tr>"
    1811                              "<tr><td>%4</td><td>%5</td></tr>"
    1812                              "</table>")
    1813                              .arg(QApplication::palette().color(QPalette::Active, QPalette::Window).name(QColor::HexRgb))
    1814                              .arg(tr("<nobr>Error ID: </nobr>", "runtime error info"), strErrorId)
    1815                              .arg(tr("Severity: ", "runtime error info"), severity);
    1816     if (!formatted.isEmpty())
    1817         formatted = "<qt>" + formatted + "</qt>";
    1818 
    1819     /* Show the error: */
    1820     if (enmType == MessageType_Critical)
    1821     {
    1822         error(0, enmType,
    1823               tr("<p>A fatal error has occurred during virtual machine execution! "
    1824                  "The virtual machine will be powered off. Please copy the following error message "
    1825                  "using the clipboard to help diagnose the problem:</p>"),
    1826               formatted, autoConfimId.data());
    1827     }
    1828     else if (enmType == MessageType_Error)
    1829     {
    1830         error(0, enmType,
    1831               tr("<p>An error has occurred during virtual machine execution! "
    1832                  "The error details are shown below. You may try to correct the error "
    1833                  "and resume the virtual machine execution.</p>"),
    1834               formatted, autoConfimId.data());
    1835     }
     1516        return questionBinary(0, MessageType_Error,
     1517                              tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
     1518                                 "Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot."),
     1519                              0 /* auto-confirm id */,
     1520                              tr("Close VM"), tr("Continue"));
     1521}
     1522
     1523bool UIMessageCenter::warnAboutVirtExInactiveForRecommendedGuest(bool fHWVirtExSupported) const
     1524{
     1525    if (fHWVirtExSupported)
     1526        return questionBinary(0, MessageType_Error,
     1527                              tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "
     1528                                 "Certain guests (e.g. OS/2 and QNX) require this feature.</p>"
     1529                                 "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"),
     1530                              0 /* auto-confirm id */,
     1531                              tr("Close VM"), tr("Continue"));
    18361532    else
    1837     {
    1838         /** @todo r=bird: This is a very annoying message as it refers to invisible text
    1839          * below.  User have to expand "Details" to see what actually went wrong.
    1840          * Probably a good idea to check strErrorId and see if we can come up with better
    1841          * messages here, at least for common stuff like DvdOrFloppyImageInaccesssible... */
    1842         error(0, enmType,
    1843               tr("<p>The virtual machine execution ran into a non-fatal problem as described below. "
    1844                  "We suggest that you take appropriate action to prevent the problem from recurring.</p>"),
    1845               formatted, autoConfimId.data());
    1846     }
    1847 
    1848     /// @todo Move to Runtime UI!
    1849     /* Postprocessing: */
    1850     if (fFatal)
    1851     {
    1852         /* Power off after a fFatal error: */
    1853         LogRel(("GUI: Powering VM off after a fatal runtime error...\n"));
    1854         console1.PowerDown();
    1855     }
    1856 }
    1857 
    1858 bool UIMessageCenter::remindAboutGuruMeditation(const QString &strLogFolder)
     1533        return questionBinary(0, MessageType_Error,
     1534                              tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
     1535                                 "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"),
     1536                              0 /* auto-confirm id */,
     1537                              tr("Close VM"), tr("Continue"));
     1538}
     1539
     1540void UIMessageCenter::warnAboutVBoxSVCUnavailable() const
     1541{
     1542    alert(0, MessageType_Critical,
     1543          tr("<p>A critical error has occurred while running the virtual "
     1544             "machine and the machine execution should be stopped.</p>"
     1545             ""
     1546             "<p>For help, please see the Community section on "
     1547             "<a href=https://www.virtualbox.org>https://www.virtualbox.org</a> "
     1548             "or your support contract. Please provide the contents of the "
     1549             "log file <tt>VBox.log</tt>, "
     1550             "which you can find in the virtual machine log directory, "
     1551             "as well as a description of what you were doing when this error happened. "
     1552             ""
     1553             "Note that you can also access the above file by selecting <b>Show Log</b> "
     1554             "from the <b>Machine</b> menu of the main VirtualBox window.</p>"
     1555             ""
     1556             "<p>Press <b>OK</b> to power off the machine.</p>"),
     1557          0 /* auto-confirm id */);
     1558}
     1559
     1560bool UIMessageCenter::warnAboutGuruMeditation(const QString &strLogFolder)
    18591561{
    18601562    return questionBinary(0, MessageType_GuruMeditation,
     
    18821584}
    18831585
    1884 void UIMessageCenter::warnAboutVBoxSVCUnavailable() const
    1885 {
    1886     alert(0, MessageType_Critical,
    1887           tr("<p>A critical error has occurred while running the virtual "
    1888              "machine and the machine execution should be stopped.</p>"
    1889              ""
    1890              "<p>For help, please see the Community section on "
    1891              "<a href=https://www.virtualbox.org>https://www.virtualbox.org</a> "
    1892              "or your support contract. Please provide the contents of the "
    1893              "log file <tt>VBox.log</tt>, "
    1894              "which you can find in the virtual machine log directory, "
    1895              "as well as a description of what you were doing when this error happened. "
    1896              ""
    1897              "Note that you can also access the above file by selecting <b>Show Log</b> "
    1898              "from the <b>Machine</b> menu of the main VirtualBox window.</p>"
    1899              ""
    1900              "<p>Press <b>OK</b> to power off the machine.</p>"),
    1901           0 /* auto-confirm id */);
    1902 }
    1903 
    1904 bool UIMessageCenter::warnAboutVirtExInactiveFor64BitsGuest(bool fHWVirtExSupported) const
    1905 {
    1906     if (fHWVirtExSupported)
    1907         return questionBinary(0, MessageType_Error,
    1908                               tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "
    1909                                  "Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.</p>"
    1910                                  "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"),
    1911                               0 /* auto-confirm id */,
    1912                               tr("Close VM"), tr("Continue"));
     1586void UIMessageCenter::showRuntimeError(const CConsole &console, bool fFatal, const QString &strErrorId, const QString &strErrorMsg) const
     1587{
     1588    /* Prepare auto-confirm id: */
     1589    QByteArray autoConfimId = "showRuntimeError.";
     1590
     1591    /* Prepare variables: */
     1592    CConsole console1 = console;
     1593    KMachineState state = console1.GetState();
     1594    MessageType enmType;
     1595    QString severity;
     1596
     1597    /// @todo Move to Runtime UI!
     1598    /* Preprocessing: */
     1599    if (fFatal)
     1600    {
     1601        /* The machine must be paused on fFatal errors: */
     1602        Assert(state == KMachineState_Paused);
     1603        if (state != KMachineState_Paused)
     1604            console1.Pause();
     1605    }
     1606
     1607    /* Compose type, severity, advance confirm id: */
     1608    if (fFatal)
     1609    {
     1610        enmType = MessageType_Critical;
     1611        severity = tr("<nobr>Fatal Error</nobr>", "runtime error info");
     1612        autoConfimId += "fatal.";
     1613    }
     1614    else if (state == KMachineState_Paused)
     1615    {
     1616        enmType = MessageType_Error;
     1617        severity = tr("<nobr>Non-Fatal Error</nobr>", "runtime error info");
     1618        autoConfimId += "error.";
     1619    }
    19131620    else
    1914         return questionBinary(0, MessageType_Error,
    1915                               tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
    1916                                  "Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot."),
    1917                               0 /* auto-confirm id */,
    1918                               tr("Close VM"), tr("Continue"));
    1919 }
    1920 
    1921 bool UIMessageCenter::warnAboutVirtExInactiveForRecommendedGuest(bool fHWVirtExSupported) const
    1922 {
    1923     if (fHWVirtExSupported)
    1924         return questionBinary(0, MessageType_Error,
    1925                               tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "
    1926                                  "Certain guests (e.g. OS/2 and QNX) require this feature.</p>"
    1927                                  "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"),
    1928                               0 /* auto-confirm id */,
    1929                               tr("Close VM"), tr("Continue"));
     1621    {
     1622        enmType = MessageType_Warning;
     1623        severity = tr("<nobr>Warning</nobr>", "runtime error info");
     1624        autoConfimId += "warning.";
     1625    }
     1626    /* Advance auto-confirm id: */
     1627    autoConfimId += strErrorId.toUtf8();
     1628
     1629    /* Format error-details: */
     1630    QString formatted("<!--EOM-->");
     1631    if (!strErrorMsg.isEmpty())
     1632        formatted.prepend(QString("<p>%1.</p>").arg(UITranslator::emphasize(strErrorMsg)));
     1633    if (!strErrorId.isEmpty())
     1634        formatted += QString("<table bgcolor=%1 border=0 cellspacing=5 "
     1635                             "cellpadding=0 width=100%>"
     1636                             "<tr><td>%2</td><td>%3</td></tr>"
     1637                             "<tr><td>%4</td><td>%5</td></tr>"
     1638                             "</table>")
     1639                             .arg(QApplication::palette().color(QPalette::Active, QPalette::Window).name(QColor::HexRgb))
     1640                             .arg(tr("<nobr>Error ID: </nobr>", "runtime error info"), strErrorId)
     1641                             .arg(tr("Severity: ", "runtime error info"), severity);
     1642    if (!formatted.isEmpty())
     1643        formatted = "<qt>" + formatted + "</qt>";
     1644
     1645    /* Show the error: */
     1646    if (enmType == MessageType_Critical)
     1647    {
     1648        error(0, enmType,
     1649              tr("<p>A fatal error has occurred during virtual machine execution! "
     1650                 "The virtual machine will be powered off. Please copy the following error message "
     1651                 "using the clipboard to help diagnose the problem:</p>"),
     1652              formatted, autoConfimId.data());
     1653    }
     1654    else if (enmType == MessageType_Error)
     1655    {
     1656        error(0, enmType,
     1657              tr("<p>An error has occurred during virtual machine execution! "
     1658                 "The error details are shown below. You may try to correct the error "
     1659                 "and resume the virtual machine execution.</p>"),
     1660              formatted, autoConfimId.data());
     1661    }
    19301662    else
    1931         return questionBinary(0, MessageType_Error,
    1932                               tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
    1933                                  "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"),
    1934                               0 /* auto-confirm id */,
    1935                               tr("Close VM"), tr("Continue"));
    1936 }
    1937 
    1938 bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames) const
    1939 {
    1940     return questionBinary(0, MessageType_Error,
    1941                           tr("<p>Could not start the machine <b>%1</b> because the following "
    1942                              "physical network interfaces were not found:</p><p><b>%2</b></p>"
    1943                              "<p>You can either change the machine's network settings or stop the machine.</p>")
    1944                              .arg(strMachineName, strIfNames),
    1945                           0 /* auto-confirm id */,
    1946                           tr("Change Network Settings"), tr("Close VM"));
    1947 }
    1948 
    1949 void UIMessageCenter::cannotStartMachine(const CConsole &console, const QString &strName) const
    1950 {
    1951     error(0, MessageType_Error,
    1952           tr("Failed to start the virtual machine <b>%1</b>.")
    1953              .arg(strName),
    1954           UIErrorString::formatErrorInfo(console));
    1955 }
    1956 
    1957 void UIMessageCenter::cannotStartMachine(const CProgress &progress, const QString &strName) const
    1958 {
    1959     error(0, MessageType_Error,
    1960           tr("Failed to start the virtual machine <b>%1</b>.")
    1961              .arg(strName),
    1962           UIErrorString::formatErrorInfo(progress));
     1663    {
     1664        /** @todo r=bird: This is a very annoying message as it refers to invisible text
     1665         * below.  User have to expand "Details" to see what actually went wrong.
     1666         * Probably a good idea to check strErrorId and see if we can come up with better
     1667         * messages here, at least for common stuff like DvdOrFloppyImageInaccesssible... */
     1668        error(0, enmType,
     1669              tr("<p>The virtual machine execution ran into a non-fatal problem as described below. "
     1670                 "We suggest that you take appropriate action to prevent the problem from recurring.</p>"),
     1671              formatted, autoConfimId.data());
     1672    }
     1673
     1674    /// @todo Move to Runtime UI!
     1675    /* Postprocessing: */
     1676    if (fFatal)
     1677    {
     1678        /* Power off after a fFatal error: */
     1679        LogRel(("GUI: Powering VM off after a fatal runtime error...\n"));
     1680        console1.PowerDown();
     1681    }
    19631682}
    19641683
     
    20691788}
    20701789
    2071 void UIMessageCenter::cannotAddDiskEncryptionPassword(const CConsole &console)
    2072 {
    2073     error(0, MessageType_Error,
     1790bool UIMessageCenter::confirmHardDisklessMachine(QWidget *pParent /* = 0*/) const
     1791{
     1792    return questionBinary(pParent, MessageType_Warning,
     1793                          tr("You are about to create a new virtual machine without a hard disk. "
     1794                             "You will not be able to install an operating system on the machine "
     1795                             "until you add one. In the mean time you will only be able to start the "
     1796                             "machine using a virtual optical disk or from the network."),
     1797                          0 /* auto-confirm id */,
     1798                          tr("Continue", "no hard disk attached"),
     1799                          tr("Go Back", "no hard disk attached"));
     1800}
     1801
     1802void UIMessageCenter::cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent /* = 0*/) const
     1803{
     1804    error(pParent, MessageType_Error,
     1805          tr("Failed to create a new virtual machine."),
     1806          UIErrorString::formatErrorInfo(vbox));
     1807}
     1808
     1809void UIMessageCenter::cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent /* = 0*/) const
     1810{
     1811    error(pParent, MessageType_Error,
     1812          tr("Failed to register the virtual machine <b>%1</b>.")
     1813             .arg(strMachineName),
     1814          UIErrorString::formatErrorInfo(vbox));
     1815}
     1816
     1817void UIMessageCenter::cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent /* = 0*/) const
     1818{
     1819    alert(pParent, MessageType_Info,
     1820          tr("<p>The hard disk storage unit at location <b>%1</b> already exists. "
     1821             "You cannot create a new virtual hard disk that uses this location "
     1822             "because it can be already used by another virtual hard disk.</p>"
     1823             "<p>Please specify a different location.</p>")
     1824             .arg(strLocation));
     1825}
     1826
     1827void UIMessageCenter::cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation, QWidget *pParent /* = 0*/) const
     1828{
     1829    error(pParent, MessageType_Error,
     1830          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
     1831             .arg(strLocation),
     1832          UIErrorString::formatErrorInfo(vbox));
     1833}
     1834
     1835void UIMessageCenter::cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /* = 0*/) const
     1836{
     1837    error(pParent, MessageType_Error,
     1838          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
     1839             .arg(strLocation),
     1840          UIErrorString::formatErrorInfo(medium));
     1841}
     1842
     1843void UIMessageCenter::cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /* = 0*/) const
     1844{
     1845    error(pParent, MessageType_Error,
     1846          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
     1847             .arg(strLocation),
     1848          UIErrorString::formatErrorInfo(progress));
     1849}
     1850
     1851void UIMessageCenter::cannotCreateHardDiskStorageInFAT(const QString &strLocation, QWidget *pParent /* = 0 */) const
     1852{
     1853    alert(pParent, MessageType_Info,
     1854          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr> FAT file systems have 4GB file size limit.")
     1855          .arg(strLocation));
     1856}
     1857
     1858void UIMessageCenter::cannotCreateMediumStorage(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent /* = 0 */) const
     1859{
     1860    error(pParent, MessageType_Error,
     1861          tr("Failed to create the virtual disk image storage <nobr><b>%1</b>.</nobr>")
     1862             .arg(strLocation),
     1863          UIErrorString::formatErrorInfo(comVBox));
     1864}
     1865
     1866void UIMessageCenter::cannotCreateMediumStorage(const CMedium &comMedium, const QString &strLocation, QWidget *pParent /* = 0 */) const
     1867{
     1868    error(pParent, MessageType_Error,
     1869          tr("Failed to create the virtual disk image storage <nobr><b>%1</b>.</nobr>")
     1870             .arg(strLocation),
     1871          UIErrorString::formatErrorInfo(comMedium));
     1872}
     1873
     1874void UIMessageCenter::cannotCreateMediumStorage(const CProgress &comProgress, const QString &strLocation, QWidget *pParent /* = 0 */) const
     1875{
     1876    error(pParent, MessageType_Error,
     1877          tr("Failed to create the virtual disk image storage <nobr><b>%1</b>.</nobr>")
     1878             .arg(strLocation),
     1879          UIErrorString::formatErrorInfo(comProgress));
     1880}
     1881
     1882void UIMessageCenter::cannotRemoveMachineFolder(const QString &strFolderName, QWidget *pParent /* = 0*/) const
     1883{
     1884    alert(pParent, MessageType_Critical,
     1885          tr("<p>Cannot remove the machine folder <nobr><b>%1</b>.</nobr></p>"
     1886             "<p>Please check that this folder really exists and that you have permissions to remove it.</p>")
     1887             .arg(QFileInfo(strFolderName).fileName()));
     1888}
     1889
     1890void UIMessageCenter::cannotRewriteMachineFolder(const QString &strFolderName, QWidget *pParent /* = 0*/) const
     1891{
     1892    QFileInfo fi(strFolderName);
     1893    alert(pParent, MessageType_Critical,
     1894          tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
     1895             "<p>This folder already exists and possibly belongs to another machine.</p>")
     1896             .arg(fi.fileName()).arg(fi.absolutePath()));
     1897}
     1898
     1899void UIMessageCenter::cannotCreateMachineFolder(const QString &strFolderName, QWidget *pParent /* = 0*/) const
     1900{
     1901    QFileInfo fi(strFolderName);
     1902    alert(pParent, MessageType_Critical,
     1903          tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
     1904             "<p>Please check that the parent really exists and that you have permissions to create the machine folder.</p>")
     1905             .arg(fi.fileName()).arg(fi.absolutePath()));
     1906}
     1907
     1908void UIMessageCenter::cannotCreateAppliance(const CVirtualBox &comVBox, QWidget *pParent /* = 0 */) const
     1909{
     1910    error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual appliance.</p>"),
     1911          UIErrorString::formatErrorInfo(comVBox));
     1912}
     1913
     1914void UIMessageCenter::cannotCreateVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
     1915{
     1916    error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual system description.</p>"),
     1917          UIErrorString::formatErrorInfo(comAppliance));
     1918}
     1919
     1920void UIMessageCenter::cannotAcquireVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
     1921{
     1922    error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual system description.</p>"),
     1923          UIErrorString::formatErrorInfo(comAppliance));
     1924}
     1925
     1926void UIMessageCenter::cannotAddVirtualSystemDescriptionValue(const CVirtualSystemDescription &comDescription,
     1927                                                             QWidget *pParent /* = 0 */) const
     1928{
     1929    error(pParent, MessageType_Critical, tr("<p>Cannot add a virtual system description value.</p>"),
     1930          UIErrorString::formatErrorInfo(comDescription));
     1931}
     1932
     1933void UIMessageCenter::cannotAcquireVirtualSystemDescriptionFormProperty(const CVirtualSystemDescriptionForm &comForm,
     1934                                                                        QWidget *pParent /* = 0 */) const
     1935{
     1936    error(pParent, MessageType_Critical, tr("<p>Cannot acquire a virtual system description property.</p>"),
     1937          UIErrorString::formatErrorInfo(comForm));
     1938}
     1939
     1940void UIMessageCenter::cannotImportAppliance(CAppliance &appliance, QWidget *pParent /* = 0*/) const
     1941{
     1942    /* Preserve error-info: */
     1943    QString strErrorInfo = UIErrorString::formatErrorInfo(appliance);
     1944    /* Add the warnings in the case of an early error: */
     1945    QString strWarningInfo;
     1946    foreach(const QString &strWarning, appliance.GetWarnings())
     1947        strWarningInfo += QString("<br />Warning: %1").arg(strWarning);
     1948    if (!strWarningInfo.isEmpty())
     1949        strWarningInfo = "<br />" + strWarningInfo;
     1950    /* Show the error: */
     1951    error(pParent, MessageType_Error,
     1952          tr("Failed to open/interpret appliance <b>%1</b>.")
     1953             .arg(appliance.GetPath()),
     1954          strWarningInfo + strErrorInfo);
     1955}
     1956
     1957void UIMessageCenter::cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /* = 0*/) const
     1958{
     1959    error(pParent, MessageType_Error,
     1960          tr("Failed to import appliance <b>%1</b>.")
     1961             .arg(strPath),
     1962          UIErrorString::formatErrorInfo(progress));
     1963}
     1964
     1965bool UIMessageCenter::cannotCheckFiles(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
     1966{
     1967    error(pParent, MessageType_Error,
     1968          tr("Failed to check files."),
     1969          UIErrorString::formatErrorInfo(comAppliance));
     1970    return false;
     1971}
     1972
     1973bool UIMessageCenter::cannotCheckFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent /* = 0 */) const
     1974{
     1975    error(pParent, MessageType_Error,
     1976          tr("Failed to check files."),
     1977          UIErrorString::formatErrorInfo(comVFSExplorer));
     1978    return false;
     1979}
     1980
     1981bool UIMessageCenter::cannotCheckFiles(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
     1982{
     1983    error(pParent, MessageType_Error,
     1984          tr("Failed to check files."),
     1985          UIErrorString::formatErrorInfo(comProgress));
     1986    return false;
     1987}
     1988
     1989bool UIMessageCenter::cannotRemoveFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent /* = 0 */) const
     1990{
     1991    error(pParent, MessageType_Error,
     1992          tr("Failed to remove file."),
     1993          UIErrorString::formatErrorInfo(comVFSExplorer));
     1994    return false;
     1995}
     1996
     1997bool UIMessageCenter::cannotRemoveFiles(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
     1998{
     1999    error(pParent, MessageType_Error,
     2000          tr("Failed to remove file."),
     2001          UIErrorString::formatErrorInfo(comProgress));
     2002    return false;
     2003}
     2004
     2005bool UIMessageCenter::confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent /* = 0*/) const
     2006{
     2007    return questionBinary(pParent, MessageType_Warning,
     2008                          tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>"
     2009                             "<p>If you continue the runtime state of the exported machine(s) will be discarded. "
     2010                             "The other machine(s) will not be changed.</p>",
     2011                             "This text is never used with n == 0. Feel free to drop the %n where possible, "
     2012                             "we only included it because of problems with Qt Linguist (but the user can see "
     2013                             "how many machines are in the list and doesn't need to be told).", machineNames.size())
     2014                             .arg(machineNames.join(", ")),
     2015                          0 /* auto-confirm id */,
     2016                          tr("Continue"));
     2017}
     2018
     2019bool UIMessageCenter::cannotExportAppliance(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
     2020{
     2021    error(pParent, MessageType_Error,
     2022          tr("Failed to prepare the export of the appliance <b>%1</b>.")
     2023             .arg(CAppliance(comAppliance).GetPath()),
     2024          UIErrorString::formatErrorInfo(comAppliance));
     2025    return false;
     2026}
     2027
     2028void UIMessageCenter::cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent /* = 0 */) const
     2029{
     2030    error(pParent, MessageType_Error,
     2031          tr("Failed to prepare the export of the appliance <b>%1</b>.")
     2032             .arg(strPath),
     2033          UIErrorString::formatErrorInfo(machine));
     2034}
     2035
     2036bool UIMessageCenter::cannotExportAppliance(const CProgress &comProgress, const QString &strPath, QWidget *pParent /* = 0 */) const
     2037{
     2038    error(pParent, MessageType_Error,
     2039          tr("Failed to export appliance <b>%1</b>.")
     2040             .arg(strPath),
     2041          UIErrorString::formatErrorInfo(comProgress));
     2042    return false;
     2043}
     2044
     2045bool UIMessageCenter::cannotAddDiskEncryptionPassword(const CAppliance &comAppliance, QWidget *pParent /* = 0 */)
     2046{
     2047    error(pParent, MessageType_Error,
    20742048          tr("Bad password or authentication failure."),
    2075           UIErrorString::formatErrorInfo(console));
    2076 }
    2077 
    2078 void UIMessageCenter::cannotAcquireDispayParameter(const CDisplay &comDisplay)
    2079 {
    2080     error(0, MessageType_Error,
    2081           tr("Failed to acquire display parameter."),
    2082           UIErrorString::formatErrorInfo(comDisplay));
     2049          UIErrorString::formatErrorInfo(comAppliance));
     2050    return false;
     2051}
     2052
     2053void UIMessageCenter::cannotRunUnattendedGuestInstall(const CUnattended &comUnattendedInstall, QWidget *pParent /* = 0 */)
     2054{
     2055    COMErrorInfo comErrorInfo =  comUnattendedInstall.errorInfo();    \
     2056    error(pParent, MessageType_Error,
     2057          tr("An error has occured during unattended guest install setup."),
     2058          UIErrorString::formatErrorInfo(comErrorInfo));
    20832059}
    20842060
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r91165 r91169  
    287287        void cannotApplyCloudMachineFormSettings(const CForm &comForm, const QString &strName, QWidget *pParent = 0) const;
    288288        void cannotApplyCloudMachineFormSettings(const CProgress &comProgress, const QString &strName, QWidget *pParent = 0) const;
     289
     290        void cannotAddDiskEncryptionPassword(const CConsole &console);
    289291    /** @} */
    290292
     
    357359    /** @} */
    358360
     361    /** @name VirtualBox Manager / Cloud Console Manager warnings.
     362      * @{ */
     363        bool confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent = 0) const;
     364        bool confirmCloudConsoleProfileRemoval(const QString &strName, QWidget *pParent = 0) const;
     365    /** @} */
     366
    359367    /** @name VirtualBox Manager / New VM wizard warnings.
    360368      * @{ */
     
    395403        bool cannotRestoreSnapshot(const CMachine &machine, const QString &strSnapshotName, const QString &strMachineName) const;
    396404        bool cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const;
    397     /** @} */
    398 
    399     /* API: Cloud Console Manager warnings: */
    400     bool confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent = 0) const;
    401     bool confirmCloudConsoleProfileRemoval(const QString &strName, QWidget *pParent = 0) const;
     405        void cannotStartMachine(const CConsole &console, const QString &strName) const;
     406        void cannotStartMachine(const CProgress &progress, const QString &strName) const;
     407
     408        bool warnAboutNetworkInterfaceNotFound(const QString &strMachineName, const QString &strIfNames) const;
     409        bool warnAboutVirtExInactiveFor64BitsGuest(bool fHWVirtExSupported) const;
     410        bool warnAboutVirtExInactiveForRecommendedGuest(bool fHWVirtExSupported) const;
     411
     412        void warnAboutVBoxSVCUnavailable() const;
     413        bool warnAboutGuruMeditation(const QString &strLogFolder);
     414        void showRuntimeError(const CConsole &console, bool fFatal, const QString &strErrorId, const QString &strErrorMsg) const;
     415
     416        bool confirmInputCapture(bool &fAutoConfirmed) const;
     417        bool confirmGoingFullscreen(const QString &strHotKey) const;
     418        bool confirmGoingSeamless(const QString &strHotKey) const;
     419        bool confirmGoingScale(const QString &strHotKey) const;
     420
     421        bool cannotEnterFullscreenMode(ULONG uWidth, ULONG uHeight, ULONG uBpp, ULONG64 uMinVRAM) const;
     422        void cannotEnterSeamlessMode(ULONG uWidth, ULONG uHeight, ULONG uBpp, ULONG64 uMinVRAM) const;
     423        bool cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const;
     424        void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const;
     425    /** @} */
    402426
    403427    /* API: Wizards warnings: */
     
    405429    void cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent = 0) const;
    406430    void cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent = 0) const;
    407     void cannotCreateClone(const CMachine &machine, QWidget *pParent = 0) const;
    408     void cannotCreateClone(const CProgress &progress, const QString &strMachineName, QWidget *pParent = 0) const;
    409431    void cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent = 0) const;
    410432    void cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation,QWidget *pParent = 0) const;
     
    437459    void cannotRunUnattendedGuestInstall(const CUnattended &comUnattendedInstall, QWidget *pParent = 0);
    438460
    439     /* API: Runtime UI warnings: */
    440     void showRuntimeError(const CConsole &console, bool fFatal, const QString &strErrorId, const QString &strErrorMsg) const;
    441     bool remindAboutGuruMeditation(const QString &strLogFolder);
    442     void warnAboutVBoxSVCUnavailable() const;
    443     bool warnAboutVirtExInactiveFor64BitsGuest(bool fHWVirtExSupported) const;
    444     bool warnAboutVirtExInactiveForRecommendedGuest(bool fHWVirtExSupported) const;
    445     bool cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames) const;
    446     void cannotStartMachine(const CConsole &console, const QString &strName) const;
    447     void cannotStartMachine(const CProgress &progress, const QString &strName) const;
    448     bool confirmInputCapture(bool &fAutoConfirmed) const;
    449     bool confirmGoingFullscreen(const QString &strHotKey) const;
    450     bool confirmGoingSeamless(const QString &strHotKey) const;
    451     bool confirmGoingScale(const QString &strHotKey) const;
    452     bool cannotEnterFullscreenMode(ULONG uWidth, ULONG uHeight, ULONG uBpp, ULONG64 uMinVRAM) const;
    453     void cannotEnterSeamlessMode(ULONG uWidth, ULONG uHeight, ULONG uBpp, ULONG64 uMinVRAM) const;
    454     bool cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const;
    455     void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const;
    456     void cannotAddDiskEncryptionPassword(const CConsole &console);
    457     void cannotAcquireDispayParameter(const CDisplay &comDisplay);
    458 
    459461#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    460462    /* API: Network management warnings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r91165 r91169  
    4040#include "CConsole.h"
    4141#include "CDHCPServer.h"
     42#include "CDisplay.h"
    4243#include "CGraphicsAdapter.h"
    4344#include "CHostNetworkInterface.h"
     
    519520        QApplication::translate("UIMessageCenter", "Failed to acquire NAT network parameter.") +
    520521        UIErrorString::formatErrorInfo(comNetwork));
     522}
     523
     524void UINotificationMessage::cannotAcquireDispayParameter(const CDisplay &comDisplay)
     525{
     526    createMessage(
     527        QApplication::translate("UIMessageCenter", "Display failure ..."),
     528        QApplication::translate("UIMessageCenter", "Failed to acquire display parameter.") +
     529        UIErrorString::formatErrorInfo(comDisplay));
    521530}
    522531
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r91165 r91169  
    212212          * @param  comNetwork  Brings the object parameter get acquired from. */
    213213        static void cannotAcquireNATNetworkParameter(const CNATNetwork &comNetwork);
     214        /** Notifies about inability to acquire INATNetwork parameter.
     215          * @param  comNetwork  Brings the object parameter get acquired from. */
     216        static void cannotAcquireDispayParameter(const CDisplay &comDisplay);
    214217
    215218        /** Notifies about inability to change IMedium parameter.
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r91132 r91169  
    465465                case GuruMeditationHandlerType_Default:
    466466                {
    467                     if (msgCenter().remindAboutGuruMeditation(QDir::toNativeSeparators(strLogFolder)))
     467                    if (msgCenter().warnAboutGuruMeditation(QDir::toNativeSeparators(strLogFolder)))
    468468                    {
    469469                        LogRel(("GUI: User requested to power VM off on Guru Meditation.\n"));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r90798 r91169  
    3737#include "UIMachineViewSeamless.h"
    3838#include "UIMachineViewScale.h"
     39#include "UINotificationCenter.h"
    3940#include "UIKeyboardHandler.h"
    4041#include "UIMouseHandler.h"
     
    378379    if (!display().isOk())
    379380    {
    380         msgCenter().cannotAcquireDispayParameter(display());
     381        UINotificationMessage::cannotAcquireDispayParameter(display());
    381382        return;
    382383    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r91125 r91169  
    18141814    if (!failedInterfaceNames.isEmpty())
    18151815    {
    1816         if (msgCenter().cannotStartWithoutNetworkIf(machineName(), failedInterfaceNames.join(", ")))
     1816        if (msgCenter().warnAboutNetworkInterfaceNotFound(machineName(), failedInterfaceNames.join(", ")))
    18171817            machineLogic()->openNetworkSettingsDialog();
    18181818        else
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