VirtualBox

Changeset 105121 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 3, 2024 5:03:52 PM (7 months ago)
Author:
vboxsync
Message:

FE/Qt: A bit of cleanup for the remaining stuff in UICommon; More to go.

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  
    11601160}
    11611161
    1162 #ifdef RT_OS_LINUX
    1163 /* 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 
    11911162/* static */
    11921163QString UICommon::usbDetails(const CUSBDevice &comDevice)
     
    15461517}
    15471518
    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 
    15561519void UICommon::sltHandleCloudMachineAdded(const QString &strProviderShortName,
    15571520                                          const QString &strProfileName,
     
    16051568    /* Call to base-class: */
    16061569    return QObject::eventFilter(pObject, pEvent);
     1570}
     1571
     1572void 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);
    16071578}
    16081579
     
    18061777}
    18071778
     1779#ifdef RT_OS_LINUX
     1780/* static */
     1781void 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
    18081808#endif /* VBOX_WITH_DEBUGGER_GUI */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r105120 r105121  
    5959signals:
    6060
    61     /** @name Common stuff.
     61    /** @name General stuff.
    6262     * @{ */
    6363        /** Asks #UIStarter listener to restart UI. */
     
    7272    /** @} */
    7373
    74     /** @name Theme stuff.
     74    /** @name Host OS stuff.
    7575     * @{ */
    7676        /** Notifies listeners about theme change. */
     
    230230        /** Returns whether VM should start paused. */
    231231        bool shouldStartPaused() const;
    232 
     232    /** @} */
     233
     234    /** @name Application stuff.
     235     * @{ */
    233236#ifdef VBOX_GUI_WITH_PIDFILE
    234237        /** Creates PID file. */
     
    239242    /** @} */
    240243
    241     /** @name COM: Cloud Virtual Machine stuff.
     244    /** @name Cloud Virtual Machine stuff.
    242245     * @{ */
    243246        /** Notifies listeners about cloud VM was unregistered.
     
    259262    /** @name COM: USB stuff.
    260263     * @{ */
    261 #ifdef RT_OS_LINUX
    262         /** Verifies that USB drivers are properly configured on Linux. */
    263         static void checkForWrongUSBMounted();
    264 #endif
    265 
    266264        /** Generates details for passed USB @a comDevice. */
    267265        static QString usbDetails(const CUSBDevice &comDevice);
     
    323321    /** @} */
    324322
    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.
    332324     * @{ */
    333325        /** Handles signal about cloud machine was added. */
     
    364356    /** @} */
    365357
    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    /** @} */
    368366
    369367private:
     
    399397    /** @} */
    400398
     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
    401407    /** Holds the singleton UICommon instance. */
    402408    static UICommon *s_pInstance;
     
    495501        /** Holds the --settingspwfile option value. */
    496502        bool  m_fSettingsPwSet;
    497 
     503    /** @} */
     504
     505    /** @name Application stuff.
     506     * @{ */
    498507#ifdef VBOX_GUI_WITH_PIDFILE
    499508        /** Holds the --pidfile option value (application PID file path). */
    500         QString m_strPidFile;
     509        QString  m_strPidFile;
    501510#endif
    502511    /** @} */
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