Changeset 105121 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 3, 2024 5:03:52 PM (7 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r105120 r105121 1160 1160 } 1161 1161 1162 #ifdef RT_OS_LINUX1163 /* static */1164 void UICommon::checkForWrongUSBMounted()1165 {1166 /* Make sure '/proc/mounts' exists and can be opened: */1167 QFile file("/proc/mounts");1168 if (!file.exists() || !file.open(QIODevice::ReadOnly | QIODevice::Text))1169 return;1170 1171 /* Fetch contents: */1172 QStringList contents;1173 for (;;)1174 {1175 QByteArray line = file.readLine();1176 if (line.isEmpty())1177 break;1178 contents << line;1179 }1180 /* Grep contents for usbfs presence: */1181 QStringList grep1(contents.filter("/sys/bus/usb/drivers"));1182 QStringList grep2(grep1.filter("usbfs"));1183 if (grep2.isEmpty())1184 return;1185 1186 /* Show corresponding warning: */1187 msgCenter().warnAboutWrongUSBMounted();1188 }1189 #endif /* RT_OS_LINUX */1190 1191 1162 /* static */ 1192 1163 QString UICommon::usbDetails(const CUSBDevice &comDevice) … … 1546 1517 } 1547 1518 1548 void UICommon::sltGUILanguageChange(QString strLanguage)1549 {1550 /* Make sure medium-enumeration is not in progress! */1551 AssertReturnVoid(!gpMediumEnumerator->isMediumEnumerationInProgress());1552 /* Load passed language: */1553 UITranslator::loadLanguage(strLanguage);1554 }1555 1556 1519 void UICommon::sltHandleCloudMachineAdded(const QString &strProviderShortName, 1557 1520 const QString &strProfileName, … … 1605 1568 /* Call to base-class: */ 1606 1569 return QObject::eventFilter(pObject, pEvent); 1570 } 1571 1572 void UICommon::sltGUILanguageChange(QString strLanguage) 1573 { 1574 /* Make sure medium-enumeration is not in progress! */ 1575 AssertReturnVoid(!gpMediumEnumerator->isMediumEnumerationInProgress()); 1576 /* Load passed language: */ 1577 UITranslator::loadLanguage(strLanguage); 1607 1578 } 1608 1579 … … 1806 1777 } 1807 1778 1779 #ifdef RT_OS_LINUX 1780 /* static */ 1781 void UICommon::checkForWrongUSBMounted() 1782 { 1783 /* Make sure '/proc/mounts' exists and can be opened: */ 1784 QFile file("/proc/mounts"); 1785 if (!file.exists() || !file.open(QIODevice::ReadOnly | QIODevice::Text)) 1786 return; 1787 1788 /* Fetch contents: */ 1789 QStringList contents; 1790 for (;;) 1791 { 1792 QByteArray line = file.readLine(); 1793 if (line.isEmpty()) 1794 break; 1795 contents << line; 1796 } 1797 /* Grep contents for usbfs presence: */ 1798 QStringList grep1(contents.filter("/sys/bus/usb/drivers")); 1799 QStringList grep2(grep1.filter("usbfs")); 1800 if (grep2.isEmpty()) 1801 return; 1802 1803 /* Show corresponding warning: */ 1804 msgCenter().warnAboutWrongUSBMounted(); 1805 } 1806 #endif /* RT_OS_LINUX */ 1807 1808 1808 #endif /* VBOX_WITH_DEBUGGER_GUI */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r105120 r105121 59 59 signals: 60 60 61 /** @name Commonstuff.61 /** @name General stuff. 62 62 * @{ */ 63 63 /** Asks #UIStarter listener to restart UI. */ … … 72 72 /** @} */ 73 73 74 /** @name Themestuff.74 /** @name Host OS stuff. 75 75 * @{ */ 76 76 /** Notifies listeners about theme change. */ … … 230 230 /** Returns whether VM should start paused. */ 231 231 bool shouldStartPaused() const; 232 232 /** @} */ 233 234 /** @name Application stuff. 235 * @{ */ 233 236 #ifdef VBOX_GUI_WITH_PIDFILE 234 237 /** Creates PID file. */ … … 239 242 /** @} */ 240 243 241 /** @name C OM: Cloud Virtual Machine stuff.244 /** @name Cloud Virtual Machine stuff. 242 245 * @{ */ 243 246 /** Notifies listeners about cloud VM was unregistered. … … 259 262 /** @name COM: USB stuff. 260 263 * @{ */ 261 #ifdef RT_OS_LINUX262 /** Verifies that USB drivers are properly configured on Linux. */263 static void checkForWrongUSBMounted();264 #endif265 266 264 /** Generates details for passed USB @a comDevice. */ 267 265 static QString usbDetails(const CUSBDevice &comDevice); … … 323 321 /** @} */ 324 322 325 /** @name Localization stuff. 326 * @{ */ 327 /** Handles language change to new @a strLanguage. */ 328 void sltGUILanguageChange(QString strLanguage); 329 /** @} */ 330 331 /** @name Cloud Machine related stuff. 323 /** @name Cloud Virtual Machine stuff. 332 324 * @{ */ 333 325 /** Handles signal about cloud machine was added. */ … … 364 356 /** @} */ 365 357 366 /* Handle font scale factor change. */ 367 void sltHandleFontScaleFactorChanged(int iFontScaleFactor); 358 /** @name Localization stuff. 359 * @{ */ 360 /** Handles language change to new @a strLanguage. */ 361 void sltGUILanguageChange(QString strLanguage); 362 363 /** Handles font @a iFontScaleFactor change. */ 364 void sltHandleFontScaleFactorChanged(int iFontScaleFactor); 365 /** @} */ 368 366 369 367 private: … … 399 397 /** @} */ 400 398 399 /** @name USB stuff. 400 * @{ */ 401 #ifdef RT_OS_LINUX 402 /** Verifies that USB drivers are properly configured on Linux. */ 403 static void checkForWrongUSBMounted(); 404 #endif 405 /** @} */ 406 401 407 /** Holds the singleton UICommon instance. */ 402 408 static UICommon *s_pInstance; … … 495 501 /** Holds the --settingspwfile option value. */ 496 502 bool m_fSettingsPwSet; 497 503 /** @} */ 504 505 /** @name Application stuff. 506 * @{ */ 498 507 #ifdef VBOX_GUI_WITH_PIDFILE 499 508 /** Holds the --pidfile option value (application PID file path). */ 500 QString m_strPidFile;509 QString m_strPidFile; 501 510 #endif 502 511 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.