VirtualBox

Changeset 46536 in vbox for trunk


Ignore:
Timestamp:
Jun 13, 2013 2:55:11 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM settings: Display page: Video tab: Multi-screen support.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r46474 r46536  
    388388        src/widgets/UINameAndSystemEditor.h \
    389389        src/widgets/VBoxWarningPane.h \
     390        src/widgets/UIFilmContainer.h \
    390391        src/widgets/graphics/UIGraphicsButton.h \
    391392        src/widgets/graphics/UIGraphicsRotatorButton.h \
     
    635636        src/widgets/UINameAndSystemEditor.cpp \
    636637        src/widgets/VBoxWarningPane.cpp \
     638        src/widgets/UIFilmContainer.cpp \
    637639        src/widgets/graphics/UIGraphicsButton.cpp \
    638640        src/widgets/graphics/UIGraphicsRotatorButton.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r46479 r46536  
    121121    displayData.m_iVideoCaptureFrameRate = m_machine.GetVideoCaptureFps();
    122122    displayData.m_iVideoCaptureBitRate = m_machine.GetVideoCaptureRate();
     123    displayData.m_screens = m_machine.GetVideoCaptureScreens();
    123124
    124125    /* Initialize other variables: */
     
    167168    m_pEditorVideoCaptureFrameRate->setValue(displayData.m_iVideoCaptureFrameRate);
    168169    m_pEditorVideoCaptureBitRate->setValue(displayData.m_iVideoCaptureBitRate);
     170    m_pScrollerVideoCaptureScreens->setValue(displayData.m_screens);
    169171
    170172    /* Polish page finally: */
     
    209211    displayData.m_iVideoCaptureFrameRate = m_pEditorVideoCaptureFrameRate->value();
    210212    displayData.m_iVideoCaptureBitRate = m_pEditorVideoCaptureBitRate->value();
     213    displayData.m_screens = m_pScrollerVideoCaptureScreens->value();
    211214
    212215    /* Cache display data: */
     
    254257
    255258        /* Store Video Capture data: */
    256         m_machine.SetVideoCaptureEnabled(displayData.m_fVideoCaptureEnabled);
    257         /* Make sure machine is 'offline': */
    258         if (isMachineOffline()) // TODO: Ask about isMachineSaved()
     259        if (isMachineOnline())
    259260        {
     261            /* If Video Capture is *enabled* now: */
     262            if (m_cache.base().m_fVideoCaptureEnabled)
     263            {
     264                /* All we can do is to *disable* it: */
     265                if (!displayData.m_fVideoCaptureEnabled)
     266                    m_machine.SetVideoCaptureEnabled(displayData.m_fVideoCaptureEnabled);
     267            }
     268            /* If Video Capture is *disabled* now: */
     269            else
     270            {
     271                /* We should save all the options *before* Video Capture activation: */
     272                m_machine.SetVideoCaptureFile(displayData.m_strVideoCaptureFilePath);
     273                m_machine.SetVideoCaptureWidth(displayData.m_iVideoCaptureFrameWidth);
     274                m_machine.SetVideoCaptureHeight(displayData.m_iVideoCaptureFrameHeight);
     275                m_machine.SetVideoCaptureFps(displayData.m_iVideoCaptureFrameRate);
     276                m_machine.SetVideoCaptureRate(displayData.m_iVideoCaptureBitRate);
     277                m_machine.SetVideoCaptureScreens(displayData.m_screens);
     278                /* Finally we should *enable* Video Capture if necessary: */
     279                if (displayData.m_fVideoCaptureEnabled)
     280                    m_machine.SetVideoCaptureEnabled(displayData.m_fVideoCaptureEnabled);
     281            }
     282        }
     283        else
     284        {
     285            /* For 'offline' and 'saved' states the order is irrelevant: */
     286            m_machine.SetVideoCaptureEnabled(displayData.m_fVideoCaptureEnabled);
    260287            m_machine.SetVideoCaptureFile(displayData.m_strVideoCaptureFilePath);
    261288            m_machine.SetVideoCaptureWidth(displayData.m_iVideoCaptureFrameWidth);
     
    263290            m_machine.SetVideoCaptureFps(displayData.m_iVideoCaptureFrameRate);
    264291            m_machine.SetVideoCaptureRate(displayData.m_iVideoCaptureBitRate);
    265             QVector<BOOL> screens(m_machine.GetMonitorCount(), true);
    266             m_machine.SetVideoCaptureScreens(screens);
     292            m_machine.SetVideoCaptureScreens(displayData.m_screens);
    267293        }
    268294    }
     
    440466
    441467    /* Video Capture tab: */
    442     m_pContainerVideoCapture->setEnabled(isMachineOffline()); // TODO: Ask about isMachineSaved()
    443     m_pContainerVideoCaptureOptions->setEnabled(m_pCheckboxVideoCapture->isChecked());
     468    m_pContainerVideoCapture->setEnabled(isMachineInValidMode());
     469    sltHandleVideoCaptureCheckboxToggle();
    444470}
    445471
     
    478504    checkVRAMRequirements();
    479505
     506    /* Update Video Capture tab screen count: */
     507    updateVideoCaptureScreenCount();
     508
    480509    /* Revalidate if possible: */
    481510    if (m_pValidator)
     
    493522    checkVRAMRequirements();
    494523
     524    /* Update Video Capture tab screen count: */
     525    updateVideoCaptureScreenCount();
     526
    495527    /* Revalidate if possible: */
    496528    if (m_pValidator)
    497529        m_pValidator->revalidate();
     530}
     531
     532void UIMachineSettingsDisplay::sltHandleVideoCaptureCheckboxToggle()
     533{
     534    /* Video Capture options should be enabled only if:
     535     * 1. Machine is in 'offline' or 'saved' state and check-box is checked,
     536     * 2. Machine is in 'online' state, check-box is checked, and video recording is *disabled* currently. */
     537    m_pContainerVideoCaptureOptions->setEnabled(((isMachineOffline() || isMachineSaved()) && m_pCheckboxVideoCapture->isChecked()) ||
     538                                                (isMachineOnline()  && !m_cache.base().m_fVideoCaptureEnabled && m_pCheckboxVideoCapture->isChecked()));
    498539}
    499540
     
    651692void UIMachineSettingsDisplay::prepareVideoCaptureTab()
    652693{
     694    /* Prepare Video Capture checkbox: */
     695    connect(m_pCheckboxVideoCapture, SIGNAL(toggled(bool)), this, SLOT(sltHandleVideoCaptureCheckboxToggle()));
     696
    653697    /* Prepare filepath selector: */
    654698    m_pEditorVideoCapturePath->setMode(VBoxFilePathSelectorWidget::Mode_File_Save);
     
    809853}
    810854
     855void UIMachineSettingsDisplay::updateVideoCaptureScreenCount()
     856{
     857    /* Update copy of the cached item to get the desired result: */
     858    QVector<BOOL> screens = m_cache.base().m_screens;
     859    screens.resize(m_pEditorVideoScreenCount->value());
     860    m_pScrollerVideoCaptureScreens->setValue(screens);
     861}
     862
    811863/* static */
    812864void UIMachineSettingsDisplay::lookForCorrespondingPreset(QComboBox *pWhere, const QVariant &whichData)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h

    r46479 r46536  
    7373               (m_iVideoCaptureFrameHeight == other.m_iVideoCaptureFrameHeight) &&
    7474               (m_iVideoCaptureFrameRate == other.m_iVideoCaptureFrameRate) &&
    75                (m_iVideoCaptureBitRate == other.m_iVideoCaptureBitRate);
     75               (m_iVideoCaptureBitRate == other.m_iVideoCaptureBitRate) &&
     76               (m_screens == other.m_screens);
    7677    }
    7778
     
    104105    int m_iVideoCaptureFrameRate;
    105106    int m_iVideoCaptureBitRate;
     107    QVector<BOOL> m_screens;
    106108};
    107109typedef UISettingsCache<UIDataSettingsMachineDisplay> UICacheSettingsMachineDisplay;
     
    167169
    168170    /* Handlers: Video Capture stuff: */
     171    void sltHandleVideoCaptureCheckboxToggle();
    169172    void sltHandleVideoCaptureFrameSizeComboboxChange();
    170173    void sltHandleVideoCaptureFrameWidthEditorChange();
     
    190193    /* Helpers: Video Capture stuff: */
    191194    void lookForCorrespondingSizePreset();
     195    void updateVideoCaptureScreenCount();
    192196    static void lookForCorrespondingPreset(QComboBox *pWhere, const QVariant &whichData);
    193197    static int calculateBitRate(int iFrameWidth, int iFrameHeight, int iFrameRate, int iQuality);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui

    r46497 r46536  
    596596             <item row="4" column="3">
    597597              <widget class="QLabel" name="m_pLabelVideoCaptureBitRateUnits"/>
     598             </item>
     599             <item row="6" column="0">
     600              <widget class="QLabel" name="m_pLabelVideoCaptureScreens">
     601               <property name="text">
     602                <string>&amp;Screens:</string>
     603               </property>
     604               <property name="alignment">
     605                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignTop</set>
     606               </property>
     607               <property name="buddy">
     608                <cstring>m_pScrollerVideoCaptureScreens</cstring>
     609               </property>
     610              </widget>
     611             </item>
     612             <item row="6" column="1" colspan="3">
     613              <widget class="UIFilmContainer" name="m_pScrollerVideoCaptureScreens">
     614               <property name="whatsThis">
     615                <string></string>
     616               </property>
     617              </widget>
    598618             </item>
    599619            </layout>
     
    639659   <container>1</container>
    640660  </customwidget>
     661  <customwidget>
     662   <class>UIFilmContainer</class>
     663   <extends>QWidget</extends>
     664   <header>UIFilmContainer.h</header>
     665  </customwidget>
    641666 </customwidgets>
    642667 <resources/>
     
    648673   <slot>setEnabled(bool)</slot>
    649674  </connection>
    650   <connection>
    651    <sender>m_pCheckboxVideoCapture</sender>
    652    <signal>toggled(bool)</signal>
    653    <receiver>m_pContainerVideoCaptureOptions</receiver>
    654    <slot>setEnabled(bool)</slot>
    655   </connection>
    656675 </connections>
    657676</ui>
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