VirtualBox

Changeset 51550 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 5, 2014 11:51:31 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94199
Message:

FE/Qt: Runtime UI: Load machine-window customizations and availability settings *before* geometry.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r51549 r51550  
    431431    /* Get machine: */
    432432    CMachine m = machine();
     433
     434    /* Load GUI customizations: */
     435    {
     436        VBoxGlobalSettings settings = vboxGlobal().settings();
     437#ifndef Q_WS_MAC
     438        menuBar()->setHidden(settings.isFeatureActive("noMenuBar"));
     439#endif /* !Q_WS_MAC */
     440        statusBar()->setHidden(settings.isFeatureActive("noStatusBar"));
     441        if (statusBar()->isHidden())
     442            m_pIdleTimer->stop();
     443    }
     444
     445    /* Load availability settings: */
     446    {
     447        /* USB Stuff: */
     448        if (indicatorsPool()->indicator(IndicatorType_USB))
     449        {
     450            bool fUSBEnabled =    !m.GetUSBDeviceFilters().isNull()
     451                               && !m.GetUSBControllers().isEmpty()
     452                               && m.GetUSBProxyAvailable();
     453
     454            if (!fUSBEnabled)
     455            {
     456                /* Hide USB menu: */
     457                indicatorsPool()->indicator(IndicatorType_USB)->setHidden(true);
     458            }
     459            else
     460            {
     461                /* Toggle USB LED: */
     462                indicatorsPool()->indicator(IndicatorType_USB)->setState(KDeviceActivity_Idle);
     463            }
     464        }
     465    }
    433466
    434467    /* Load window geometry: */
     
    484517        normalizeGeometry(true);
    485518#endif /* !Q_WS_X11 */
    486     }
    487 
    488     /* Load availability settings: */
    489     {
    490         /* USB Stuff: */
    491         if (indicatorsPool()->indicator(IndicatorType_USB))
    492         {
    493             bool fUSBEnabled =    !m.GetUSBDeviceFilters().isNull()
    494                                && !m.GetUSBControllers().isEmpty()
    495                                && m.GetUSBProxyAvailable();
    496 
    497             if (!fUSBEnabled)
    498             {
    499                 /* Hide USB menu: */
    500                 indicatorsPool()->indicator(IndicatorType_USB)->setHidden(true);
    501             }
    502             else
    503             {
    504                 /* Toggle USB LED: */
    505                 indicatorsPool()->indicator(IndicatorType_USB)->setState(KDeviceActivity_Idle);
    506             }
    507         }
    508     }
    509 
    510     /* Load global settings: */
    511     {
    512         VBoxGlobalSettings settings = vboxGlobal().settings();
    513 #ifndef Q_WS_MAC
    514         menuBar()->setHidden(settings.isFeatureActive("noMenuBar"));
    515 #endif /* !Q_WS_MAC */
    516         statusBar()->setHidden(settings.isFeatureActive("noStatusBar"));
    517         if (statusBar()->isHidden())
    518             m_pIdleTimer->stop();
    519519    }
    520520}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette