VirtualBox

Ignore:
Timestamp:
Mar 25, 2009 10:00:57 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: better error messages if something goes wrong during the Runtime initialization

File:
1 edited

Legend:

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

    r18222 r18242  
    5858# include <unistd.h>
    5959#endif
     60
     61/* XXX Temporarily. Don't rely on ther user to hack the Makefile himsef! */
     62QString g_QStrHintLinuxNoMemory = QApplication::tr(
     63  "This error means that the kernel driver was either not able to "
     64  "allocate enough memory or that some mapping operation failed.<br/><br/>"
     65  "There are known problems with Linux 2.6.29. If you are running "
     66  "such a kernel, please edit /usr/src/vboxdrv-*/Makefile and enable "
     67  "<i>VBOX_USE_INSERT_PAGE = 1</i>. After that, re-compile the kernel "
     68  "module by executing<br/><br/>"
     69  "  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br/><br/>"
     70  "as root."
     71  );
     72
     73QString g_QStrHintLinuxNoDriver = QApplication::tr(
     74  "The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or "
     75  "there is a permission problem with /dev/vboxdrv. Re-setup the kernel "
     76  "module by executing<br/><br/>"
     77  "  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br/><br/>"
     78  "as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS "
     79  "package first. This package keeps track of Linux kernel changes and "
     80  "recompiles the vboxdrv kernel module if necessary."
     81  );
     82
     83QString g_QStrHintOtherNoDriver = QApplication::tr(
     84  "Make sure the kernel module has been loaded successfully."
     85  );
     86
     87/* I hope this isn't (C), (TM) or (R) Microsoft support ;-) */
     88QString g_QStrHintReinstall = QApplication::tr(
     89  "It may help to reinstall VirtualBox."
     90  );
    6091
    6192#if defined(DEBUG) && defined(Q_WS_X11) && defined(RT_OS_LINUX)
     
    497528            case VERR_VM_DRIVER_NOT_INSTALLED:
    498529                msgText += QApplication::tr (
    499                         "<b>Cannot access the kernel driver!</b><br/><br/>"
     530                        "<b>Cannot access the kernel driver!</b><br/><br/>");
    500531# ifdef RT_OS_LINUX
    501                         "The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or "
    502                         "there is a permission problem with /dev/vboxdrv. Re-setup the kernel "
    503                         "module by executing<br/><br/>"
    504                         "  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br/><br/>"
    505                         "as root. Users of Ubuntu or Fedora should install the DKMS package "
    506                         "at first. This package keeps track of Linux kernel changes and "
    507                         "recompiles the vboxdrv kernel module if necessary."
     532                msgText += g_QStrHintLinuxNoDriver;
    508533# else
    509                         "Make sure the kernel module has been loaded successfully."
    510 # endif
    511                         );
     534                msgText += g_QStrHintOtherNoDriver;
     535# endif
    512536                break;
     537# ifdef RT_OS_LINUX
     538            case VERR_NO_MEMORY:
     539                msgText += g_QStrHintLinuxNoMemory;
     540                break;
     541# endif
    513542            default:
    514543                msgText += QApplication::tr (
     
    565594    {
    566595        case kSupInitOp_Driver:
    567             msgText += QApplication::tr (
    568 #ifdef RT_OS_LINUX
    569             "The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or "
    570             "there is a permission problem with /dev/vboxdrv. Re-setup the kernel "
    571             "module by executing<br/><br/>"
    572             "  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br/><br/>"
    573             "as root. Users of Ubuntu or Fedora should install the DKMS package "
    574             "at first. This package keeps track of Linux kernel changes and "
    575             "recompiles the vboxdrv kernel module if necessary."
    576 #else
    577             "Make sure the kernel module has been loaded successfully."
    578 #endif
    579             );
    580             break;
     596# ifdef RT_OS_LINUX
     597            msgText += g_QStrHintLinuxNoDriver;
     598# else
     599            msgText += g_QStrHintOtherDriver;
     600# endif
     601            break;
     602# ifdef RT_OS_LINUX
    581603        case kSupInitOp_IPRT:
     604            if (rc == VERR_NO_MEMORY)
     605                msgText += g_QStrHintLinuxNoMemory;
     606            else
     607# endif
     608                msgText += g_QStrHintReinstall;
     609            break;
    582610        case kSupInitOp_Integrity:
    583611        case kSupInitOp_RootCheck:
    584             msgText += QApplication::tr ("It may help to reinstall VirtualBox."); /* hope this isn't (C), (TM) or (R) Microsoft support ;-) */
     612            msgText += g_QStrHintReinstall;
    585613            break;
    586614        default:
     
    590618    msgText += "</html>";
    591619
    592 #ifdef RT_OS_LINUX
     620# ifdef RT_OS_LINUX
    593621    sleep(2);
    594 #endif
     622# endif
    595623    QMessageBox::critical (
    596624        0,                      /* parent */
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