VirtualBox

Ignore:
Timestamp:
Aug 8, 2018 12:27:18 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9012. Update status bar icon tooltip for recording correctly

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

Legend:

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

    r72342 r73560  
    796796    };
    797797
     798    /** Video-capture modes. */
     799    enum UIIndicatorStateVideoCaptureMode
     800    {
     801        UIIndicatorStateVideoCaptureMode_None   = RT_BIT(0),
     802        UIIndicatorStateVideoCaptureMode_Video  = RT_BIT(1),
     803        UIIndicatorStateVideoCaptureMode_Audio  = RT_BIT(2)
     804    };
     805
    798806public:
    799807
     
    803811        , m_pAnimation(0)
    804812        , m_dRotationAngle(0)
     813        , m_eCaptureMode(UIIndicatorStateVideoCaptureMode_None)
    805814    {
    806815        /* Assign state-icons: */
     
    880889            setState(UIIndicatorStateVideoCapture_Paused);
    881890
     891        updateCaptureMode();
     892
    882893        /* Prepare tool-tip: */
    883894        QString strFullData;
     
    893904            case UIIndicatorStateVideoCapture_Paused:
    894905            {
     906                QString strToolTip;
     907                if ( m_eCaptureMode & UIIndicatorStateVideoCaptureMode_Audio &&
     908                    m_eCaptureMode & UIIndicatorStateVideoCaptureMode_Video)
     909                    strToolTip = "Video/audio capture file";
     910                else if (m_eCaptureMode & UIIndicatorStateVideoCaptureMode_Audio)
     911                    strToolTip = "Audio capture file";
     912                else if (m_eCaptureMode & UIIndicatorStateVideoCaptureMode_Video)
     913                    strToolTip = "Video capture file";
     914
    895915                strFullData += s_strTableRow2
    896                     .arg(QApplication::translate("UIIndicatorsPool", "Video capture file", "Video capture tooltip"))
     916                    .arg(QApplication::translate("UIIndicatorsPool", strToolTip.toLatin1().constData(), "Video capture tooltip"))
    897917                    .arg(machine.GetVideoCaptureFile());
    898918                break;
     
    915935    void setRotationAngle(double dRotationAngle) { m_dRotationAngle = dRotationAngle; update(); }
    916936
     937    /* Parses CMachine::videoCaptureOptions and updates m_eCaptureMode accordingly. */
     938    void updateCaptureMode()
     939    {
     940        m_eCaptureMode = UIIndicatorStateVideoCaptureMode_None;
     941
     942        /* Get machine: */
     943        if (!m_pSession)
     944            return;
     945        const CMachine machine = m_pSession->machine();
     946        if (machine.isNull())
     947            return;
     948        QStringList strOptionsPairList = machine.GetVideoCaptureOptions().split(",", QString::SkipEmptyParts);
     949
     950        for (int i = 0; i < strOptionsPairList.size(); ++i)
     951        {
     952            if (strOptionsPairList.at(i).contains("vc_enabled", Qt::CaseInsensitive) &&
     953                strOptionsPairList.at(i).contains("true", Qt::CaseInsensitive))
     954                m_eCaptureMode = (UIIndicatorStateVideoCaptureMode)((int)m_eCaptureMode | (int)UIIndicatorStateVideoCaptureMode_Video);
     955
     956            if (strOptionsPairList.at(i).contains("ac_enabled", Qt::CaseInsensitive) &&
     957                strOptionsPairList.at(i).contains("true", Qt::CaseInsensitive))
     958                m_eCaptureMode = (UIIndicatorStateVideoCaptureMode)((int)m_eCaptureMode | (int)UIIndicatorStateVideoCaptureMode_Audio);
     959        }
     960    }
     961
    917962    /** Holds the rotation animation instance. */
    918963    UIAnimationLoop *m_pAnimation;
    919964    /** Holds current rotation angle. */
    920965    double m_dRotationAngle;
     966
     967    UIIndicatorStateVideoCaptureMode m_eCaptureMode;
    921968};
    922969
     
    15041551
    15051552#include "UIIndicatorsPool.moc"
    1506 
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r73201 r73560  
    15921592                    fSuccess = m_machine.isOk();
    15931593                }
     1594                /* Save video capture options: */
     1595                if (fSuccess && newDisplayData.m_strVideoCaptureOptions != oldDisplayData.m_strVideoCaptureOptions)
     1596                {
     1597                    m_machine.SetVideoCaptureOptions(newDisplayData.m_strVideoCaptureOptions);
     1598                    fSuccess = m_machine.isOk();
     1599                }
    15941600                /* Save whether video capture is enabled: */
    15951601                if (fSuccess && newDisplayData.m_fVideoCaptureEnabled != oldDisplayData.m_fVideoCaptureEnabled)
     
    16791685    bool fVideoCapture = enmCaptureMode == UIDataSettingsMachineDisplay::CaptureMode_VideoOnly ||
    16801686        enmCaptureMode == UIDataSettingsMachineDisplay::CaptureMode_VideoAudio;
     1687    bool fAudioCapture = enmCaptureMode == UIDataSettingsMachineDisplay::CaptureMode_AudioOnly ||
     1688        enmCaptureMode == UIDataSettingsMachineDisplay::CaptureMode_VideoAudio;
    16811689
    16821690    m_pLabelVideoCaptureSize->setEnabled(fIsVideoCaptureOptionsEnabled && fVideoCapture);
     
    16941702    m_pScrollerVideoCaptureScreens->setEnabled(fIsVideoCaptureScreenOptionEnabled && fVideoCapture);
    16951703
     1704    m_pAudioCaptureQualityLabel->setEnabled(fIsVideoCaptureOptionsEnabled && fAudioCapture);
     1705    m_pContainerSliderAudioCaptureQuality->setEnabled(fIsVideoCaptureOptionsEnabled && fAudioCapture);
     1706
    16961707    m_pLabelVideoCaptureScreens->setEnabled(fIsVideoCaptureScreenOptionEnabled && fVideoCapture);
    16971708    m_pLabelVideoCaptureSizeHint->setEnabled(fIsVideoCaptureScreenOptionEnabled && fVideoCapture);
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