VirtualBox

Ignore:
Timestamp:
Apr 4, 2013 10:53:23 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84742
Message:

FE/Qt: Message-center rework (part 27): And more runtime stuff again.

File:
1 edited

Legend:

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

    r45333 r45334  
    15561556}
    15571557
     1558bool UIMessageCenter::remindAboutGuruMeditation(const QString &strLogFolder)
     1559{
     1560    return messageOkCancel(mainMachineWindowShown(), MessageType_GuruMeditation,
     1561                           tr("<p>A critical error has occurred while running the virtual "
     1562                              "machine and the machine execution has been stopped.</p>"
     1563                              ""
     1564                              "<p>For help, please see the Community section on "
     1565                              "<a href=http://www.virtualbox.org>http://www.virtualbox.org</a> "
     1566                              "or your support contract. Please provide the contents of the "
     1567                              "log file <tt>VBox.log</tt> and the image file <tt>VBox.png</tt>, "
     1568                              "which you can find in the <nobr><b>%1</b></nobr> directory, "
     1569                              "as well as a description of what you were doing when this error happened. "
     1570                              ""
     1571                              "Note that you can also access the above files by selecting <b>Show Log</b> "
     1572                              "from the <b>Machine</b> menu of the main VirtualBox window.</p>"
     1573                              ""
     1574                              "<p>Press <b>OK</b> if you want to power off the machine "
     1575                              "or press <b>Ignore</b> if you want to leave it as is for debugging. "
     1576                              "Please note that debugging requires special knowledge and tools, "
     1577                              "so it is recommended to press <b>OK</b> now.</p>")
     1578                              .arg(strLogFolder),
     1579                           0 /* auto-confirm id */,
     1580                           QIMessageBox::tr("Ok"),
     1581                           QIMessageBox::tr("Ignore"));
     1582}
     1583
    15581584bool UIMessageCenter::warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported) const
    15591585{
     
    18101836}
    18111837
    1812 void UIMessageCenter::cannotAttachUSBDevice(const CConsole &console,
    1813                                             const QString &device)
    1814 {
    1815     /* preserve the current error info before calling the object again */
    1816     COMResult res(console);
    1817 
     1838void UIMessageCenter::cannotAttachUSBDevice(const CConsole &console, const QString &strDevice)
     1839{
     1840    /* Preserve error-info: */
     1841    QString strErrorInfo = formatErrorInfo(console);
     1842    /* Show the message: */
    18181843    message(mainMachineWindowShown(), MessageType_Error,
    1819         tr("Failed to attach the USB device <b>%1</b> "
    1820            "to the virtual machine <b>%2</b>.")
    1821             .arg(device)
    1822             .arg(console.GetMachine().GetName()),
    1823         formatErrorInfo(res));
    1824 }
    1825 
    1826 void UIMessageCenter::cannotAttachUSBDevice(const CConsole &console,
    1827                                             const QString &device,
    1828                                             const CVirtualBoxErrorInfo &error)
     1844            tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
     1845               .arg(strDevice, console.GetMachine().GetName()),
     1846            strErrorInfo);
     1847}
     1848
     1849void UIMessageCenter::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &error, const QString &strDevice, const QString &strMachineName)
    18291850{
    18301851    message(mainMachineWindowShown(), MessageType_Error,
    1831         tr("Failed to attach the USB device <b>%1</b> "
    1832            "to the virtual machine <b>%2</b>.")
    1833             .arg(device)
    1834             .arg(console.GetMachine().GetName()),
    1835         formatErrorInfo(error));
    1836 }
    1837 
    1838 void UIMessageCenter::cannotDetachUSBDevice(const CConsole &console,
    1839                                             const QString &device)
    1840 {
    1841     /* preserve the current error info before calling the object again */
    1842     COMResult res(console);
    1843 
     1852            tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
     1853               .arg(strDevice, strMachineName),
     1854            formatErrorInfo(error));
     1855}
     1856
     1857void UIMessageCenter::cannotDetachUSBDevice(const CConsole &console, const QString &strDevice)
     1858{
     1859    /* Preserve error-info: */
     1860    QString strErrorInfo = formatErrorInfo(console);
     1861    /* Show the message: */
    18441862    message(mainMachineWindowShown(), MessageType_Error,
    1845         tr("Failed to detach the USB device <b>%1</b> "
    1846            "from the virtual machine <b>%2</b>.")
    1847             .arg(device)
    1848             .arg(console.GetMachine().GetName()),
    1849         formatErrorInfo(res));
    1850 }
    1851 
    1852 void UIMessageCenter::cannotDetachUSBDevice(const CConsole &console,
    1853                                             const QString &device,
    1854                                             const CVirtualBoxErrorInfo &error)
     1863            tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
     1864               .arg(strDevice, console.GetMachine().GetName()),
     1865            strErrorInfo);
     1866}
     1867
     1868void UIMessageCenter::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &error, const QString &strDevice, const QString &strMachineName)
    18551869{
    18561870    message(mainMachineWindowShown(), MessageType_Error,
    1857         tr("Failed to detach the USB device <b>%1</b> "
    1858            "from the virtual machine <b>%2</b>.")
    1859             .arg(device)
    1860             .arg(console.GetMachine().GetName()),
    1861         formatErrorInfo(error));
    1862 }
    1863 
    1864 void UIMessageCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent)
    1865 {
    1866     message(pParent, MessageType_Warning,
    1867              tr("<p>The VirtualBox Guest Additions do not appear to be "
    1868                 "available on this virtual machine, and shared folders "
    1869                 "cannot be used without them. To use shared folders inside "
    1870                 "the virtual machine, please install the Guest Additions "
    1871                 "if they are not installed, or re-install them if they are "
    1872                 "not working correctly, by selecting <b>Install Guest Additions</b> "
    1873                 "from the <b>Devices</b> menu. "
    1874                 "If they are installed but the machine is not yet fully started "
    1875                 "then shared folders will be available once it is.</p>"),
    1876              "remindAboutGuestAdditionsAreNotActive");
    1877 }
    1878 
    1879 void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName)
    1880 {
    1881     message(mainMachineWindowShown(), MessageType_Error,
    1882              tr("<p>Could not insert the VirtualBox Guest Additions "
    1883                 "installer CD image into the virtual machine <b>%1</b>, as the machine "
    1884                 "has no CD/DVD-ROM drives. Please add a drive using the "
    1885                 "storage page of the virtual machine settings dialog.</p>")
    1886                  .arg(strMachineName));
    1887 }
    1888 
    1889 bool UIMessageCenter::remindAboutGuruMeditation(const CConsole &console, const QString &strLogFolder)
    1890 {
    1891     Q_UNUSED(console);
    1892 
    1893     int rc = message(mainMachineWindowShown(), MessageType_GuruMeditation,
    1894         tr("<p>A critical error has occurred while running the virtual "
    1895            "machine and the machine execution has been stopped.</p>"
    1896            ""
    1897            "<p>For help, please see the Community section on "
    1898            "<a href=http://www.virtualbox.org>http://www.virtualbox.org</a> "
    1899            "or your support contract. Please provide the contents of the "
    1900            "log file <tt>VBox.log</tt> and the image file <tt>VBox.png</tt>, "
    1901            "which you can find in the <nobr><b>%1</b></nobr> directory, "
    1902            "as well as a description of what you were doing when this error "
    1903            "happened. "
    1904            ""
    1905            "Note that you can also access the above files by selecting "
    1906            "<b>Show Log</b> from the <b>Machine</b> menu of the main "
    1907            "VirtualBox window.</p>"
    1908            ""
    1909            "<p>Press <b>OK</b> if you want to power off the machine "
    1910            "or press <b>Ignore</b> if you want to leave it as is for debugging. "
    1911            "Please note that debugging requires special knowledge and tools, so "
    1912            "it is recommended to press <b>OK</b> now.</p>")
    1913             .arg(strLogFolder),
    1914         0 /* auto-confirm id */,
    1915         AlertButton_Ok | AlertButtonOption_Default,
    1916         AlertButton_Ignore | AlertButtonOption_Escape);
    1917 
    1918     return rc == AlertButton_Ok;
     1871            tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
     1872               .arg(strDevice, strMachineName),
     1873            formatErrorInfo(error));
     1874}
     1875
     1876void UIMessageCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent /*= 0*/)
     1877{
     1878    message(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
     1879            tr("<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, "
     1880               "and shared folders cannot be used without them. To use shared folders inside the virtual machine, "
     1881               "please install the Guest Additions if they are not installed, or re-install them if they are "
     1882               "not working correctly, by selecting <b>Install Guest Additions</b> from the <b>Devices</b> menu. "
     1883               "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"),
     1884            "remindAboutGuestAdditionsAreNotActive");
    19191885}
    19201886
     
    19711937                           0 /* auto-confirm id */,
    19721938                           tr("Mount", "additions"));
     1939}
     1940
     1941void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName)
     1942{
     1943    message(mainMachineWindowShown(), MessageType_Error,
     1944             tr("<p>Could not insert the VirtualBox Guest Additions "
     1945                "installer CD image into the virtual machine <b>%1</b>, as the machine "
     1946                "has no CD/DVD-ROM drives. Please add a drive using the "
     1947                "storage page of the virtual machine settings dialog.</p>")
     1948                 .arg(strMachineName));
    19731949}
    19741950
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