VirtualBox

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


Ignore:
Timestamp:
Sep 27, 2017 10:13:19 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Indicators pool: Video Capture indicator: Make sure rotating animation is paused when the VM is paused.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
2 edited

Legend:

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

    r68663 r68883  
    815815    {
    816816        UIIndicatorStateVideoCapture_Disabled = 0,
    817         UIIndicatorStateVideoCapture_Enabled  = 1
     817        UIIndicatorStateVideoCapture_Enabled  = 1,
     818        UIIndicatorStateVideoCapture_Paused   = 2
    818819    };
    819820
     
    829830        setStateIcon(UIIndicatorStateVideoCapture_Disabled, UIIconPool::iconSet(":/video_capture_16px.png"));
    830831        setStateIcon(UIIndicatorStateVideoCapture_Enabled,  UIIconPool::iconSet(":/movie_reel_16px.png"));
     832        setStateIcon(UIIndicatorStateVideoCapture_Paused,   UIIconPool::iconSet(":/movie_reel_16px.png"));
    831833        /* Create *enabled* state animation: */
    832834        m_pAnimation = UIAnimationLoop::installAnimationLoop(this, "rotationAngle",
     
    851853            case UIIndicatorStateVideoCapture_Enabled:
    852854                m_pAnimation->start();
     855                break;
     856            case UIIndicatorStateVideoCapture_Paused:
     857                m_pAnimation->stop();
    853858                break;
    854859            default:
     
    888893        /* Get machine: */
    889894        const CMachine machine = m_pSession->machine();
     895        const bool fMachinePaused = m_pSession->isPaused();
    890896
    891897        /* Update indicator state early: */
    892         setState(machine.GetVideoCaptureEnabled());
     898        if (!machine.GetVideoCaptureEnabled())
     899            setState(UIIndicatorStateVideoCapture_Disabled);
     900        else if (!fMachinePaused)
     901            setState(UIIndicatorStateVideoCapture_Enabled);
     902        else
     903            setState(UIIndicatorStateVideoCapture_Paused);
    893904
    894905        /* Prepare tool-tip: */
     
    906917            }
    907918            case UIIndicatorStateVideoCapture_Enabled:
     919            case UIIndicatorStateVideoCapture_Paused:
    908920            {
    909921                strFullData += s_strTableRow2
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r68508 r68883  
    7171
    7272    /* Update indicator-pool and virtualization stuff: */
    73     updateAppearanceOf(UIVisualElement_IndicatorPoolStuff | UIVisualElement_FeaturesStuff);
     73    updateAppearanceOf(UIVisualElement_IndicatorPoolStuff | UIVisualElement_VideoCapture | UIVisualElement_FeaturesStuff);
    7474}
    7575
     
    611611    if (iElement & UIVisualElement_IndicatorPoolStuff)
    612612        m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && uisession()->isRunning());
    613     /* Update status-bar indicator-pool appearance only when status-bar is visible and VM is running: */
    614     if (statusBar()->isVisible() && uisession()->isRunning())
    615     {
    616         if (iElement & UIVisualElement_HDStuff)
    617             m_pIndicatorsPool->updateAppearance(IndicatorType_HardDisks);
    618         if (iElement & UIVisualElement_CDStuff)
    619             m_pIndicatorsPool->updateAppearance(IndicatorType_OpticalDisks);
    620         if (iElement & UIVisualElement_FDStuff)
    621             m_pIndicatorsPool->updateAppearance(IndicatorType_FloppyDisks);
    622         if (iElement & UIVisualElement_AudioStuff)
    623             m_pIndicatorsPool->updateAppearance(IndicatorType_Audio);
    624         if (iElement & UIVisualElement_NetworkStuff)
    625             m_pIndicatorsPool->updateAppearance(IndicatorType_Network);
    626         if (iElement & UIVisualElement_USBStuff)
    627             m_pIndicatorsPool->updateAppearance(IndicatorType_USB);
    628         if (iElement & UIVisualElement_SharedFolderStuff)
    629             m_pIndicatorsPool->updateAppearance(IndicatorType_SharedFolders);
    630         if (iElement & UIVisualElement_Display)
    631             m_pIndicatorsPool->updateAppearance(IndicatorType_Display);
    632         if (iElement & UIVisualElement_VideoCapture)
    633             m_pIndicatorsPool->updateAppearance(IndicatorType_VideoCapture);
    634         if (iElement & UIVisualElement_FeaturesStuff)
    635             m_pIndicatorsPool->updateAppearance(IndicatorType_Features);
     613    /* Update status-bar indicator-pool appearance only when status-bar is visible: */
     614    if (statusBar()->isVisible())
     615    {
     616        /* If VM is running: */
     617        if (uisession()->isRunning())
     618        {
     619            if (iElement & UIVisualElement_HDStuff)
     620                m_pIndicatorsPool->updateAppearance(IndicatorType_HardDisks);
     621            if (iElement & UIVisualElement_CDStuff)
     622                m_pIndicatorsPool->updateAppearance(IndicatorType_OpticalDisks);
     623            if (iElement & UIVisualElement_FDStuff)
     624                m_pIndicatorsPool->updateAppearance(IndicatorType_FloppyDisks);
     625            if (iElement & UIVisualElement_AudioStuff)
     626                m_pIndicatorsPool->updateAppearance(IndicatorType_Audio);
     627            if (iElement & UIVisualElement_NetworkStuff)
     628                m_pIndicatorsPool->updateAppearance(IndicatorType_Network);
     629            if (iElement & UIVisualElement_USBStuff)
     630                m_pIndicatorsPool->updateAppearance(IndicatorType_USB);
     631            if (iElement & UIVisualElement_SharedFolderStuff)
     632                m_pIndicatorsPool->updateAppearance(IndicatorType_SharedFolders);
     633            if (iElement & UIVisualElement_Display)
     634                m_pIndicatorsPool->updateAppearance(IndicatorType_Display);
     635            if (iElement & UIVisualElement_FeaturesStuff)
     636                m_pIndicatorsPool->updateAppearance(IndicatorType_Features);
     637        }
     638        /* If VM is running or paused: */
     639        if (uisession()->isRunning() || uisession()->isPaused())
     640        {
     641            if (iElement & UIVisualElement_VideoCapture)
     642                m_pIndicatorsPool->updateAppearance(IndicatorType_VideoCapture);
     643        }
    636644    }
    637645}
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