- Timestamp:
- Jun 13, 2013 2:55:11 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r46474 r46536 388 388 src/widgets/UINameAndSystemEditor.h \ 389 389 src/widgets/VBoxWarningPane.h \ 390 src/widgets/UIFilmContainer.h \ 390 391 src/widgets/graphics/UIGraphicsButton.h \ 391 392 src/widgets/graphics/UIGraphicsRotatorButton.h \ … … 635 636 src/widgets/UINameAndSystemEditor.cpp \ 636 637 src/widgets/VBoxWarningPane.cpp \ 638 src/widgets/UIFilmContainer.cpp \ 637 639 src/widgets/graphics/UIGraphicsButton.cpp \ 638 640 src/widgets/graphics/UIGraphicsRotatorButton.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r46479 r46536 121 121 displayData.m_iVideoCaptureFrameRate = m_machine.GetVideoCaptureFps(); 122 122 displayData.m_iVideoCaptureBitRate = m_machine.GetVideoCaptureRate(); 123 displayData.m_screens = m_machine.GetVideoCaptureScreens(); 123 124 124 125 /* Initialize other variables: */ … … 167 168 m_pEditorVideoCaptureFrameRate->setValue(displayData.m_iVideoCaptureFrameRate); 168 169 m_pEditorVideoCaptureBitRate->setValue(displayData.m_iVideoCaptureBitRate); 170 m_pScrollerVideoCaptureScreens->setValue(displayData.m_screens); 169 171 170 172 /* Polish page finally: */ … … 209 211 displayData.m_iVideoCaptureFrameRate = m_pEditorVideoCaptureFrameRate->value(); 210 212 displayData.m_iVideoCaptureBitRate = m_pEditorVideoCaptureBitRate->value(); 213 displayData.m_screens = m_pScrollerVideoCaptureScreens->value(); 211 214 212 215 /* Cache display data: */ … … 254 257 255 258 /* 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()) 259 260 { 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); 260 287 m_machine.SetVideoCaptureFile(displayData.m_strVideoCaptureFilePath); 261 288 m_machine.SetVideoCaptureWidth(displayData.m_iVideoCaptureFrameWidth); … … 263 290 m_machine.SetVideoCaptureFps(displayData.m_iVideoCaptureFrameRate); 264 291 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); 267 293 } 268 294 } … … 440 466 441 467 /* Video Capture tab: */ 442 m_pContainerVideoCapture->setEnabled(isMachine Offline()); // TODO: Ask about isMachineSaved()443 m_pContainerVideoCaptureOptions->setEnabled(m_pCheckboxVideoCapture->isChecked());468 m_pContainerVideoCapture->setEnabled(isMachineInValidMode()); 469 sltHandleVideoCaptureCheckboxToggle(); 444 470 } 445 471 … … 478 504 checkVRAMRequirements(); 479 505 506 /* Update Video Capture tab screen count: */ 507 updateVideoCaptureScreenCount(); 508 480 509 /* Revalidate if possible: */ 481 510 if (m_pValidator) … … 493 522 checkVRAMRequirements(); 494 523 524 /* Update Video Capture tab screen count: */ 525 updateVideoCaptureScreenCount(); 526 495 527 /* Revalidate if possible: */ 496 528 if (m_pValidator) 497 529 m_pValidator->revalidate(); 530 } 531 532 void 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())); 498 539 } 499 540 … … 651 692 void UIMachineSettingsDisplay::prepareVideoCaptureTab() 652 693 { 694 /* Prepare Video Capture checkbox: */ 695 connect(m_pCheckboxVideoCapture, SIGNAL(toggled(bool)), this, SLOT(sltHandleVideoCaptureCheckboxToggle())); 696 653 697 /* Prepare filepath selector: */ 654 698 m_pEditorVideoCapturePath->setMode(VBoxFilePathSelectorWidget::Mode_File_Save); … … 809 853 } 810 854 855 void 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 811 863 /* static */ 812 864 void UIMachineSettingsDisplay::lookForCorrespondingPreset(QComboBox *pWhere, const QVariant &whichData) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
r46479 r46536 73 73 (m_iVideoCaptureFrameHeight == other.m_iVideoCaptureFrameHeight) && 74 74 (m_iVideoCaptureFrameRate == other.m_iVideoCaptureFrameRate) && 75 (m_iVideoCaptureBitRate == other.m_iVideoCaptureBitRate); 75 (m_iVideoCaptureBitRate == other.m_iVideoCaptureBitRate) && 76 (m_screens == other.m_screens); 76 77 } 77 78 … … 104 105 int m_iVideoCaptureFrameRate; 105 106 int m_iVideoCaptureBitRate; 107 QVector<BOOL> m_screens; 106 108 }; 107 109 typedef UISettingsCache<UIDataSettingsMachineDisplay> UICacheSettingsMachineDisplay; … … 167 169 168 170 /* Handlers: Video Capture stuff: */ 171 void sltHandleVideoCaptureCheckboxToggle(); 169 172 void sltHandleVideoCaptureFrameSizeComboboxChange(); 170 173 void sltHandleVideoCaptureFrameWidthEditorChange(); … … 190 193 /* Helpers: Video Capture stuff: */ 191 194 void lookForCorrespondingSizePreset(); 195 void updateVideoCaptureScreenCount(); 192 196 static void lookForCorrespondingPreset(QComboBox *pWhere, const QVariant &whichData); 193 197 static int calculateBitRate(int iFrameWidth, int iFrameHeight, int iFrameRate, int iQuality); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui
r46497 r46536 596 596 <item row="4" column="3"> 597 597 <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>&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> 598 618 </item> 599 619 </layout> … … 639 659 <container>1</container> 640 660 </customwidget> 661 <customwidget> 662 <class>UIFilmContainer</class> 663 <extends>QWidget</extends> 664 <header>UIFilmContainer.h</header> 665 </customwidget> 641 666 </customwidgets> 642 667 <resources/> … … 648 673 <slot>setEnabled(bool)</slot> 649 674 </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>656 675 </connections> 657 676 </ui>
Note:
See TracChangeset
for help on using the changeset viewer.