VirtualBox

Changeset 51322 in vbox for trunk


Ignore:
Timestamp:
May 21, 2014 1:08:47 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 7382: More common USB controller presence check, verifying controller presence of any-type (not just OHCI).

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
6 edited

Legend:

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

    r51198 r51322  
    15761576            && aMachine.GetUSBProxyAvailable())
    15771577        {
    1578             /* the USB controller may be unavailable (i.e. in VirtualBox OSE) */
    1579 
    1580             ULONG cOhciCtls = aMachine.GetUSBControllerCountByType(KUSBControllerType_OHCI);
    1581 
    1582             if (cOhciCtls)
     1578            /* The USB controller may be unavailable (i.e. in VirtualBox OSE): */
     1579            if (aMachine.GetUSBControllers().isEmpty())
     1580                item = QString(sSectionItemTpl1).arg(tr("Disabled", "details report (USB)"));
     1581            else
    15831582            {
    15841583                CUSBDeviceFilterVector coll = flts.GetDeviceFilters();
     
    15931592                                 .arg (coll.size()).arg (active));
    15941593            }
    1595             else
    1596                 item = QString (sSectionItemTpl1)
    1597                        .arg (tr ("Disabled", "details report (USB)"));
    15981594
    15991595            report += sectionTpl
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r51293 r51322  
    392392        QString strFullData;
    393393
    394 
    395         /*
    396          * Check whether there is at least one OHCI USB controllers with
    397          * an available proxy.
    398          */
    399         const CUSBDeviceFilters &filters = machine.GetUSBDeviceFilters();
    400         ULONG cOhciCtls = machine.GetUSBControllerCountByType(KUSBControllerType_OHCI);
    401         bool fUSBEnabled = !filters.isNull() && cOhciCtls && machine.GetUSBProxyAvailable();
     394        /* Check whether there is at least one USB controller with an available proxy. */
     395        bool fUSBEnabled =    !machine.GetUSBDeviceFilters().isNull()
     396                           && !machine.GetUSBControllers().isEmpty()
     397                           && machine.GetUSBProxyAvailable();
    402398
    403399        setState(fUSBEnabled ? KDeviceActivity_Idle : KDeviceActivity_Null);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r51252 r51322  
    15531553    /* USB stuff: */
    15541554    {
    1555         /* Check whether there is at least one OHCI USB controllers with an available proxy. */
    1556         const CUSBDeviceFilters &filters = machine.GetUSBDeviceFilters();
    1557         ULONG cOhciCtls = machine.GetUSBControllerCountByType(KUSBControllerType_OHCI);
    1558         bool fUSBEnabled = !filters.isNull() && cOhciCtls && machine.GetUSBProxyAvailable();
     1555        /* Check whether there is at least one USB controllers with an available proxy. */
     1556        bool fUSBEnabled =    !machine.GetUSBDeviceFilters().isNull()
     1557                           && !machine.GetUSBControllers().isEmpty()
     1558                          && machine.GetUSBProxyAvailable();
    15591559
    15601560        /* Show/Hide USB menu depending on controller availability, activity and USB-proxy presence: */
     
    15661566        /* Check whether there is an accessible video input devices pool: */
    15671567        const CHostVideoInputDeviceVector &webcams = host.GetVideoInputDevices(); Q_UNUSED(webcams);
    1568         ULONG cOhciCtls = machine.GetUSBControllerCountByType(KUSBControllerType_OHCI);
    1569         bool fWebCamsEnabled = host.isOk() && cOhciCtls;
     1568        bool fWebCamsEnabled = host.isOk() && !machine.GetUSBControllers().isEmpty();
    15701569
    15711570        /* Show/Hide WebCams menu depending on ExtPack availability: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r51054 r51322  
    495495        if (indicatorsPool()->indicator(IndicatorType_USB))
    496496        {
    497             const CUSBDeviceFilters &filters = m.GetUSBDeviceFilters();
    498             ULONG cOhciCtls = m.GetUSBControllerCountByType(KUSBControllerType_OHCI);
    499             bool fUSBEnabled = !filters.isNull() && cOhciCtls && m.GetUSBProxyAvailable();
     497            bool fUSBEnabled =    !m.GetUSBDeviceFilters().isNull()
     498                               && !m.GetUSBControllers().isEmpty()
     499                              && m.GetUSBProxyAvailable();
    500500
    501501            if (!fUSBEnabled)
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp

    r50912 r51322  
    910910            {
    911911                const CUSBDeviceFilters &flts = machine().GetUSBDeviceFilters();
    912                 if (!flts.isNull() && machine().GetUSBControllerCountByType(KUSBControllerType_OHCI))
     912                if (!flts.isNull() && !machine().GetUSBControllers().isEmpty())
    913913                {
    914914                    const CUSBDeviceFilterVector &coll = flts.GetDeviceFilters();
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r51297 r51322  
    821821#endif /* VBOX_WITH_VIDEOHWACCEL */
    822822
    823         /* Enable OHCI controller if HID is enabled: */
    824         if (pSystemPage && pSystemPage->isHIDEnabled())
    825         {
    826             ULONG cOhciCtls = m_machine.GetUSBControllerCountByType(KUSBControllerType_OHCI);
    827             if (!cOhciCtls)
    828                 m_machine.AddUSBController("OHCI", KUSBControllerType_OHCI);
    829         }
     823        /* Enable OHCI controller if HID is enabled but no USB controllers present: */
     824        if (pSystemPage && pSystemPage->isHIDEnabled() && m_machine.GetUSBControllers().isEmpty())
     825            m_machine.AddUSBController("OHCI", KUSBControllerType_OHCI);
    830826
    831827        /* Disable First RUN Wizard: */
     
    11011097            if (   !m_machine.isReallyOk()
    11021098                && controllerColl.size() > 0
    1103                 && m_machine.GetUSBControllerCountByType(KUSBControllerType_OHCI))
     1099                && !m_machine.GetUSBControllers().isEmpty())
    11041100                msgCenter().warnAboutUnaccessibleUSB(m_machine, parentWidget());
    11051101            break;
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