Changeset 45267 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 1, 2013 10:06:23 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45266 r45267 327 327 } 328 328 329 #ifdef RT_OS_LINUX 330 void UIMessageCenter::warnAboutWrongUSBMounted() 331 { 332 message(mainWindowShown(), MessageType_Warning, 333 tr("You seem to have the USBFS filesystem mounted at /sys/bus/usb/drivers. " 334 "We strongly recommend that you change this, as it is a severe mis-configuration of " 335 "your system which could cause USB devices to fail in unexpected ways."), 336 "checkForMountedWrongUSB"); 337 } 338 #endif /* RT_OS_LINUX */ 339 340 void UIMessageCenter::cannotRunInSelectorMode() 341 { 342 message(mainWindowShown(), MessageType_Critical, 343 tr("<p>Cannot run VirtualBox in <i>VM Selector</i> " 344 "mode due to local restrictions.</p>" 345 "<p>The application will now terminate.</p>")); 346 } 347 329 348 void UIMessageCenter::showBETAWarning() 330 349 { … … 342 361 "This version is not suitable for production use.")); 343 362 } 344 345 void UIMessageCenter::cannotRunInSelectorMode()346 {347 message(mainWindowShown(), MessageType_Critical,348 tr("<p>Cannot run VirtualBox in <i>VM Selector</i> "349 "mode due to local restrictions.</p>"350 "<p>The application will now terminate.</p>"));351 }352 353 #ifdef RT_OS_LINUX354 void UIMessageCenter::checkForMountedWrongUSB()355 {356 QFile file("/proc/mounts");357 if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text))358 {359 QStringList contents;360 for (;;)361 {362 QByteArray line = file.readLine();363 if (line.isEmpty())364 break;365 contents << line;366 }367 QStringList grep1(contents.filter("/sys/bus/usb/drivers"));368 QStringList grep2(grep1.filter("usbfs"));369 if (!grep2.isEmpty())370 message(mainWindowShown(), MessageType_Warning,371 tr("You seem to have the USBFS filesystem mounted at /sys/bus/usb/drivers. "372 "We strongly recommend that you change this, as it is a severe mis-configuration of "373 "your system which could cause USB devices to fail in unexpected ways."),374 "checkForMountedWrongUSB");375 }376 }377 #endif /* RT_OS_LINUX */378 363 379 364 void UIMessageCenter::cannotInitCOM(HRESULT rc) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45266 r45267 190 190 bool askForOverridingFilesIfExists(const QVector<QString>& strPaths, QWidget *pParent = NULL); 191 191 192 /* API: Beta warnings: */ 192 /* API: Main (startup) warnings: */ 193 #ifdef RT_OS_LINUX 194 void warnAboutWrongUSBMounted(); 195 #endif /* RT_OS_LINUX */ 196 void cannotRunInSelectorMode(); 193 197 void showBETAWarning(); 194 198 void showBEBWarning(); 195 196 /* API: Common startup warnings: */197 void cannotRunInSelectorMode();198 #ifdef RT_OS_LINUX199 void checkForMountedWrongUSB();200 #endif /* RT_OS_LINUX */201 199 202 200 /* API: COM startup warnings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r45193 r45267 3946 3946 return !isApprovedByExtraData(machine, GUI_HideDetails); 3947 3947 } 3948 3949 #ifdef RT_OS_LINUX 3950 /* static */ 3951 void VBoxGlobal::checkForWrongUSBMounted() 3952 { 3953 /* Make sure '/proc/mounts' exists and can be opened: */ 3954 QFile file("/proc/mounts"); 3955 if (!file.exists() || !file.open(QIODevice::ReadOnly | QIODevice::Text)) 3956 return; 3957 3958 /* Fetch contents: */ 3959 QStringList contents; 3960 for (;;) 3961 { 3962 QByteArray line = file.readLine(); 3963 if (line.isEmpty()) 3964 break; 3965 contents << line; 3966 } 3967 /* Grep contents for usbfs presence: */ 3968 QStringList grep1(contents.filter("/sys/bus/usb/drivers")); 3969 QStringList grep2(grep1.filter("usbfs")); 3970 if (grep2.isEmpty()) 3971 return; 3972 3973 /* Show corresponding warning: */ 3974 msgCenter().warnAboutWrongUSBMounted(); 3975 } 3976 #endif /* RT_OS_LINUX */ 3948 3977 3949 3978 // Public slots -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r45192 r45267 396 396 static bool shouldWeShowDetails(CMachine &machine, 397 397 bool fIncludingMachineGeneralCheck = false); 398 399 #ifdef RT_OS_LINUX 400 static void checkForWrongUSBMounted(); 401 #endif /* RT_OS_LINUX */ 398 402 399 403 signals: -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r45233 r45267 473 473 474 474 #ifdef RT_OS_LINUX 475 msgCenter().checkForMountedWrongUSB(); 475 /* Make sure no wrong USB mounted: */ 476 VBoxGlobal::checkForWrongUSBMounted(); 476 477 #endif /* RT_OS_LINUX */ 477 478
Note:
See TracChangeset
for help on using the changeset viewer.