- Timestamp:
- Dec 7, 2018 9:50:51 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r75886 r76044 30 30 #include "UIMediumDefs.h" 31 31 #include "UIExtraDataDefs.h" 32 #include "UISettingsDefs.h" 32 33 33 34 /* Other VBox includes: */ … … 120 121 template<> SHARED_LIBRARY_STUFF bool canConvert<MaxGuestResolutionPolicy>(); 121 122 template<> SHARED_LIBRARY_STUFF bool canConvert<UIMediumFormat>(); 122 123 template<> SHARED_LIBRARY_STUFF bool canConvert<UISettingsDefs::RecordingMode>(); 123 124 124 125 /* Declare COM canConvert specializations: */ … … 259 260 template<> SHARED_LIBRARY_STUFF QString toInternalString(const UIMediumFormat &enmUIMediumFormat); 260 261 template<> SHARED_LIBRARY_STUFF UIMediumFormat fromInternalString<UIMediumFormat>(const QString &strUIMediumFormat); 262 template<> SHARED_LIBRARY_STUFF QString toString(const UISettingsDefs::RecordingMode &enmRecordingMode); 263 template<> SHARED_LIBRARY_STUFF QString toInternalString(const UISettingsDefs::RecordingMode &enmRecordingMode); 264 template<> SHARED_LIBRARY_STUFF UISettingsDefs::RecordingMode fromInternalString<UISettingsDefs::RecordingMode>(const QString &enmRecordingMode); 261 265 262 266 -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r75966 r76044 84 84 template<> bool canConvert<MaxGuestResolutionPolicy>() { return true; } 85 85 template<> bool canConvert<UIMediumFormat>() { return true; } 86 template<> bool canConvert<UISettingsDefs::RecordingMode>() { return true; } 86 87 87 88 … … 2502 2503 return values.at(keys.indexOf(QRegExp(strUIMediumFormat, Qt::CaseInsensitive))); 2503 2504 } 2505 2506 /* QString <= UISettingsDefs::RecordingMode: */ 2507 template<> QString toString(const UISettingsDefs::RecordingMode &enmRecordingMode) 2508 { 2509 QString strResult; 2510 switch (enmRecordingMode) 2511 { 2512 case UISettingsDefs::RecordingMode_VideoAudio: strResult = QApplication::translate("VBoxGlobal", "Video/Audio", "UISettingsDefs::RecordingMode"); break; 2513 case UISettingsDefs::RecordingMode_VideoOnly: strResult = QApplication::translate("VBoxGlobal", "Video Only", "UISettingsDefs::RecordingMode"); break; 2514 case UISettingsDefs::RecordingMode_AudioOnly: strResult = QApplication::translate("VBoxGlobal", "Audio Only", "UISettingsDefs::RecordingMode"); break; 2515 default: 2516 { 2517 AssertMsgFailed(("No text for recording mode format=%d", enmRecordingMode)); 2518 break; 2519 } 2520 } 2521 return strResult; 2522 } 2523 2524 /* QString <= UISettingsDefs::RecordingMode: */ 2525 template<> QString toInternalString(const UISettingsDefs::RecordingMode &enmRecordingMode) 2526 { 2527 QString strResult; 2528 switch (enmRecordingMode) 2529 { 2530 case UISettingsDefs::RecordingMode_VideoAudio: strResult = "Video/Audio"; break; 2531 case UISettingsDefs::RecordingMode_VideoOnly: strResult = "VideoOnly"; break; 2532 case UISettingsDefs::RecordingMode_AudioOnly: strResult = "AudioOnly"; break; 2533 default: 2534 { 2535 AssertMsgFailed(("No text for recording mode=%d", enmRecordingMode)); 2536 break; 2537 } 2538 } 2539 return strResult; 2540 } 2541 2542 /* UISettingsDefs::RecordingMode <= QString: */ 2543 template<> UISettingsDefs::RecordingMode fromInternalString<UISettingsDefs::RecordingMode>(const QString &strRecordingMode) 2544 { 2545 /* Here we have some fancy stuff allowing us 2546 * to search through the keys using 'case-insensitive' rule: */ 2547 QStringList keys; QList<UISettingsDefs::RecordingMode> values; 2548 keys << "Video/Audio"; values << UISettingsDefs::RecordingMode_VideoAudio; 2549 keys << "VideoOnly"; values << UISettingsDefs::RecordingMode_VideoOnly; 2550 keys << "AudioOnly"; values << UISettingsDefs::RecordingMode_AudioOnly; 2551 /* VDI format for unknown words: */ 2552 if (!keys.contains(strRecordingMode, Qt::CaseInsensitive)) 2553 return UISettingsDefs::RecordingMode_VideoAudio; 2554 /* Corresponding format for known words: */ 2555 return values.at(keys.indexOf(QRegExp(strRecordingMode, Qt::CaseInsensitive))); 2556 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.h
r71630 r76044 49 49 }; 50 50 51 /** Recording mode enum is used in Display setting page to determine the recording mode. */ 52 enum RecordingMode 53 { 54 RecordingMode_VideoAudio = 0, 55 RecordingMode_VideoOnly = 1, 56 RecordingMode_AudioOnly = 2 57 }; 58 51 59 /** Determines configuration access level for passed @a enmSessionState and @a enmMachineState. */ 52 60 SHARED_LIBRARY_STUFF ConfigurationAccessLevel configurationAccessLevel(KSessionState enmSessionState, … … 287 295 288 296 #endif /* !___UISettingsDefs_h___ */ 289 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r75926 r76044 111 111 RecordingOption_VC, 112 112 RecordingOption_AC_Profile 113 };114 115 enum RecordingMode116 {117 RecordingMode_VideoAudio,118 RecordingMode_VideoOnly,119 RecordingMode_AudioOnly120 113 }; 121 114 … … 466 459 UIDataSettingsMachineDisplay::RecordingOption_VC); 467 460 if (fRecordAudio && fRecordVideo) 468 m_pComboBoxCaptureMode->setCurrentIndex( static_cast<int>(UIDataSettingsMachineDisplay::RecordingMode_VideoAudio));461 m_pComboBoxCaptureMode->setCurrentIndex(m_pComboBoxCaptureMode->findText(gpConverter->toString(UISettingsDefs::RecordingMode_VideoAudio))); 469 462 else if (fRecordAudio && !fRecordVideo) 470 m_pComboBoxCaptureMode->setCurrentIndex( static_cast<int>(UIDataSettingsMachineDisplay::RecordingMode_AudioOnly));463 m_pComboBoxCaptureMode->setCurrentIndex(m_pComboBoxCaptureMode->findText(gpConverter->toString(UISettingsDefs::RecordingMode_AudioOnly))); 471 464 else 472 m_pComboBoxCaptureMode->setCurrentIndex( static_cast<int>(UIDataSettingsMachineDisplay::RecordingMode_VideoOnly));465 m_pComboBoxCaptureMode->setCurrentIndex(m_pComboBoxCaptureMode->findText(gpConverter->toString(UISettingsDefs::RecordingMode_VideoOnly))); 473 466 474 467 m_pSliderAudioCaptureQuality->setValue(UIDataSettingsMachineDisplay::getAudioQualityFromOptions(oldDisplayData.m_strRecordingVideoOptions)); … … 519 512 /* Update recording options */ 520 513 QStringList optionValues; 521 optionValues.push_back((m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UI DataSettingsMachineDisplay::RecordingMode_VideoAudio) ||522 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UI DataSettingsMachineDisplay::RecordingMode_VideoOnly)) ? "true" : "false");523 optionValues.push_back((m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UI DataSettingsMachineDisplay::RecordingMode_VideoAudio) ||524 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UI DataSettingsMachineDisplay::RecordingMode_AudioOnly)) ? "true" : "false");514 optionValues.push_back((m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UISettingsDefs::RecordingMode_VideoAudio) || 515 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UISettingsDefs::RecordingMode_VideoOnly)) ? "true" : "false"); 516 optionValues.push_back((m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UISettingsDefs::RecordingMode_VideoAudio) || 517 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UISettingsDefs::RecordingMode_AudioOnly)) ? "true" : "false"); 525 518 if (m_pSliderAudioCaptureQuality->value() == 1) 526 519 optionValues.push_back("low"); … … 742 735 m_pLabelAudioCaptureQualityMed->setText(tr("medium", "quality")); 743 736 m_pLabelAudioCaptureQualityMax->setText(tr("high", "quality")); 737 738 m_pComboBoxCaptureMode->setItemText(0, gpConverter->toString(UISettingsDefs::RecordingMode_VideoAudio)); 739 m_pComboBoxCaptureMode->setItemText(1, gpConverter->toString(UISettingsDefs::RecordingMode_VideoOnly)); 740 m_pComboBoxCaptureMode->setItemText(2, gpConverter->toString(UISettingsDefs::RecordingMode_AudioOnly)); 741 744 742 updateRecordingFileSizeHint(); 745 743 } … … 1075 1073 AssertPtrReturnVoid(m_pComboBoxCaptureMode); 1076 1074 { 1077 m_pComboBoxCaptureMode->insertItem( UIDataSettingsMachineDisplay::RecordingMode_VideoAudio, "Video/Audio");1078 m_pComboBoxCaptureMode->insertItem( UIDataSettingsMachineDisplay::RecordingMode_VideoOnly, "Video Only");1079 m_pComboBoxCaptureMode->insertItem( UIDataSettingsMachineDisplay::RecordingMode_AudioOnly, "Audio Only");1075 m_pComboBoxCaptureMode->insertItem(0, ""); /* UISettingsDefs::RecordingMode_VideoAudio */ 1076 m_pComboBoxCaptureMode->insertItem(1, ""); /* UISettingsDefs::RecordingMode_VideoOnly */ 1077 m_pComboBoxCaptureMode->insertItem(2, ""); /* UISettingsDefs::RecordingMode_AudioOnly */ 1080 1078 } 1081 1079 … … 1729 1727 (isMachineOnline() && !m_pCache->base().m_fRecordingEnabled && m_pCheckboxVideoCapture->isChecked()); 1730 1728 1731 const UI DataSettingsMachineDisplay::RecordingMode enmRecordingMode =1732 static_cast<UI DataSettingsMachineDisplay::RecordingMode>(m_pComboBoxCaptureMode->currentIndex());1729 const UISettingsDefs::RecordingMode enmRecordingMode = 1730 static_cast<UISettingsDefs::RecordingMode>(m_pComboBoxCaptureMode->currentIndex()); 1733 1731 1734 1732 /* Video Capture Screens option should be enabled only if: … … 1736 1734 const bool fIsVideoCaptureScreenOptionEnabled = isMachineInValidMode() && m_pCheckboxVideoCapture->isChecked(); 1737 1735 1738 bool fRecordVideo = enmRecordingMode == UI DataSettingsMachineDisplay::RecordingMode_VideoOnly ||1739 enmRecordingMode == UI DataSettingsMachineDisplay::RecordingMode_VideoAudio;1740 bool fRecordAudio = enmRecordingMode == UI DataSettingsMachineDisplay::RecordingMode_AudioOnly ||1741 enmRecordingMode == UI DataSettingsMachineDisplay::RecordingMode_VideoAudio;1736 bool fRecordVideo = enmRecordingMode == UISettingsDefs::RecordingMode_VideoOnly || 1737 enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio; 1738 bool fRecordAudio = enmRecordingMode == UISettingsDefs::RecordingMode_AudioOnly || 1739 enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio; 1742 1740 1743 1741 m_pLabelVideoCaptureSize->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);
Note:
See TracChangeset
for help on using the changeset viewer.