Changeset 94436 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 1, 2022 12:07:11 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r94378 r94436 912 912 src/settings/editors/UINameAndSystemEditor.h \ 913 913 src/settings/editors/UINetworkAttachmentEditor.h \ 914 src/settings/editors/UIRecordingSettingsEditor.h \ 914 915 src/settings/editors/UIScaleFactorEditor.h \ 915 916 src/settings/editors/UIShortcutConfigurationEditor.h \ … … 1471 1472 src/settings/editors/UINameAndSystemEditor.cpp \ 1472 1473 src/settings/editors/UINetworkAttachmentEditor.cpp \ 1474 src/settings/editors/UIRecordingSettingsEditor.cpp \ 1473 1475 src/settings/editors/UIScaleFactorEditor.cpp \ 1474 1476 src/settings/editors/UIShortcutConfigurationEditor.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.h
r93115 r94436 65 65 } 66 66 67 Q_DECLARE_METATYPE(UISettingsDefs::RecordingMode); 68 67 69 68 70 /** Template organizing settings object cache: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIRecordingSettingsEditor.cpp
r94435 r94436 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI VRDESettingsEditor class implementation.3 * VBox Qt GUI - UIRecordingSettingsEditor class implementation. 4 4 */ 5 5 … … 18 18 /* Qt includes: */ 19 19 #include <QCheckBox> 20 #include <Q ComboBox>20 #include <QHBoxLayout> 21 21 #include <QGridLayout> 22 22 #include <QLabel> 23 #include <QLineEdit> 23 #include <QSpinBox> 24 #include <QVBoxLayout> 24 25 25 26 /* GUI includes: */ 27 #include "QIAdvancedSlider.h" 28 #include "UICommon.h" 26 29 #include "UIConverter.h" 27 #include "UIVRDESettingsEditor.h" 28 29 30 UIVRDESettingsEditor::UIVRDESettingsEditor(QWidget *pParent /* = 0 */) 30 #include "UIFilePathSelector.h" 31 #include "UIFilmContainer.h" 32 #include "UIRecordingSettingsEditor.h" 33 34 /* Defines: */ 35 #define VIDEO_CAPTURE_BIT_RATE_MIN 32 36 #define VIDEO_CAPTURE_BIT_RATE_MAX 2048 37 38 39 UIRecordingSettingsEditor::UIRecordingSettingsEditor(QWidget *pParent /* = 0 */) 31 40 : QIWithRetranslateUI<QWidget>(pParent) 32 41 , m_fFeatureEnabled(false) 33 , m_enmAuthType(KAuthType_Max) 34 , m_fMultipleConnectionsAllowed(false) 42 , m_fOptionsAvailable(false) 43 , m_fScreenOptionsAvailable(false) 44 , m_enmMode(UISettingsDefs::RecordingMode_VideoAudio) 45 , m_iFrameWidth(0) 46 , m_iFrameHeight(0) 47 , m_iFrameRate(0) 48 , m_iBitRate(0) 49 , m_iAudioQualityRate(0) 35 50 , m_pCheckboxFeature(0) 36 , m_pWidgetSettings(0) 37 , m_pLabelPort(0) 38 , m_pEditorPort(0) 39 , m_pLabelAuthMethod(0) 40 , m_pComboAuthType(0) 41 , m_pLabelTimeout(0) 42 , m_pEditorTimeout(0) 43 , m_pLabelOptions(0) 44 , m_pCheckboxMultipleConnections(0) 51 , m_pLabelMode(0) 52 , m_pComboMode(0) 53 , m_pLabelFilePath(0) 54 , m_pEditorFilePath(0) 55 , m_pLabelFrameSize(0) 56 , m_pComboFrameSize(0) 57 , m_pSpinboxFrameWidth(0) 58 , m_pSpinboxFrameHeight(0) 59 , m_pLabelFrameRate(0) 60 , m_pWidgetFrameRateSettings(0) 61 , m_pSliderFrameRate(0) 62 , m_pSpinboxFrameRate(0) 63 , m_pLabelFrameRateMin(0) 64 , m_pLabelFrameRateMax(0) 65 , m_pLabelVideoQuality(0) 66 , m_pWidgetVideoQualitySettings(0) 67 , m_pSliderVideoQuality(0) 68 , m_pSpinboxVideoQuality(0) 69 , m_pLabelVideoQualityMin(0) 70 , m_pLabelVideoQualityMed(0) 71 , m_pLabelVideoQualityMax(0) 72 , m_pLabelAudioQuality(0) 73 , m_pWidgetAudioQualitySettings(0) 74 , m_pSliderAudioQuality(0) 75 , m_pLabelAudioQualityMin(0) 76 , m_pLabelAudioQualityMed(0) 77 , m_pLabelAudioQualityMax(0) 78 , m_pLabelSizeHint(0) 79 , m_pLabelScreens(0) 80 , m_pScrollerScreens(0) 45 81 { 46 82 prepare(); 47 83 } 48 84 49 void UI VRDESettingsEditor::setFeatureEnabled(bool fEnabled)85 void UIRecordingSettingsEditor::setFeatureEnabled(bool fEnabled) 50 86 { 51 87 /* Update cached value and … … 57 93 { 58 94 m_pCheckboxFeature->setChecked(m_fFeatureEnabled); 59 sltHandleFeatureToggled( m_pCheckboxFeature->isChecked());95 sltHandleFeatureToggled(); 60 96 } 61 97 } 62 98 } 63 99 64 bool UI VRDESettingsEditor::isFeatureEnabled() const100 bool UIRecordingSettingsEditor::isFeatureEnabled() const 65 101 { 66 102 return m_pCheckboxFeature ? m_pCheckboxFeature->isChecked() : m_fFeatureEnabled; 67 103 } 68 104 69 void UIVRDESettingsEditor::setVRDEOptionsAvailable(bool fAvailable) 70 { 71 if (m_pLabelOptions) 72 m_pLabelOptions->setEnabled(fAvailable); 73 if (m_pCheckboxMultipleConnections) 74 m_pCheckboxMultipleConnections->setEnabled(fAvailable); 75 } 76 77 void UIVRDESettingsEditor::setPort(const QString &strPort) 78 { 79 /* Update cached value and 80 * line-edit if value has changed: */ 81 if (m_strPort != strPort) 82 { 83 m_strPort = strPort; 84 if (m_pEditorPort) 85 m_pEditorPort->setText(m_strPort); 86 } 87 } 88 89 QString UIVRDESettingsEditor::port() const 90 { 91 return m_pEditorPort ? m_pEditorPort->text() : m_strPort; 92 } 93 94 void UIVRDESettingsEditor::setAuthType(const KAuthType &enmType) 105 void UIRecordingSettingsEditor::setOptionsAvailable(bool fAvailable) 106 { 107 /* Update cached value and 108 * widget availability if value has changed: */ 109 if (m_fOptionsAvailable != fAvailable) 110 { 111 m_fOptionsAvailable = fAvailable; 112 updateWidgetAvailability(); 113 } 114 } 115 116 void UIRecordingSettingsEditor::setScreenOptionsAvailable(bool fAvailable) 117 { 118 /* Update cached value and 119 * widget availability if value has changed: */ 120 if (m_fScreenOptionsAvailable != fAvailable) 121 { 122 m_fScreenOptionsAvailable = fAvailable; 123 updateWidgetAvailability(); 124 } 125 } 126 127 void UIRecordingSettingsEditor::setMode(UISettingsDefs::RecordingMode enmMode) 95 128 { 96 129 /* Update cached value and 97 130 * combo if value has changed: */ 98 if (m_enmAuthType != enmType) 99 { 100 m_enmAuthType = enmType; 101 repopulateComboAuthType(); 102 } 103 } 104 105 KAuthType UIVRDESettingsEditor::authType() const 106 { 107 return m_pComboAuthType ? m_pComboAuthType->currentData().value<KAuthType>() : m_enmAuthType; 108 } 109 110 void UIVRDESettingsEditor::setTimeout(const QString &strTimeout) 111 { 112 /* Update cached value and 113 * line-edit if value has changed: */ 114 if (m_strTimeout != strTimeout) 115 { 116 m_strTimeout = strTimeout; 117 if (m_pEditorTimeout) 118 m_pEditorTimeout->setText(m_strTimeout); 119 } 120 } 121 122 QString UIVRDESettingsEditor::timeout() const 123 { 124 return m_pEditorTimeout ? m_pEditorTimeout->text() : m_strTimeout; 125 } 126 127 void UIVRDESettingsEditor::setMultipleConnectionsAllowed(bool fAllowed) 128 { 129 /* Update cached value and 130 * check-box if value has changed: */ 131 if (m_fMultipleConnectionsAllowed != fAllowed) 132 { 133 m_fMultipleConnectionsAllowed = fAllowed; 134 if (m_pCheckboxMultipleConnections) 135 m_pCheckboxMultipleConnections->setChecked(m_fMultipleConnectionsAllowed); 136 } 137 } 138 139 bool UIVRDESettingsEditor::isMultipleConnectionsAllowed() const 140 { 141 return m_pCheckboxMultipleConnections ? m_pCheckboxMultipleConnections->isChecked() : m_fMultipleConnectionsAllowed; 142 } 143 144 void UIVRDESettingsEditor::retranslateUi() 145 { 146 if (m_pCheckboxFeature) 147 { 148 m_pCheckboxFeature->setText(tr("&Enable Server")); 149 m_pCheckboxFeature->setToolTip(tr("When checked, the VM will act as a Remote Desktop Protocol (RDP) server, allowing " 150 "remote clients to connect and operate the VM (when it is running) using a standard " 151 "RDP client.")); 152 } 153 154 if (m_pLabelPort) 155 m_pLabelPort->setText(tr("Server &Port:")); 156 if (m_pEditorPort) 157 m_pEditorPort->setToolTip(tr("Holds the VRDP Server port number. You may specify 0 (zero), to select port 3389, the " 158 "standard port for RDP.")); 159 160 if (m_pLabelAuthMethod) 161 m_pLabelAuthMethod->setText(tr("Authentication &Method:")); 162 if (m_pComboAuthType) 163 { 164 for (int iIndex = 0; iIndex < m_pComboAuthType->count(); ++iIndex) 131 if (m_enmMode != enmMode) 132 { 133 m_enmMode = enmMode; 134 if (m_pComboMode) 165 135 { 166 const KAuthType enmType = m_pComboAuthType->itemData(iIndex).value<KAuthType>(); 167 m_pComboAuthType->setItemText(iIndex, gpConverter->toString(enmType)); 136 const int iIndex = m_pComboMode->findData(QVariant::fromValue(enmMode)); 137 if (iIndex != -1) 138 m_pComboMode->setCurrentIndex(iIndex); 168 139 } 169 m_pComboAuthType->setToolTip(tr("Selects the VRDP authentication method.")); 170 } 171 172 if (m_pLabelTimeout) 173 m_pLabelTimeout->setText(tr("Authentication &Timeout:")); 174 if (m_pEditorTimeout) 175 m_pEditorTimeout->setToolTip(tr("Holds the timeout for guest authentication, in milliseconds.")); 176 177 if (m_pLabelOptions) 178 m_pLabelOptions->setText(tr("Extended Features:")); 179 if (m_pCheckboxMultipleConnections) 180 { 181 m_pCheckboxMultipleConnections->setText(tr("&Allow Multiple Connections")); 182 m_pCheckboxMultipleConnections->setToolTip(tr("When checked, multiple simultaneous connections to the VM are " 183 "permitted.")); 184 } 185 } 186 187 void UIVRDESettingsEditor::sltHandleFeatureToggled(bool fEnabled) 140 } 141 } 142 143 UISettingsDefs::RecordingMode UIRecordingSettingsEditor::mode() const 144 { 145 return m_pComboMode ? m_pComboMode->currentData().value<UISettingsDefs::RecordingMode>() : m_enmMode; 146 } 147 148 void UIRecordingSettingsEditor::setFolder(const QString &strFolder) 149 { 150 /* Update cached value and 151 * file editor if value has changed: */ 152 if (m_strFolder != strFolder) 153 { 154 m_strFolder = strFolder; 155 if (m_pEditorFilePath) 156 m_pEditorFilePath->setInitialPath(m_strFolder); 157 } 158 } 159 160 QString UIRecordingSettingsEditor::folder() const 161 { 162 return m_pEditorFilePath ? m_pEditorFilePath->initialPath() : m_strFolder; 163 } 164 165 void UIRecordingSettingsEditor::setFilePath(const QString &strFilePath) 166 { 167 /* Update cached value and 168 * file editor if value has changed: */ 169 if (m_strFilePath != strFilePath) 170 { 171 m_strFilePath = strFilePath; 172 if (m_pEditorFilePath) 173 m_pEditorFilePath->setPath(m_strFilePath); 174 } 175 } 176 177 QString UIRecordingSettingsEditor::filePath() const 178 { 179 return m_pEditorFilePath ? m_pEditorFilePath->path() : m_strFilePath; 180 } 181 182 void UIRecordingSettingsEditor::setFrameWidth(int iWidth) 183 { 184 /* Update cached value and 185 * spin-box if value has changed: */ 186 if (m_iFrameWidth != iWidth) 187 { 188 m_iFrameWidth = iWidth; 189 if (m_pSpinboxFrameWidth) 190 m_pSpinboxFrameWidth->setValue(m_iFrameWidth); 191 } 192 } 193 194 int UIRecordingSettingsEditor::frameWidth() const 195 { 196 return m_pSpinboxFrameWidth ? m_pSpinboxFrameWidth->value() : m_iFrameWidth; 197 } 198 199 void UIRecordingSettingsEditor::setFrameHeight(int iHeight) 200 { 201 /* Update cached value and 202 * spin-box if value has changed: */ 203 if (m_iFrameHeight != iHeight) 204 { 205 m_iFrameHeight = iHeight; 206 if (m_pSpinboxFrameHeight) 207 m_pSpinboxFrameHeight->setValue(m_iFrameHeight); 208 } 209 } 210 211 int UIRecordingSettingsEditor::frameHeight() const 212 { 213 return m_pSpinboxFrameHeight ? m_pSpinboxFrameHeight->value() : m_iFrameHeight; 214 } 215 216 void UIRecordingSettingsEditor::setFrameRate(int iRate) 217 { 218 /* Update cached value and 219 * spin-box if value has changed: */ 220 if (m_iFrameRate != iRate) 221 { 222 m_iFrameRate = iRate; 223 if (m_pSpinboxFrameRate) 224 m_pSpinboxFrameRate->setValue(m_iFrameRate); 225 } 226 } 227 228 int UIRecordingSettingsEditor::frameRate() const 229 { 230 return m_pSpinboxFrameRate ? m_pSpinboxFrameRate->value() : m_iFrameRate; 231 } 232 233 void UIRecordingSettingsEditor::setBitRate(int iRate) 234 { 235 /* Update cached value and 236 * spin-box if value has changed: */ 237 if (m_iBitRate != iRate) 238 { 239 m_iBitRate = iRate; 240 if (m_pSpinboxVideoQuality) 241 m_pSpinboxVideoQuality->setValue(m_iBitRate); 242 } 243 } 244 245 int UIRecordingSettingsEditor::bitRate() const 246 { 247 return m_pSpinboxVideoQuality ? m_pSpinboxVideoQuality->value() : m_iBitRate; 248 } 249 250 void UIRecordingSettingsEditor::setAudioQualityRate(int iRate) 251 { 252 /* Update cached value and 253 * slider if value has changed: */ 254 if (m_iAudioQualityRate != iRate) 255 { 256 m_iAudioQualityRate = iRate; 257 if (m_pSliderAudioQuality) 258 m_pSliderAudioQuality->setValue(m_iAudioQualityRate); 259 } 260 } 261 262 int UIRecordingSettingsEditor::audioQualityRate() const 263 { 264 return m_pSliderAudioQuality ? m_pSliderAudioQuality->value() : m_iAudioQualityRate; 265 } 266 267 void UIRecordingSettingsEditor::setScreens(const QVector<BOOL> &screens) 268 { 269 /* Update cached value and 270 * editor if value has changed: */ 271 if (m_screens != screens) 272 { 273 m_screens = screens; 274 if (m_pScrollerScreens) 275 m_pScrollerScreens->setValue(m_screens); 276 } 277 } 278 279 QVector<BOOL> UIRecordingSettingsEditor::screens() const 280 { 281 return m_pScrollerScreens ? m_pScrollerScreens->value() : m_screens; 282 } 283 284 void UIRecordingSettingsEditor::retranslateUi() 285 { 286 m_pCheckboxFeature->setText(tr("&Enable Recording")); 287 m_pCheckboxFeature->setToolTip(tr("When checked, VirtualBox will record the virtual machine session as a video file.")); 288 289 m_pLabelMode->setText(tr("Recording &Mode:")); 290 for (int iIndex = 0; iIndex < m_pComboMode->count(); ++iIndex) 291 { 292 const UISettingsDefs::RecordingMode enmType = 293 m_pComboMode->itemData(iIndex).value<UISettingsDefs::RecordingMode>(); 294 m_pComboMode->setItemText(iIndex, gpConverter->toString(enmType)); 295 } 296 m_pComboMode->setToolTip(tr("Holds the recording mode.")); 297 298 m_pLabelFilePath->setText(tr("File &Path:")); 299 m_pEditorFilePath->setToolTip(tr("Holds the filename VirtualBox uses to save the recorded content.")); 300 301 m_pLabelFrameSize->setText(tr("Frame Si&ze:")); 302 m_pComboFrameSize->setItemText(0, tr("User Defined")); 303 m_pComboFrameSize->setToolTip(tr("Holds the resolution (frame size) of the recorded video.")); 304 m_pSpinboxFrameWidth->setToolTip(tr("Holds the horizontal resolution (frame width) of the recorded video.")); 305 m_pSpinboxFrameHeight->setToolTip(tr("Holds the vertical resolution (frame height) of the recorded video.")); 306 307 m_pLabelFrameRate->setText(tr("Frame R&ate:")); 308 m_pSliderFrameRate->setToolTip(tr("Holds the maximum number of frames per second. Additional frames " 309 "will be skipped. Reducing this value will increase the number of skipped " 310 "frames and reduce the file size.")); 311 m_pSpinboxFrameRate->setSuffix(QString(" %1").arg(tr("fps"))); 312 m_pSpinboxFrameRate->setToolTip(tr("Holds the maximum number of frames per second. Additional frames " 313 "will be skipped. Reducing this value will increase the number of skipped " 314 "frames and reduce the file size.")); 315 m_pLabelFrameRateMin->setText(tr("%1 fps").arg(m_pSliderFrameRate->minimum())); 316 m_pLabelFrameRateMax->setText(tr("%1 fps").arg(m_pSliderFrameRate->maximum())); 317 318 m_pLabelVideoQuality->setText(tr("&Video Quality:")); 319 m_pSliderVideoQuality->setToolTip(tr("Holds the quality. Increasing this value will make the video " 320 "look better at the cost of an increased file size.")); 321 m_pSpinboxVideoQuality->setSuffix(QString(" %1").arg(tr("kbps"))); 322 m_pSpinboxVideoQuality->setToolTip(tr("Holds the bitrate in kilobits per second. Increasing this value " 323 "will make the video look better at the cost of an increased file size.")); 324 m_pLabelVideoQualityMin->setText(tr("low", "quality")); 325 m_pLabelVideoQualityMed->setText(tr("medium", "quality")); 326 m_pLabelVideoQualityMax->setText(tr("high", "quality")); 327 328 m_pLabelAudioQuality->setText(tr("&Audio Quality:")); 329 m_pSliderAudioQuality->setToolTip(tr("Holds the quality. Increasing this value will make the audio " 330 "sound better at the cost of an increased file size.")); 331 m_pLabelAudioQualityMin->setText(tr("low", "quality")); 332 m_pLabelAudioQualityMed->setText(tr("medium", "quality")); 333 m_pLabelAudioQualityMax->setText(tr("high", "quality")); 334 335 m_pLabelScreens->setText(tr("Scree&ns:")); 336 337 updateRecordingFileSizeHint(); 338 } 339 340 void UIRecordingSettingsEditor::sltHandleFeatureToggled() 188 341 { 189 342 /* Update widget availability: */ 190 if (m_pWidgetSettings) 191 m_pWidgetSettings->setEnabled(fEnabled); 192 193 /* Notify listeners: */ 194 emit sigChanged(); 195 } 196 197 void UIVRDESettingsEditor::prepare() 343 updateWidgetAvailability(); 344 } 345 346 void UIRecordingSettingsEditor::sltHandleModeComboChange() 347 { 348 /* Update widget availability: */ 349 updateWidgetAvailability(); 350 } 351 352 void UIRecordingSettingsEditor::sltHandleVideoFrameSizeComboChange() 353 { 354 /* Get the proposed size: */ 355 const int iCurrentIndex = m_pComboFrameSize->currentIndex(); 356 const QSize videoCaptureSize = m_pComboFrameSize->itemData(iCurrentIndex).toSize(); 357 358 /* Make sure its valid: */ 359 if (!videoCaptureSize.isValid()) 360 return; 361 362 /* Apply proposed size: */ 363 m_pSpinboxFrameWidth->setValue(videoCaptureSize.width()); 364 m_pSpinboxFrameHeight->setValue(videoCaptureSize.height()); 365 } 366 367 void UIRecordingSettingsEditor::sltHandleVideoFrameWidthChange() 368 { 369 /* Look for preset: */ 370 lookForCorrespondingFrameSizePreset(); 371 /* Update quality and bit-rate: */ 372 sltHandleVideoBitRateSliderChange(); 373 } 374 375 void UIRecordingSettingsEditor::sltHandleVideoFrameHeightChange() 376 { 377 /* Look for preset: */ 378 lookForCorrespondingFrameSizePreset(); 379 /* Update quality and bit-rate: */ 380 sltHandleVideoBitRateSliderChange(); 381 } 382 383 void UIRecordingSettingsEditor::sltHandleVideoFrameRateSliderChange() 384 { 385 /* Apply proposed frame-rate: */ 386 m_pSpinboxFrameRate->blockSignals(true); 387 m_pSpinboxFrameRate->setValue(m_pSliderFrameRate->value()); 388 m_pSpinboxFrameRate->blockSignals(false); 389 /* Update quality and bit-rate: */ 390 sltHandleVideoBitRateSliderChange(); 391 } 392 393 void UIRecordingSettingsEditor::sltHandleVideoFrameRateSpinboxChange() 394 { 395 /* Apply proposed frame-rate: */ 396 m_pSliderFrameRate->blockSignals(true); 397 m_pSliderFrameRate->setValue(m_pSpinboxFrameRate->value()); 398 m_pSliderFrameRate->blockSignals(false); 399 /* Update quality and bit-rate: */ 400 sltHandleVideoBitRateSliderChange(); 401 } 402 403 void UIRecordingSettingsEditor::sltHandleVideoBitRateSliderChange() 404 { 405 /* Calculate/apply proposed bit-rate: */ 406 m_pSpinboxVideoQuality->blockSignals(true); 407 m_pSpinboxVideoQuality->setValue(calculateBitRate(m_pSpinboxFrameWidth->value(), 408 m_pSpinboxFrameHeight->value(), 409 m_pSpinboxFrameRate->value(), 410 m_pSliderVideoQuality->value())); 411 m_pSpinboxVideoQuality->blockSignals(false); 412 updateRecordingFileSizeHint(); 413 } 414 415 void UIRecordingSettingsEditor::sltHandleVideoBitRateSpinboxChange() 416 { 417 /* Calculate/apply proposed quality: */ 418 m_pSliderVideoQuality->blockSignals(true); 419 m_pSliderVideoQuality->setValue(calculateQuality(m_pSpinboxFrameWidth->value(), 420 m_pSpinboxFrameHeight->value(), 421 m_pSpinboxFrameRate->value(), 422 m_pSpinboxVideoQuality->value())); 423 m_pSliderVideoQuality->blockSignals(false); 424 updateRecordingFileSizeHint(); 425 } 426 427 void UIRecordingSettingsEditor::prepare() 198 428 { 199 429 /* Prepare everything: */ … … 205 435 } 206 436 207 void UI VRDESettingsEditor::prepareWidgets()437 void UIRecordingSettingsEditor::prepareWidgets() 208 438 { 209 439 /* Prepare main layout: */ … … 225 455 226 456 /* Prepare 'settings' widget: */ 227 m_pWidgetSettings = new QWidget(this);228 if ( m_pWidgetSettings)457 QWidget *pWidgetSettings = new QWidget(this); 458 if (pWidgetSettings) 229 459 { 230 /* Prepare 'settings'layout: */231 QGridLayout *pLayout RemoteDisplaySettings = new QGridLayout(m_pWidgetSettings);232 if (pLayout RemoteDisplaySettings)460 /* Prepare recording settings widget layout: */ 461 QGridLayout *pLayoutSettings = new QGridLayout(pWidgetSettings); 462 if (pLayoutSettings) 233 463 { 234 pLayoutRemoteDisplaySettings->setContentsMargins(0, 0, 0, 0); 235 pLayoutRemoteDisplaySettings->setColumnStretch(1, 1); 236 237 /* Prepare 'port' label: */ 238 m_pLabelPort = new QLabel(m_pWidgetSettings); 239 if (m_pLabelPort) 240 { 241 m_pLabelPort->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 242 pLayoutRemoteDisplaySettings->addWidget(m_pLabelPort, 0, 0); 243 } 244 /* Prepare 'port' editor: */ 245 m_pEditorPort = new QLineEdit(m_pWidgetSettings); 246 if (m_pEditorPort) 247 { 248 if (m_pLabelPort) 249 m_pLabelPort->setBuddy(m_pEditorPort); 250 m_pEditorPort->setValidator(new QRegularExpressionValidator( 251 QRegularExpression("(([0-9]{1,5}(\\-[0-9]{1,5}){0,1}),)*([0-9]{1,5}(\\-[0-9]{1,5}){0,1})"), this)); 252 253 pLayoutRemoteDisplaySettings->addWidget(m_pEditorPort, 0, 1, 1, 2); 254 } 255 256 /* Prepare 'auth type' label: */ 257 m_pLabelAuthMethod = new QLabel(m_pWidgetSettings); 258 if (m_pLabelAuthMethod) 259 { 260 m_pLabelAuthMethod->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 261 pLayoutRemoteDisplaySettings->addWidget(m_pLabelAuthMethod, 1, 0); 262 } 263 /* Prepare 'auth type' combo: */ 264 m_pComboAuthType = new QComboBox(m_pWidgetSettings); 265 if (m_pComboAuthType) 266 { 267 if (m_pLabelAuthMethod) 268 m_pLabelAuthMethod->setBuddy(m_pComboAuthType); 269 m_pComboAuthType->setSizeAdjustPolicy(QComboBox::AdjustToContents); 270 271 pLayoutRemoteDisplaySettings->addWidget(m_pComboAuthType, 1, 1, 1, 2); 272 } 273 274 /* Prepare 'timeout' label: */ 275 m_pLabelTimeout = new QLabel(m_pWidgetSettings); 276 if (m_pLabelTimeout) 277 { 278 m_pLabelTimeout->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 279 pLayoutRemoteDisplaySettings->addWidget(m_pLabelTimeout, 2, 0); 280 } 281 /* Prepare 'timeout' editor: */ 282 m_pEditorTimeout = new QLineEdit(m_pWidgetSettings); 283 if (m_pEditorTimeout) 284 { 285 if (m_pLabelTimeout) 286 m_pLabelTimeout->setBuddy(m_pEditorTimeout); 287 m_pEditorTimeout->setValidator(new QIntValidator(this)); 288 289 pLayoutRemoteDisplaySettings->addWidget(m_pEditorTimeout, 2, 1, 1, 2); 290 } 291 292 /* Prepare 'options' label: */ 293 m_pLabelOptions = new QLabel(m_pWidgetSettings); 294 if (m_pLabelOptions) 295 { 296 m_pLabelOptions->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 297 pLayoutRemoteDisplaySettings->addWidget(m_pLabelOptions, 3, 0); 298 } 299 /* Prepare 'multiple connections' check-box: */ 300 m_pCheckboxMultipleConnections = new QCheckBox(m_pWidgetSettings); 301 if (m_pCheckboxMultipleConnections) 302 pLayoutRemoteDisplaySettings->addWidget(m_pCheckboxMultipleConnections, 3, 1); 464 pLayoutSettings->setContentsMargins(0, 0, 0, 0); 465 466 /* Prepare recording mode label: */ 467 m_pLabelMode = new QLabel(pWidgetSettings); 468 if (m_pLabelMode) 469 { 470 m_pLabelMode->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 471 pLayoutSettings->addWidget(m_pLabelMode, 0, 0); 472 } 473 /* Prepare recording mode combo: */ 474 m_pComboMode = new QComboBox(pWidgetSettings); 475 if (m_pComboMode) 476 { 477 if (m_pLabelMode) 478 m_pLabelMode->setBuddy(m_pComboMode); 479 m_pComboMode->addItem(QString(), QVariant::fromValue(UISettingsDefs::RecordingMode_VideoAudio)); 480 m_pComboMode->addItem(QString(), QVariant::fromValue(UISettingsDefs::RecordingMode_VideoOnly)); 481 m_pComboMode->addItem(QString(), QVariant::fromValue(UISettingsDefs::RecordingMode_AudioOnly)); 482 483 pLayoutSettings->addWidget(m_pComboMode, 0, 1, 1, 3); 484 } 485 486 /* Prepare recording file path label: */ 487 m_pLabelFilePath = new QLabel(pWidgetSettings); 488 if (m_pLabelFilePath) 489 { 490 m_pLabelFilePath->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 491 pLayoutSettings->addWidget(m_pLabelFilePath, 1, 0); 492 } 493 /* Prepare recording file path editor: */ 494 m_pEditorFilePath = new UIFilePathSelector(pWidgetSettings); 495 if (m_pEditorFilePath) 496 { 497 if (m_pLabelFilePath) 498 m_pLabelFilePath->setBuddy(m_pEditorFilePath->focusProxy()); 499 m_pEditorFilePath->setEditable(false); 500 m_pEditorFilePath->setMode(UIFilePathSelector::Mode_File_Save); 501 502 pLayoutSettings->addWidget(m_pEditorFilePath, 1, 1, 1, 3); 503 } 504 505 /* Prepare recording frame size label: */ 506 m_pLabelFrameSize = new QLabel(pWidgetSettings); 507 if (m_pLabelFrameSize) 508 { 509 m_pLabelFrameSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 510 pLayoutSettings->addWidget(m_pLabelFrameSize, 2, 0); 511 } 512 /* Prepare recording frame size combo: */ 513 m_pComboFrameSize = new QComboBox(pWidgetSettings); 514 if (m_pComboFrameSize) 515 { 516 if (m_pLabelFrameSize) 517 m_pLabelFrameSize->setBuddy(m_pComboFrameSize); 518 m_pComboFrameSize->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); 519 m_pComboFrameSize->addItem(""); /* User Defined */ 520 m_pComboFrameSize->addItem("320 x 200 (16:10)", QSize(320, 200)); 521 m_pComboFrameSize->addItem("640 x 480 (4:3)", QSize(640, 480)); 522 m_pComboFrameSize->addItem("720 x 400 (9:5)", QSize(720, 400)); 523 m_pComboFrameSize->addItem("720 x 480 (3:2)", QSize(720, 480)); 524 m_pComboFrameSize->addItem("800 x 600 (4:3)", QSize(800, 600)); 525 m_pComboFrameSize->addItem("1024 x 768 (4:3)", QSize(1024, 768)); 526 m_pComboFrameSize->addItem("1152 x 864 (4:3)", QSize(1152, 864)); 527 m_pComboFrameSize->addItem("1280 x 720 (16:9)", QSize(1280, 720)); 528 m_pComboFrameSize->addItem("1280 x 800 (16:10)", QSize(1280, 800)); 529 m_pComboFrameSize->addItem("1280 x 960 (4:3)", QSize(1280, 960)); 530 m_pComboFrameSize->addItem("1280 x 1024 (5:4)", QSize(1280, 1024)); 531 m_pComboFrameSize->addItem("1366 x 768 (16:9)", QSize(1366, 768)); 532 m_pComboFrameSize->addItem("1440 x 900 (16:10)", QSize(1440, 900)); 533 m_pComboFrameSize->addItem("1440 x 1080 (4:3)", QSize(1440, 1080)); 534 m_pComboFrameSize->addItem("1600 x 900 (16:9)", QSize(1600, 900)); 535 m_pComboFrameSize->addItem("1680 x 1050 (16:10)", QSize(1680, 1050)); 536 m_pComboFrameSize->addItem("1600 x 1200 (4:3)", QSize(1600, 1200)); 537 m_pComboFrameSize->addItem("1920 x 1080 (16:9)", QSize(1920, 1080)); 538 m_pComboFrameSize->addItem("1920 x 1200 (16:10)", QSize(1920, 1200)); 539 m_pComboFrameSize->addItem("1920 x 1440 (4:3)", QSize(1920, 1440)); 540 m_pComboFrameSize->addItem("2880 x 1800 (16:10)", QSize(2880, 1800)); 541 542 pLayoutSettings->addWidget(m_pComboFrameSize, 2, 1); 543 } 544 /* Prepare recording frame width spinbox: */ 545 m_pSpinboxFrameWidth = new QSpinBox(pWidgetSettings); 546 if (m_pSpinboxFrameWidth) 547 { 548 uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxFrameWidth, 5); 549 m_pSpinboxFrameWidth->setMinimum(16); 550 m_pSpinboxFrameWidth->setMaximum(2880); 551 552 pLayoutSettings->addWidget(m_pSpinboxFrameWidth, 2, 2); 553 } 554 /* Prepare recording frame height spinbox: */ 555 m_pSpinboxFrameHeight = new QSpinBox(pWidgetSettings); 556 if (m_pSpinboxFrameHeight) 557 { 558 uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxFrameHeight, 5); 559 m_pSpinboxFrameHeight->setMinimum(16); 560 m_pSpinboxFrameHeight->setMaximum(1800); 561 562 pLayoutSettings->addWidget(m_pSpinboxFrameHeight, 2, 3); 563 } 564 565 /* Prepare recording frame rate label: */ 566 m_pLabelFrameRate = new QLabel(pWidgetSettings); 567 if (m_pLabelFrameRate) 568 { 569 m_pLabelFrameRate->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 570 pLayoutSettings->addWidget(m_pLabelFrameRate, 3, 0); 571 } 572 /* Prepare recording frame rate widget: */ 573 m_pWidgetFrameRateSettings = new QWidget(pWidgetSettings); 574 if (m_pWidgetFrameRateSettings) 575 { 576 /* Prepare recording frame rate layout: */ 577 QVBoxLayout *pLayoutRecordingFrameRate = new QVBoxLayout(m_pWidgetFrameRateSettings); 578 if (pLayoutRecordingFrameRate) 579 { 580 pLayoutRecordingFrameRate->setContentsMargins(0, 0, 0, 0); 581 582 /* Prepare recording frame rate slider: */ 583 m_pSliderFrameRate = new QIAdvancedSlider(m_pWidgetFrameRateSettings); 584 if (m_pSliderFrameRate) 585 { 586 m_pSliderFrameRate->setOrientation(Qt::Horizontal); 587 m_pSliderFrameRate->setMinimum(1); 588 m_pSliderFrameRate->setMaximum(30); 589 m_pSliderFrameRate->setPageStep(1); 590 m_pSliderFrameRate->setSingleStep(1); 591 m_pSliderFrameRate->setTickInterval(1); 592 m_pSliderFrameRate->setSnappingEnabled(true); 593 m_pSliderFrameRate->setOptimalHint(1, 25); 594 m_pSliderFrameRate->setWarningHint(25, 30); 595 596 pLayoutRecordingFrameRate->addWidget(m_pSliderFrameRate); 597 } 598 /* Prepare recording frame rate scale layout: */ 599 QHBoxLayout *pLayoutRecordingFrameRateScale = new QHBoxLayout; 600 if (pLayoutRecordingFrameRateScale) 601 { 602 pLayoutRecordingFrameRateScale->setContentsMargins(0, 0, 0, 0); 603 604 /* Prepare recording frame rate min label: */ 605 m_pLabelFrameRateMin = new QLabel(m_pWidgetFrameRateSettings); 606 if (m_pLabelFrameRateMin) 607 pLayoutRecordingFrameRateScale->addWidget(m_pLabelFrameRateMin); 608 pLayoutRecordingFrameRateScale->addStretch(); 609 /* Prepare recording frame rate max label: */ 610 m_pLabelFrameRateMax = new QLabel(m_pWidgetFrameRateSettings); 611 if (m_pLabelFrameRateMax) 612 pLayoutRecordingFrameRateScale->addWidget(m_pLabelFrameRateMax); 613 614 pLayoutRecordingFrameRate->addLayout(pLayoutRecordingFrameRateScale); 615 } 616 } 617 618 pLayoutSettings->addWidget(m_pWidgetFrameRateSettings, 3, 1, 2, 1); 619 } 620 /* Prepare recording frame rate spinbox: */ 621 m_pSpinboxFrameRate = new QSpinBox(pWidgetSettings); 622 if (m_pSpinboxFrameRate) 623 { 624 if (m_pLabelFrameRate) 625 m_pLabelFrameRate->setBuddy(m_pSpinboxFrameRate); 626 uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxFrameRate, 3); 627 m_pSpinboxFrameRate->setMinimum(1); 628 m_pSpinboxFrameRate->setMaximum(30); 629 630 pLayoutSettings->addWidget(m_pSpinboxFrameRate, 3, 2, 1, 2); 631 } 632 633 /* Prepare recording video quality label: */ 634 m_pLabelVideoQuality = new QLabel(pWidgetSettings); 635 if (m_pLabelVideoQuality) 636 { 637 m_pLabelVideoQuality->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 638 pLayoutSettings->addWidget(m_pLabelVideoQuality, 5, 0); 639 } 640 /* Prepare recording video quality widget: */ 641 m_pWidgetVideoQualitySettings = new QWidget(pWidgetSettings); 642 if (m_pWidgetVideoQualitySettings) 643 { 644 /* Prepare recording video quality layout: */ 645 QVBoxLayout *pLayoutRecordingVideoQuality = new QVBoxLayout(m_pWidgetVideoQualitySettings); 646 if (pLayoutRecordingVideoQuality) 647 { 648 pLayoutRecordingVideoQuality->setContentsMargins(0, 0, 0, 0); 649 650 /* Prepare recording video quality slider: */ 651 m_pSliderVideoQuality = new QIAdvancedSlider(m_pWidgetVideoQualitySettings); 652 if (m_pSliderVideoQuality) 653 { 654 m_pSliderVideoQuality->setOrientation(Qt::Horizontal); 655 m_pSliderVideoQuality->setMinimum(1); 656 m_pSliderVideoQuality->setMaximum(10); 657 m_pSliderVideoQuality->setPageStep(1); 658 m_pSliderVideoQuality->setSingleStep(1); 659 m_pSliderVideoQuality->setTickInterval(1); 660 m_pSliderVideoQuality->setSnappingEnabled(true); 661 m_pSliderVideoQuality->setOptimalHint(1, 5); 662 m_pSliderVideoQuality->setWarningHint(5, 9); 663 m_pSliderVideoQuality->setErrorHint(9, 10); 664 665 pLayoutRecordingVideoQuality->addWidget(m_pSliderVideoQuality); 666 } 667 /* Prepare recording video quality scale layout: */ 668 QHBoxLayout *pLayoutRecordingVideoQialityScale = new QHBoxLayout; 669 if (pLayoutRecordingVideoQialityScale) 670 { 671 pLayoutRecordingVideoQialityScale->setContentsMargins(0, 0, 0, 0); 672 673 /* Prepare recording video quality min label: */ 674 m_pLabelVideoQualityMin = new QLabel(m_pWidgetVideoQualitySettings); 675 if (m_pLabelVideoQualityMin) 676 pLayoutRecordingVideoQialityScale->addWidget(m_pLabelVideoQualityMin); 677 pLayoutRecordingVideoQialityScale->addStretch(); 678 /* Prepare recording video quality med label: */ 679 m_pLabelVideoQualityMed = new QLabel(m_pWidgetVideoQualitySettings); 680 if (m_pLabelVideoQualityMed) 681 pLayoutRecordingVideoQialityScale->addWidget(m_pLabelVideoQualityMed); 682 pLayoutRecordingVideoQialityScale->addStretch(); 683 /* Prepare recording video quality max label: */ 684 m_pLabelVideoQualityMax = new QLabel(m_pWidgetVideoQualitySettings); 685 if (m_pLabelVideoQualityMax) 686 pLayoutRecordingVideoQialityScale->addWidget(m_pLabelVideoQualityMax); 687 688 pLayoutRecordingVideoQuality->addLayout(pLayoutRecordingVideoQialityScale); 689 } 690 } 691 692 pLayoutSettings->addWidget(m_pWidgetVideoQualitySettings, 5, 1, 2, 1); 693 } 694 /* Prepare recording video quality spinbox: */ 695 m_pSpinboxVideoQuality = new QSpinBox(pWidgetSettings); 696 if (m_pSpinboxVideoQuality) 697 { 698 if (m_pLabelVideoQuality) 699 m_pLabelVideoQuality->setBuddy(m_pSpinboxVideoQuality); 700 uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxVideoQuality, 5); 701 m_pSpinboxVideoQuality->setMinimum(VIDEO_CAPTURE_BIT_RATE_MIN); 702 m_pSpinboxVideoQuality->setMaximum(VIDEO_CAPTURE_BIT_RATE_MAX); 703 704 pLayoutSettings->addWidget(m_pSpinboxVideoQuality, 5, 2, 1, 2); 705 } 706 707 /* Prepare recording audio quality label: */ 708 m_pLabelAudioQuality = new QLabel(pWidgetSettings); 709 if (m_pLabelAudioQuality) 710 { 711 m_pLabelAudioQuality->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 712 pLayoutSettings->addWidget(m_pLabelAudioQuality, 7, 0); 713 } 714 /* Prepare recording audio quality widget: */ 715 m_pWidgetAudioQualitySettings = new QWidget(pWidgetSettings); 716 if (m_pWidgetAudioQualitySettings) 717 { 718 /* Prepare recording audio quality layout: */ 719 QVBoxLayout *pLayoutRecordingAudioQuality = new QVBoxLayout(m_pWidgetAudioQualitySettings); 720 if (pLayoutRecordingAudioQuality) 721 { 722 pLayoutRecordingAudioQuality->setContentsMargins(0, 0, 0, 0); 723 724 /* Prepare recording audio quality slider: */ 725 m_pSliderAudioQuality = new QIAdvancedSlider(m_pWidgetAudioQualitySettings); 726 if (m_pSliderAudioQuality) 727 { 728 if (m_pLabelAudioQuality) 729 m_pLabelAudioQuality->setBuddy(m_pSliderAudioQuality); 730 m_pSliderAudioQuality->setOrientation(Qt::Horizontal); 731 m_pSliderAudioQuality->setMinimum(1); 732 m_pSliderAudioQuality->setMaximum(3); 733 m_pSliderAudioQuality->setPageStep(1); 734 m_pSliderAudioQuality->setSingleStep(1); 735 m_pSliderAudioQuality->setTickInterval(1); 736 m_pSliderAudioQuality->setSnappingEnabled(true); 737 m_pSliderAudioQuality->setOptimalHint(1, 2); 738 m_pSliderAudioQuality->setWarningHint(2, 3); 739 740 pLayoutRecordingAudioQuality->addWidget(m_pSliderAudioQuality); 741 } 742 /* Prepare recording audio quality scale layout: */ 743 QHBoxLayout *pLayoutRecordingAudioQialityScale = new QHBoxLayout; 744 if (pLayoutRecordingAudioQialityScale) 745 { 746 pLayoutRecordingAudioQialityScale->setContentsMargins(0, 0, 0, 0); 747 748 /* Prepare recording audio quality min label: */ 749 m_pLabelAudioQualityMin = new QLabel(m_pWidgetAudioQualitySettings); 750 if (m_pLabelAudioQualityMin) 751 pLayoutRecordingAudioQialityScale->addWidget(m_pLabelAudioQualityMin); 752 pLayoutRecordingAudioQialityScale->addStretch(); 753 /* Prepare recording audio quality med label: */ 754 m_pLabelAudioQualityMed = new QLabel(m_pWidgetAudioQualitySettings); 755 if (m_pLabelAudioQualityMed) 756 pLayoutRecordingAudioQialityScale->addWidget(m_pLabelAudioQualityMed); 757 pLayoutRecordingAudioQialityScale->addStretch(); 758 /* Prepare recording audio quality max label: */ 759 m_pLabelAudioQualityMax = new QLabel(m_pWidgetAudioQualitySettings); 760 if (m_pLabelAudioQualityMax) 761 pLayoutRecordingAudioQialityScale->addWidget(m_pLabelAudioQualityMax); 762 763 pLayoutRecordingAudioQuality->addLayout(pLayoutRecordingAudioQialityScale); 764 } 765 } 766 767 pLayoutSettings->addWidget(m_pWidgetAudioQualitySettings, 7, 1, 2, 1); 768 } 769 770 /* Prepare recording size hint label: */ 771 m_pLabelSizeHint = new QLabel(pWidgetSettings); 772 if (m_pLabelSizeHint) 773 pLayoutSettings->addWidget(m_pLabelSizeHint, 9, 1); 774 775 /* Prepare recording screens label: */ 776 m_pLabelScreens = new QLabel(pWidgetSettings); 777 if (m_pLabelScreens) 778 { 779 m_pLabelScreens->setAlignment(Qt::AlignRight | Qt::AlignTop); 780 pLayoutSettings->addWidget(m_pLabelScreens, 10, 0); 781 } 782 /* Prepare recording screens scroller: */ 783 m_pScrollerScreens = new UIFilmContainer(pWidgetSettings); 784 if (m_pScrollerScreens) 785 { 786 if (m_pLabelScreens) 787 m_pLabelScreens->setBuddy(m_pScrollerScreens); 788 pLayoutSettings->addWidget(m_pScrollerScreens, 10, 1, 1, 3); 789 } 303 790 } 304 791 305 pLayout->addWidget( m_pWidgetSettings, 1, 1, 1, 2);792 pLayout->addWidget(pWidgetSettings, 1, 1, 1, 2); 306 793 } 307 794 } 308 795 309 796 /* Update widget availability: */ 310 if (m_pCheckboxFeature) 311 sltHandleFeatureToggled(m_pCheckboxFeature->isChecked()); 312 } 313 314 void UIVRDESettingsEditor::prepareConnections() 315 { 316 if (m_pCheckboxFeature) 317 connect(m_pCheckboxFeature, &QCheckBox::toggled, this, &UIVRDESettingsEditor::sltHandleFeatureToggled); 318 if (m_pEditorPort) 319 connect(m_pEditorPort, &QLineEdit::textChanged, this, &UIVRDESettingsEditor::sigChanged); 320 if (m_pEditorTimeout) 321 connect(m_pEditorTimeout, &QLineEdit::textChanged, this, &UIVRDESettingsEditor::sigChanged); 322 } 323 324 void UIVRDESettingsEditor::repopulateComboAuthType() 325 { 326 if (m_pComboAuthType) 327 { 328 /* Clear combo first of all: */ 329 m_pComboAuthType->clear(); 330 331 /// @todo get supported auth types (API not implemented), not hardcoded! 332 QVector<KAuthType> authTypes = QVector<KAuthType>() << KAuthType_Null 333 << KAuthType_External 334 << KAuthType_Guest; 335 336 /* Take into account currently cached value: */ 337 if (!authTypes.contains(m_enmAuthType)) 338 authTypes.prepend(m_enmAuthType); 339 340 /* Populate combo finally: */ 341 foreach (const KAuthType &enmType, authTypes) 342 m_pComboAuthType->addItem(gpConverter->toString(enmType), QVariant::fromValue(enmType)); 343 344 /* Look for proper index to choose: */ 345 const int iIndex = m_pComboAuthType->findData(QVariant::fromValue(m_enmAuthType)); 346 if (iIndex != -1) 347 m_pComboAuthType->setCurrentIndex(iIndex); 348 } 349 } 797 updateWidgetAvailability(); 798 } 799 800 void UIRecordingSettingsEditor::prepareConnections() 801 { 802 connect(m_pCheckboxFeature, &QCheckBox::toggled, 803 this, &UIRecordingSettingsEditor::sltHandleFeatureToggled); 804 connect(m_pComboMode, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 805 this, &UIRecordingSettingsEditor::sltHandleModeComboChange); 806 connect(m_pComboFrameSize, static_cast<void(QComboBox::*)(int)>(&QComboBox:: currentIndexChanged), 807 this, &UIRecordingSettingsEditor::sltHandleVideoFrameSizeComboChange); 808 connect(m_pSpinboxFrameWidth, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 809 this, &UIRecordingSettingsEditor::sltHandleVideoFrameWidthChange); 810 connect(m_pSpinboxFrameHeight, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 811 this, &UIRecordingSettingsEditor::sltHandleVideoFrameHeightChange); 812 connect(m_pSliderFrameRate, &QIAdvancedSlider::valueChanged, 813 this, &UIRecordingSettingsEditor::sltHandleVideoFrameRateSliderChange); 814 connect(m_pSpinboxFrameRate, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 815 this, &UIRecordingSettingsEditor::sltHandleVideoFrameRateSpinboxChange); 816 connect(m_pSliderVideoQuality, &QIAdvancedSlider::valueChanged, 817 this, &UIRecordingSettingsEditor::sltHandleVideoBitRateSliderChange); 818 connect(m_pSpinboxVideoQuality, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 819 this, &UIRecordingSettingsEditor::sltHandleVideoBitRateSpinboxChange); 820 } 821 822 void UIRecordingSettingsEditor::updateWidgetAvailability() 823 { 824 const bool fFeatureEnabled = m_pCheckboxFeature->isChecked(); 825 const UISettingsDefs::RecordingMode enmRecordingMode = 826 m_pComboMode->currentData().value<UISettingsDefs::RecordingMode>(); 827 const bool fRecordVideo = enmRecordingMode == UISettingsDefs::RecordingMode_VideoOnly 828 || enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio; 829 const bool fRecordAudio = enmRecordingMode == UISettingsDefs::RecordingMode_AudioOnly 830 || enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio; 831 832 m_pLabelMode->setEnabled(fFeatureEnabled && m_fOptionsAvailable); 833 m_pComboMode->setEnabled(fFeatureEnabled && m_fOptionsAvailable); 834 m_pLabelFilePath->setEnabled(fFeatureEnabled && m_fOptionsAvailable); 835 m_pEditorFilePath->setEnabled(fFeatureEnabled && m_fOptionsAvailable); 836 837 m_pLabelFrameSize->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 838 m_pComboFrameSize->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 839 m_pSpinboxFrameWidth->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 840 m_pSpinboxFrameHeight->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 841 842 m_pLabelFrameRate->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 843 m_pWidgetFrameRateSettings->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 844 m_pSpinboxFrameRate->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 845 846 m_pLabelVideoQuality->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 847 m_pWidgetVideoQualitySettings->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 848 m_pSpinboxVideoQuality->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 849 850 m_pLabelAudioQuality->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordAudio); 851 m_pWidgetAudioQualitySettings->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordAudio); 852 853 m_pLabelSizeHint->setEnabled(fFeatureEnabled && m_fOptionsAvailable && fRecordVideo); 854 855 m_pLabelScreens->setEnabled(fFeatureEnabled && m_fScreenOptionsAvailable && fRecordVideo); 856 m_pScrollerScreens->setEnabled(fFeatureEnabled && m_fScreenOptionsAvailable && fRecordVideo); 857 } 858 859 void UIRecordingSettingsEditor::updateRecordingFileSizeHint() 860 { 861 m_pLabelSizeHint->setText(tr("<i>About %1MB per 5 minute video</i>") 862 .arg(m_pSpinboxVideoQuality->value() * 300 / 8 / 1024)); 863 } 864 865 void UIRecordingSettingsEditor::lookForCorrespondingFrameSizePreset() 866 { 867 lookForCorrespondingPreset(m_pComboFrameSize, 868 QSize(m_pSpinboxFrameWidth->value(), 869 m_pSpinboxFrameHeight->value())); 870 } 871 872 /* static */ 873 void UIRecordingSettingsEditor::lookForCorrespondingPreset(QComboBox *pComboBox, const QVariant &data) 874 { 875 /* Use passed iterator to look for corresponding preset of passed combo-box: */ 876 const int iLookupResult = pComboBox->findData(data); 877 if (iLookupResult != -1 && pComboBox->currentIndex() != iLookupResult) 878 pComboBox->setCurrentIndex(iLookupResult); 879 else if (iLookupResult == -1 && pComboBox->currentIndex() != 0) 880 pComboBox->setCurrentIndex(0); 881 } 882 883 /* static */ 884 int UIRecordingSettingsEditor::calculateBitRate(int iFrameWidth, int iFrameHeight, int iFrameRate, int iQuality) 885 { 886 /* Linear quality<=>bit-rate scale-factor: */ 887 const double dResult = (double)iQuality 888 * (double)iFrameWidth * (double)iFrameHeight * (double)iFrameRate 889 / (double)10 /* translate quality to [%] */ 890 / (double)1024 /* translate bit-rate to [kbps] */ 891 / (double)18.75 /* linear scale factor */; 892 return (int)dResult; 893 } 894 895 /* static */ 896 int UIRecordingSettingsEditor::calculateQuality(int iFrameWidth, int iFrameHeight, int iFrameRate, int iBitRate) 897 { 898 /* Linear bit-rate<=>quality scale-factor: */ 899 const double dResult = (double)iBitRate 900 / (double)iFrameWidth / (double)iFrameHeight / (double)iFrameRate 901 * (double)10 /* translate quality to [%] */ 902 * (double)1024 /* translate bit-rate to [kbps] */ 903 * (double)18.75 /* linear scale factor */; 904 return (int)dResult; 905 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIRecordingSettingsEditor.h
r94435 r94436 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI VRDESettingsEditor class declaration.3 * VBox Qt GUI - UIRecordingSettingsEditor class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UI VRDESettingsEditor_h19 #define FEQT_INCLUDED_SRC_settings_editors_UI VRDESettingsEditor_h18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UIRecordingSettingsEditor_h 19 #define FEQT_INCLUDED_SRC_settings_editors_UIRecordingSettingsEditor_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 24 24 /* GUI includes: */ 25 25 #include "QIWithRetranslateUI.h" 26 #include "UISettingsDefs.h" 26 27 27 28 /* COM includes: */ 28 29 #include "COMEnums.h" 30 31 /* Other VBox includes: */ 32 #include <VBox/com/com.h> 29 33 30 34 /* Forward declarations: */ … … 32 36 class QComboBox; 33 37 class QLabel; 34 class Q LineEdit;38 class QSpinBox; 35 39 class QWidget; 36 37 /** QWidget subclass used as a VRDE settings editor. */ 38 class SHARED_LIBRARY_STUFF UIVRDESettingsEditor : public QIWithRetranslateUI<QWidget> 40 class QIAdvancedSlider; 41 class UIFilePathSelector; 42 class UIFilmContainer; 43 44 /** QWidget subclass used as a recording settings editor. */ 45 class SHARED_LIBRARY_STUFF UIRecordingSettingsEditor : public QIWithRetranslateUI<QWidget> 39 46 { 40 47 Q_OBJECT; 41 48 42 signals:43 44 /** Notify listeners about some status changed. */45 void sigChanged();46 47 49 public: 48 50 49 51 /** Constructs editor passing @a pParent to the base-class. */ 50 UI VRDESettingsEditor(QWidget *pParent = 0);52 UIRecordingSettingsEditor(QWidget *pParent = 0); 51 53 52 54 /** Defines whether feature is @a fEnabled. */ … … 55 57 bool isFeatureEnabled() const; 56 58 57 /** Defines whether VRDE options are @a fAvailable. */ 58 void setVRDEOptionsAvailable(bool fAvailable); 59 60 /** Defines @a strPort. */ 61 void setPort(const QString &strPort); 62 /** Returns port. */ 63 QString port() const; 64 65 /** Defines auth @a enmType. */ 66 void setAuthType(const KAuthType &enmType); 67 /** Returns auth type. */ 68 KAuthType authType() const; 69 70 /** Defines @a strTimeout. */ 71 void setTimeout(const QString &strTimeout); 72 /** Returns timeout. */ 73 QString timeout() const; 74 75 /** Defines whether multiple connections @a fAllowed. */ 76 void setMultipleConnectionsAllowed(bool fAllowed); 77 /** Returns whether multiple connections allowed. */ 78 bool isMultipleConnectionsAllowed() const; 59 /** Defines whether options are @a fAvailable. */ 60 void setOptionsAvailable(bool fAvailable); 61 /** Defines whether screen options are @a fAvailable. */ 62 void setScreenOptionsAvailable(bool fAvailable); 63 64 /** Defines @a enmMode. */ 65 void setMode(UISettingsDefs::RecordingMode enmMode); 66 /** Return mode. */ 67 UISettingsDefs::RecordingMode mode() const; 68 69 /** Defines @a strFolder. */ 70 void setFolder(const QString &strFolder); 71 /** Returns folder. */ 72 QString folder() const; 73 /** Defines @a strFilePath. */ 74 void setFilePath(const QString &strFilePath); 75 /** Returns file path. */ 76 QString filePath() const; 77 78 /** Defines frame @a iWidth. */ 79 void setFrameWidth(int iWidth); 80 /** Returns frame width. */ 81 int frameWidth() const; 82 /** Defines frame @a iHeight. */ 83 void setFrameHeight(int iHeight); 84 /** Returns frame height. */ 85 int frameHeight() const; 86 87 /** Defines frame @a iRate. */ 88 void setFrameRate(int iRate); 89 /** Returns frame rate. */ 90 int frameRate() const; 91 92 /** Defines bit @a iRate. */ 93 void setBitRate(int iRate); 94 /** Returns bit rate. */ 95 int bitRate() const; 96 97 /** Defines audio quality @a iRate. */ 98 void setAudioQualityRate(int iRate); 99 /** Returns audio quality rate. */ 100 int audioQualityRate() const; 101 102 /** Defines enabled @a screens. */ 103 void setScreens(const QVector<BOOL> &screens); 104 /** Returns enabled screens. */ 105 QVector<BOOL> screens() const; 79 106 80 107 protected: … … 85 112 private slots: 86 113 87 /** Handles whether VRDE is @a fEnabled. */ 88 void sltHandleFeatureToggled(bool fEnabled); 114 /** Handles feature toggling. */ 115 void sltHandleFeatureToggled(); 116 /** Handles mode change. */ 117 void sltHandleModeComboChange(); 118 /** Handles frame size change. */ 119 void sltHandleVideoFrameSizeComboChange(); 120 /** Handles frame width change. */ 121 void sltHandleVideoFrameWidthChange(); 122 /** Handles frame height change. */ 123 void sltHandleVideoFrameHeightChange(); 124 /** Handles frame rate slider change. */ 125 void sltHandleVideoFrameRateSliderChange(); 126 /** Handles frame rate spinbox change. */ 127 void sltHandleVideoFrameRateSpinboxChange(); 128 /** Handles bit-rate slider change. */ 129 void sltHandleVideoBitRateSliderChange(); 130 /** Handles bit-rate spinbox change. */ 131 void sltHandleVideoBitRateSpinboxChange(); 89 132 90 133 private: … … 100 143 void repopulateComboAuthType(); 101 144 145 /** Updates widget availability. */ 146 void updateWidgetAvailability(); 147 /** Updates recording file size hint. */ 148 void updateRecordingFileSizeHint(); 149 /** Searches for corresponding frame size preset. */ 150 void lookForCorrespondingFrameSizePreset(); 151 152 /** Searches for the @a data field in corresponding @a pComboBox. */ 153 static void lookForCorrespondingPreset(QComboBox *pComboBox, const QVariant &data); 154 /** Calculates recording video bit-rate for passed @a iFrameWidth, @a iFrameHeight, @a iFrameRate and @a iQuality. */ 155 static int calculateBitRate(int iFrameWidth, int iFrameHeight, int iFrameRate, int iQuality); 156 /** Calculates recording video quality for passed @a iFrameWidth, @a iFrameHeight, @a iFrameRate and @a iBitRate. */ 157 static int calculateQuality(int iFrameWidth, int iFrameHeight, int iFrameRate, int iBitRate); 158 102 159 /** @name Values 103 160 * @{ */ 104 161 /** Holds whether feature is enabled. */ 105 bool m_fFeatureEnabled; 106 /** Holds the port. */ 107 QString m_strPort; 108 /** Holds the auth type. */ 109 KAuthType m_enmAuthType; 110 /** Holds the timeout. */ 111 QString m_strTimeout; 112 /** Returns whether multiple connections allowed. */ 113 bool m_fMultipleConnectionsAllowed; 162 bool m_fFeatureEnabled; 163 /** Holds whether options are available. */ 164 bool m_fOptionsAvailable; 165 /** Holds whether screen options are available. */ 166 bool m_fScreenOptionsAvailable; 167 /** Holds the mode. */ 168 UISettingsDefs::RecordingMode m_enmMode; 169 /** Holds the folder. */ 170 QString m_strFolder; 171 /** Holds the file path. */ 172 QString m_strFilePath; 173 /** Holds the frame width. */ 174 int m_iFrameWidth; 175 /** Holds the frame height. */ 176 int m_iFrameHeight; 177 /** Holds the frame rate. */ 178 int m_iFrameRate; 179 /** Holds the bit rate. */ 180 int m_iBitRate; 181 /** Holds the audio quality rate. */ 182 int m_iAudioQualityRate; 183 /** Holds the screens. */ 184 QVector<BOOL> m_screens; 114 185 /** @} */ 115 186 … … 117 188 * @{ */ 118 189 /** Holds the feature check-box instance. */ 119 QCheckBox *m_pCheckboxFeature; 120 /** Holds the settings widget instance. */ 121 QWidget *m_pWidgetSettings; 122 /** Holds the port label instance. */ 123 QLabel *m_pLabelPort; 124 /** Holds the port editor instance. */ 125 QLineEdit *m_pEditorPort; 126 /** Holds the port auth method label instance. */ 127 QLabel *m_pLabelAuthMethod; 128 /** Holds the port auth method combo instance. */ 129 QComboBox *m_pComboAuthType; 130 /** Holds the timeout label instance. */ 131 QLabel *m_pLabelTimeout; 132 /** Holds the timeout editor instance. */ 133 QLineEdit *m_pEditorTimeout; 134 /** Holds the options label instance. */ 135 QLabel *m_pLabelOptions; 136 /** Holds the multiple connection check-box instance. */ 137 QCheckBox *m_pCheckboxMultipleConnections; 190 QCheckBox *m_pCheckboxFeature; 191 /** Holds the mode label instance. */ 192 QLabel *m_pLabelMode; 193 /** Holds the mode combo instance. */ 194 QComboBox *m_pComboMode; 195 /** Holds the file path label instance. */ 196 QLabel *m_pLabelFilePath; 197 /** Holds the file path editor instance. */ 198 UIFilePathSelector *m_pEditorFilePath; 199 /** Holds the frame size label instance. */ 200 QLabel *m_pLabelFrameSize; 201 /** Holds the frame size combo instance. */ 202 QComboBox *m_pComboFrameSize; 203 /** Holds the frame width spinbox instance. */ 204 QSpinBox *m_pSpinboxFrameWidth; 205 /** Holds the frame height spinbox instance. */ 206 QSpinBox *m_pSpinboxFrameHeight; 207 /** Holds the frame rate label instance. */ 208 QLabel *m_pLabelFrameRate; 209 /** Holds the frame rate settings widget instance. */ 210 QWidget *m_pWidgetFrameRateSettings; 211 /** Holds the frame rate slider instance. */ 212 QIAdvancedSlider *m_pSliderFrameRate; 213 /** Holds the frame rate spinbox instance. */ 214 QSpinBox *m_pSpinboxFrameRate; 215 /** Holds the frame rate min label instance. */ 216 QLabel *m_pLabelFrameRateMin; 217 /** Holds the frame rate max label instance. */ 218 QLabel *m_pLabelFrameRateMax; 219 /** Holds the video quality label instance. */ 220 QLabel *m_pLabelVideoQuality; 221 /** Holds the video quality settings widget instance. */ 222 QWidget *m_pWidgetVideoQualitySettings; 223 /** Holds the video quality slider instance. */ 224 QIAdvancedSlider *m_pSliderVideoQuality; 225 /** Holds the video quality spinbox instance. */ 226 QSpinBox *m_pSpinboxVideoQuality; 227 /** Holds the video quality min label instance. */ 228 QLabel *m_pLabelVideoQualityMin; 229 /** Holds the video quality med label instance. */ 230 QLabel *m_pLabelVideoQualityMed; 231 /** Holds the video quality max label instance. */ 232 QLabel *m_pLabelVideoQualityMax; 233 /** Holds the audio quality label instance. */ 234 QLabel *m_pLabelAudioQuality; 235 /** Holds the audio quality settings widget instance. */ 236 QWidget *m_pWidgetAudioQualitySettings; 237 /** Holds the audio quality slider instance. */ 238 QIAdvancedSlider *m_pSliderAudioQuality; 239 /** Holds the audio quality min label instance. */ 240 QLabel *m_pLabelAudioQualityMin; 241 /** Holds the audio quality med label instance. */ 242 QLabel *m_pLabelAudioQualityMed; 243 /** Holds the audio quality max label instance. */ 244 QLabel *m_pLabelAudioQualityMax; 245 /** Holds the size hint label instance. */ 246 QLabel *m_pLabelSizeHint; 247 /** Holds the screens label instance. */ 248 QLabel *m_pLabelScreens; 249 /** Holds the screens scroller instance. */ 250 UIFilmContainer *m_pScrollerScreens; 138 251 /** @} */ 139 252 }; 140 253 141 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UI VRDESettingsEditor_h */254 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UIRecordingSettingsEditor_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r94378 r94436 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox>20 #include <QComboBox>21 19 #include <QFileInfo> 22 #include <QGridLayout> 23 #include <QLabel> 24 #include <QLineEdit> 25 #include <QRegularExpressionValidator> 26 #include <QSpinBox> 27 #include <QStackedLayout> 20 #include <QVBoxLayout> 28 21 29 22 /* GUI includes: */ 30 #include "QIAdvancedSlider.h"31 23 #include "QITabWidget.h" 32 #include "QIWidgetValidator.h"33 24 #include "UICommon.h" 34 25 #include "UIConverter.h" 35 26 #include "UIErrorString.h" 36 27 #include "UIExtraDataManager.h" 37 #include "UIFilePathSelector.h"38 #include "UIFilmContainer.h"39 28 #include "UIGraphicsControllerEditor.h" 40 29 #ifdef VBOX_WITH_3D_ACCELERATION … … 43 32 #include "UIMachineSettingsDisplay.h" 44 33 #include "UIMonitorCountEditor.h" 34 #include "UIRecordingSettingsEditor.h" 45 35 #include "UIScaleFactorEditor.h" 46 36 #include "UITranslator.h" … … 49 39 50 40 /* COM includes: */ 41 #include "CExtPackManager.h" 51 42 #include "CGraphicsAdapter.h" 43 #include "CRecordingScreenSettings.h" 52 44 #include "CRecordingSettings.h" 53 #include "CRecordingScreenSettings.h"54 #include "CExtPack.h"55 #include "CExtPackManager.h"56 45 #include "CVRDEServer.h" 57 58 59 #define VIDEO_CAPTURE_BIT_RATE_MIN 3260 #define VIDEO_CAPTURE_BIT_RATE_MAX 204861 46 62 47 … … 317 302 , m_pEditorVRDESettings(0) 318 303 , m_pTabRecording(0) 319 , m_pCheckboxRecording(0)320 , m_pWidgetRecordingSettings(0)321 , m_pLabelRecordingMode(0)322 , m_pComboRecordingMode(0)323 , m_pLabelRecordingFilePath(0)324 , m_pEditorRecordingFilePath(0)325 , m_pLabelRecordingFrameSize(0)326 , m_pComboRecordingFrameSize(0)327 , m_pSpinboxRecordingFrameWidth(0)328 , m_pSpinboxRecordingFrameHeight(0)329 , m_pLabelRecordingFrameRate(0)330 , m_pWidgetRecordingFrameRateSettings(0)331 , m_pSliderRecordingFrameRate(0)332 , m_pSpinboxRecordingFrameRate(0)333 , m_pLabelRecordingFrameRateMin(0)334 , m_pLabelRecordingFrameRateMax(0)335 , m_pLabelRecordingVideoQuality(0)336 , m_pWidgetRecordingVideoQualitySettings(0)337 , m_pSliderRecordingVideoQuality(0)338 , m_pSpinboxRecordingVideoQuality(0)339 , m_pLabelRecordingVideoQualityMin(0)340 , m_pLabelRecordingVideoQualityMed(0)341 , m_pLabelRecordingVideoQualityMax(0)342 , m_pLabelRecordingAudioQuality(0)343 , m_pWidgetRecordingAudioQualitySettings(0)344 , m_pSliderRecordingAudioQuality(0)345 , m_pLabelRecordingAudioQualityMin(0)346 , m_pLabelRecordingAudioQualityMed(0)347 , m_pLabelRecordingAudioQualityMax(0)348 , m_pLabelRecordingSizeHint(0)349 , m_pLabelRecordingScreens(0)350 , m_pScrollerRecordingScreens(0)351 304 { 352 305 prepare(); … … 373 326 m_fWddmModeSupported = UICommon::isWddmCompatibleOsType(strGuestOSTypeId); 374 327 m_pEditorVideoMemorySize->set3DAccelerationSupported(m_fWddmModeSupported); 375 #endif 328 #endif /* VBOX_WITH_3D_ACCELERATION */ 376 329 /* Acquire recommended graphics controller type: */ 377 330 m_enmGraphicsControllerTypeRecommended = m_comGuestOSType.GetRecommendedGraphicsController(); … … 449 402 450 403 /* For now we're using the same settings for all screens; so get settings from screen 0 and work with that. */ 451 CRecordingScreenSettings recordingScreen0Settings = recordingSettings.GetScreenSettings(0);452 if (! recordingScreen0Settings.isNull())404 CRecordingScreenSettings comRecordingScreen0Settings = recordingSettings.GetScreenSettings(0); 405 if (!comRecordingScreen0Settings.isNull()) 453 406 { 454 407 oldDisplayData.m_strRecordingFolder = QFileInfo(m_machine.GetSettingsFilePath()).absolutePath(); 455 oldDisplayData.m_strRecordingFilePath = recordingScreen0Settings.GetFilename();456 oldDisplayData.m_iRecordingVideoFrameWidth = recordingScreen0Settings.GetVideoWidth();457 oldDisplayData.m_iRecordingVideoFrameHeight = recordingScreen0Settings.GetVideoHeight();458 oldDisplayData.m_iRecordingVideoFrameRate = recordingScreen0Settings.GetVideoFPS();459 oldDisplayData.m_iRecordingVideoBitRate = recordingScreen0Settings.GetVideoRate();460 oldDisplayData.m_strRecordingVideoOptions = recordingScreen0Settings.GetOptions();461 } 462 463 CRecordingScreenSettingsVector recordingScreenSettingsVector = recordingSettings.GetScreens();464 oldDisplayData.m_vecRecordingScreens.resize( recordingScreenSettingsVector.size());465 for (int iScreenIndex = 0; iScreenIndex < recordingScreenSettingsVector.size(); ++iScreenIndex)466 { 467 CRecordingScreenSettings recordingScreenSettings = recordingScreenSettingsVector.at(iScreenIndex);468 if (! recordingScreenSettings.isNull())469 oldDisplayData.m_vecRecordingScreens[iScreenIndex] = recordingScreenSettings.GetEnabled();408 oldDisplayData.m_strRecordingFilePath = comRecordingScreen0Settings.GetFilename(); 409 oldDisplayData.m_iRecordingVideoFrameWidth = comRecordingScreen0Settings.GetVideoWidth(); 410 oldDisplayData.m_iRecordingVideoFrameHeight = comRecordingScreen0Settings.GetVideoHeight(); 411 oldDisplayData.m_iRecordingVideoFrameRate = comRecordingScreen0Settings.GetVideoFPS(); 412 oldDisplayData.m_iRecordingVideoBitRate = comRecordingScreen0Settings.GetVideoRate(); 413 oldDisplayData.m_strRecordingVideoOptions = comRecordingScreen0Settings.GetOptions(); 414 } 415 416 CRecordingScreenSettingsVector comRecordingScreenSettingsVector = recordingSettings.GetScreens(); 417 oldDisplayData.m_vecRecordingScreens.resize(comRecordingScreenSettingsVector.size()); 418 for (int iScreenIndex = 0; iScreenIndex < comRecordingScreenSettingsVector.size(); ++iScreenIndex) 419 { 420 CRecordingScreenSettings comRecordingScreenSettings = comRecordingScreenSettingsVector.at(iScreenIndex); 421 if (!comRecordingScreenSettings.isNull()) 422 oldDisplayData.m_vecRecordingScreens[iScreenIndex] = comRecordingScreenSettings.GetEnabled(); 470 423 } 471 424 … … 511 464 512 465 /* Load old 'Recording' data from cache: */ 513 m_pCheckboxRecording->setChecked(oldDisplayData.m_fRecordingEnabled); 514 m_pEditorRecordingFilePath->setInitialPath(oldDisplayData.m_strRecordingFolder); 515 m_pEditorRecordingFilePath->setPath(oldDisplayData.m_strRecordingFilePath); 516 m_pSpinboxRecordingFrameWidth->setValue(oldDisplayData.m_iRecordingVideoFrameWidth); 517 m_pSpinboxRecordingFrameHeight->setValue(oldDisplayData.m_iRecordingVideoFrameHeight); 518 m_pSpinboxRecordingFrameRate->setValue(oldDisplayData.m_iRecordingVideoFrameRate); 519 m_pSpinboxRecordingVideoQuality->setValue(oldDisplayData.m_iRecordingVideoBitRate); 520 m_pScrollerRecordingScreens->setValue(oldDisplayData.m_vecRecordingScreens); 521 522 /* Load data from old 'Recording option': */ 523 bool fRecordAudio = UIDataSettingsMachineDisplay::isRecordingOptionEnabled(oldDisplayData.m_strRecordingVideoOptions, 524 UIDataSettingsMachineDisplay::RecordingOption_AC); 525 bool fRecordVideo = UIDataSettingsMachineDisplay::isRecordingOptionEnabled(oldDisplayData.m_strRecordingVideoOptions, 526 UIDataSettingsMachineDisplay::RecordingOption_VC); 466 m_pEditorRecordingSettings->setFeatureEnabled(oldDisplayData.m_fRecordingEnabled); 467 m_pEditorRecordingSettings->setFolder(oldDisplayData.m_strRecordingFolder); 468 m_pEditorRecordingSettings->setFilePath(oldDisplayData.m_strRecordingFilePath); 469 m_pEditorRecordingSettings->setFrameWidth(oldDisplayData.m_iRecordingVideoFrameWidth); 470 m_pEditorRecordingSettings->setFrameHeight(oldDisplayData.m_iRecordingVideoFrameHeight); 471 m_pEditorRecordingSettings->setFrameRate(oldDisplayData.m_iRecordingVideoFrameRate); 472 m_pEditorRecordingSettings->setBitRate(oldDisplayData.m_iRecordingVideoBitRate); 473 m_pEditorRecordingSettings->setScreens(oldDisplayData.m_vecRecordingScreens); 474 475 /* Load old 'Recording' options: */ 476 const bool fRecordVideo = 477 UIDataSettingsMachineDisplay::isRecordingOptionEnabled(oldDisplayData.m_strRecordingVideoOptions, 478 UIDataSettingsMachineDisplay::RecordingOption_VC); 479 const bool fRecordAudio = 480 UIDataSettingsMachineDisplay::isRecordingOptionEnabled(oldDisplayData.m_strRecordingVideoOptions, 481 UIDataSettingsMachineDisplay::RecordingOption_AC); 482 UISettingsDefs::RecordingMode enmMode; 527 483 if (fRecordAudio && fRecordVideo) 528 m_pComboRecordingMode->setCurrentIndex(m_pComboRecordingMode->findText(gpConverter->toString(UISettingsDefs::RecordingMode_VideoAudio)));484 enmMode = UISettingsDefs::RecordingMode_VideoAudio; 529 485 else if (fRecordAudio && !fRecordVideo) 530 m_pComboRecordingMode->setCurrentIndex(m_pComboRecordingMode->findText(gpConverter->toString(UISettingsDefs::RecordingMode_AudioOnly)));486 enmMode = UISettingsDefs::RecordingMode_AudioOnly; 531 487 else 532 m_pComboRecordingMode->setCurrentIndex(m_pComboRecordingMode->findText(gpConverter->toString(UISettingsDefs::RecordingMode_VideoOnly))); 533 534 m_pSliderRecordingAudioQuality->setValue(UIDataSettingsMachineDisplay::getAudioQualityFromOptions(oldDisplayData.m_strRecordingVideoOptions)); 488 enmMode = UISettingsDefs::RecordingMode_VideoOnly; 489 m_pEditorRecordingSettings->setMode(enmMode); 490 const int iAudioQualityRate = 491 UIDataSettingsMachineDisplay::getAudioQualityFromOptions(oldDisplayData.m_strRecordingVideoOptions); 492 m_pEditorRecordingSettings->setAudioQualityRate(iAudioQualityRate); 535 493 536 494 /* Polish page finally: */ … … 567 525 568 526 /* Gather new 'Recording' data: */ 569 newDisplayData.m_fRecordingEnabled = m_pCheckboxRecording->isChecked(); 570 newDisplayData.m_strRecordingFolder = m_pCache->base().m_strRecordingFolder; 571 newDisplayData.m_strRecordingFilePath = m_pEditorRecordingFilePath->path(); 572 newDisplayData.m_iRecordingVideoFrameWidth = m_pSpinboxRecordingFrameWidth->value(); 573 newDisplayData.m_iRecordingVideoFrameHeight = m_pSpinboxRecordingFrameHeight->value(); 574 newDisplayData.m_iRecordingVideoFrameRate = m_pSpinboxRecordingFrameRate->value(); 575 newDisplayData.m_iRecordingVideoBitRate = m_pSpinboxRecordingVideoQuality->value(); 576 newDisplayData.m_vecRecordingScreens = m_pScrollerRecordingScreens->value(); 577 578 /* Update recording options */ 579 const UISettingsDefs::RecordingMode enmRecordingMode = 580 gpConverter->fromString<UISettingsDefs::RecordingMode>(m_pComboRecordingMode->currentText()); 527 newDisplayData.m_fRecordingEnabled = m_pEditorRecordingSettings->isFeatureEnabled(); 528 newDisplayData.m_strRecordingFolder = m_pEditorRecordingSettings->folder(); 529 newDisplayData.m_strRecordingFilePath = m_pEditorRecordingSettings->filePath(); 530 newDisplayData.m_iRecordingVideoFrameWidth = m_pEditorRecordingSettings->frameWidth(); 531 newDisplayData.m_iRecordingVideoFrameHeight = m_pEditorRecordingSettings->frameHeight(); 532 newDisplayData.m_iRecordingVideoFrameRate = m_pEditorRecordingSettings->frameRate(); 533 newDisplayData.m_iRecordingVideoBitRate = m_pEditorRecordingSettings->bitRate(); 534 newDisplayData.m_vecRecordingScreens = m_pEditorRecordingSettings->screens(); 535 536 /* Gather new 'Recording' options: */ 537 const UISettingsDefs::RecordingMode enmRecordingMode = m_pEditorRecordingSettings->mode(); 581 538 QStringList optionValues; 582 /* Option value for video recording: */ 583 optionValues.push_back( (enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio) 584 || (enmRecordingMode == UISettingsDefs::RecordingMode_VideoOnly) 585 ? "true" : "false"); 586 /* Option value for audio recording: */ 587 optionValues.push_back( (enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio) 588 || (enmRecordingMode == UISettingsDefs::RecordingMode_AudioOnly) 589 ? "true" : "false"); 590 591 if (m_pSliderRecordingAudioQuality->value() == 1) 592 optionValues.push_back("low"); 593 else if (m_pSliderRecordingAudioQuality->value() == 2) 594 optionValues.push_back("med"); 595 else 596 optionValues.push_back("high"); 597 598 QVector<UIDataSettingsMachineDisplay::RecordingOption> recordingOptionsVector; 599 recordingOptionsVector.push_back(UIDataSettingsMachineDisplay::RecordingOption_VC); 600 recordingOptionsVector.push_back(UIDataSettingsMachineDisplay::RecordingOption_AC); 601 recordingOptionsVector.push_back(UIDataSettingsMachineDisplay::RecordingOption_AC_Profile); 602 603 newDisplayData.m_strRecordingVideoOptions = UIDataSettingsMachineDisplay::setRecordingOptions(m_pCache->base().m_strRecordingVideoOptions, 604 recordingOptionsVector, 605 optionValues); 539 optionValues.append( (enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio) 540 || (enmRecordingMode == UISettingsDefs::RecordingMode_VideoOnly) 541 ? "true" : "false"); 542 optionValues.append( (enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio) 543 || (enmRecordingMode == UISettingsDefs::RecordingMode_AudioOnly) 544 ? "true" : "false"); 545 switch (m_pEditorRecordingSettings->audioQualityRate()) 546 { 547 case 1: optionValues.append("low"); break; 548 case 2: optionValues.append("med"); break; 549 default: optionValues.append("high"); break; 550 } 551 QVector<UIDataSettingsMachineDisplay::RecordingOption> optionKeys; 552 optionKeys.append(UIDataSettingsMachineDisplay::RecordingOption_VC); 553 optionKeys.append(UIDataSettingsMachineDisplay::RecordingOption_AC); 554 optionKeys.append(UIDataSettingsMachineDisplay::RecordingOption_AC_Profile); 555 newDisplayData.m_strRecordingVideoOptions = 556 UIDataSettingsMachineDisplay::setRecordingOptions(m_pCache->base().m_strRecordingVideoOptions, 557 optionKeys, optionValues); 606 558 607 559 /* Cache new display data: */ … … 699 651 { 700 652 message.second << tr("Remote Display is currently enabled for this virtual machine. " 701 "However, this requires the <i>%1</i> to be installed. "702 "Please install the Extension Pack from the VirtualBox download site as "703 "otherwise your VM will be started with Remote Display disabled.")704 .arg(GUI_ExtPackName);653 "However, this requires the <i>%1</i> to be installed. " 654 "Please install the Extension Pack from the VirtualBox download site as " 655 "otherwise your VM will be started with Remote Display disabled.") 656 .arg(GUI_ExtPackName); 705 657 } 706 658 } … … 745 697 746 698 /* Remote Display tab-order: */ 747 setTabOrder(m_pEditorVRDESettings, m_pCheckboxRecording); 748 749 /* Recording tab-order: */ 750 setTabOrder(m_pCheckboxRecording, m_pEditorRecordingFilePath); 751 setTabOrder(m_pEditorRecordingFilePath, m_pComboRecordingFrameSize); 752 setTabOrder(m_pComboRecordingFrameSize, m_pSpinboxRecordingFrameWidth); 753 setTabOrder(m_pSpinboxRecordingFrameWidth, m_pSpinboxRecordingFrameHeight); 754 setTabOrder(m_pSpinboxRecordingFrameHeight, m_pSliderRecordingFrameRate); 755 setTabOrder(m_pSliderRecordingFrameRate, m_pSpinboxRecordingFrameRate); 756 setTabOrder(m_pSpinboxRecordingFrameRate, m_pSliderRecordingVideoQuality); 757 setTabOrder(m_pSliderRecordingVideoQuality, m_pSpinboxRecordingVideoQuality); 699 setTabOrder(m_pEditorVRDESettings, m_pEditorRecordingSettings); 758 700 } 759 701 760 702 void UIMachineSettingsDisplay::retranslateUi() 761 703 { 704 /* Translate tab-widget: */ 762 705 m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabScreen), tr("&Screen")); 763 706 m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabRemoteDisplay), tr("&Remote Display")); 764 m_pCheckboxRecording->setToolTip(tr("When checked, VirtualBox will record the virtual machine session as a video file."));765 m_pCheckboxRecording->setText(tr("&Enable Recording"));766 m_pLabelRecordingMode->setText(tr("Recording &Mode:"));767 m_pComboRecordingMode->setToolTip(tr("Selects the recording mode."));768 m_pLabelRecordingFilePath->setText(tr("File &Path:"));769 m_pEditorRecordingFilePath->setToolTip(tr("Holds the filename VirtualBox uses to save the recorded content."));770 m_pLabelRecordingFrameSize->setText(tr("Frame Si&ze:"));771 m_pComboRecordingFrameSize->setToolTip(tr("Selects the resolution (frame size) of the recorded video."));772 m_pSpinboxRecordingFrameWidth->setToolTip(tr("Holds the <b>horizontal</b> resolution (frame width) of the recorded video."));773 m_pSpinboxRecordingFrameHeight->setToolTip(tr("Holds the <b>vertical</b> resolution (frame height) of the recorded video."));774 m_pLabelRecordingFrameRate->setText(tr("Frame R&ate:"));775 m_pSliderRecordingFrameRate->setToolTip(tr("Controls the maximum number of <b>frames per second</b>. Additional frames will "776 "be skipped. Reducing this value will increase the number of skipped frames and "777 "reduce the file size."));778 m_pSpinboxRecordingFrameRate->setToolTip(tr("Controls the maximum number of <b>frames per second</b>. Additional frames will "779 "be skipped. Reducing this value will increase the number of skipped frames and "780 "reduce the file size."));781 m_pLabelRecordingVideoQuality->setText(tr("&Video Quality:"));782 m_pSliderRecordingVideoQuality->setToolTip(tr("Controls the <b>quality</b>. Increasing this value will make the video look "783 "better at the cost of an increased file size."));784 m_pSpinboxRecordingVideoQuality->setToolTip(tr("Holds the bitrate in <b>kilobits per second</b>. Increasing this value will "785 "make the video look better at the cost of an increased file size."));786 m_pLabelRecordingAudioQuality->setText(tr("&Audio Quality:"));787 m_pSliderRecordingAudioQuality->setToolTip(tr("Controls the <b>quality</b>. Increasing this value will make the audio sound "788 "better at the cost of an increased file size."));789 m_pLabelRecordingScreens->setText(tr("Scree&ns:"));790 m_pScrollerRecordingScreens->setToolTip(QString());791 707 m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabRecording), tr("Re&cording")); 792 793 /* Recording stuff: */794 m_pSpinboxRecordingFrameRate->setSuffix(QString(" %1").arg(tr("fps")));795 m_pSpinboxRecordingVideoQuality->setSuffix(QString(" %1").arg(tr("kbps")));796 m_pComboRecordingFrameSize->setItemText(0, tr("User Defined"));797 m_pLabelRecordingFrameRateMin->setText(tr("%1 fps").arg(m_pSliderRecordingFrameRate->minimum()));798 m_pLabelRecordingFrameRateMax->setText(tr("%1 fps").arg(m_pSliderRecordingFrameRate->maximum()));799 m_pLabelRecordingVideoQualityMin->setText(tr("low", "quality"));800 m_pLabelRecordingVideoQualityMed->setText(tr("medium", "quality"));801 m_pLabelRecordingVideoQualityMax->setText(tr("high", "quality"));802 m_pLabelRecordingAudioQualityMin->setText(tr("low", "quality"));803 m_pLabelRecordingAudioQualityMed->setText(tr("medium", "quality"));804 m_pLabelRecordingAudioQualityMax->setText(tr("high", "quality"));805 806 m_pComboRecordingMode->setItemText(0, gpConverter->toString(UISettingsDefs::RecordingMode_VideoAudio));807 m_pComboRecordingMode->setItemText(1, gpConverter->toString(UISettingsDefs::RecordingMode_VideoOnly));808 m_pComboRecordingMode->setItemText(2, gpConverter->toString(UISettingsDefs::RecordingMode_AudioOnly));809 708 810 709 /* These editors have own labels, but we want them to be properly layouted according to each other: */ … … 824 723 m_pEditorDisplayScreenFeatures->setMinimumLayoutIndent(iMinimumLayoutHint); 825 724 #endif 826 827 updateRecordingFileSizeHint();828 725 } 829 726 … … 849 746 /* Polish 'Recording' availability: */ 850 747 m_pTabRecording->setEnabled(isMachineInValidMode()); 851 sltHandleRecordingCheckboxToggle(); 748 // Recording options should be enabled only if: 749 // 1. Machine is in 'offline' or 'saved' state, 750 // 2. Machine is in 'online' state and video recording is *disabled* currently. 751 const bool fIsRecordingOptionsEnabled = 752 ((isMachineOffline() || isMachineSaved())) 753 || (isMachineOnline() && !m_pCache->base().m_fRecordingEnabled); 754 m_pEditorRecordingSettings->setOptionsAvailable(fIsRecordingOptionsEnabled); 755 // Recording screens option should be enabled only if: 756 // 1. Machine is in *any* valid state. 757 const bool fIsRecordingScreenOptionsEnabled = 758 isMachineInValidMode(); 759 m_pEditorRecordingSettings->setScreenOptionsAvailable(fIsRecordingScreenOptionsEnabled); 852 760 } 853 761 … … 880 788 } 881 789 #endif /* VBOX_WITH_3D_ACCELERATION */ 882 883 void UIMachineSettingsDisplay::sltHandleRecordingCheckboxToggle()884 {885 /* Recording options should be enabled only if:886 * 1. Machine is in 'offline' or 'saved' state and check-box is checked,887 * 2. Machine is in 'online' state, check-box is checked, and video recording is *disabled* currently. */888 const bool fIsRecordingOptionsEnabled = ((isMachineOffline() || isMachineSaved()) && m_pCheckboxRecording->isChecked()) ||889 (isMachineOnline() && !m_pCache->base().m_fRecordingEnabled && m_pCheckboxRecording->isChecked());890 891 m_pLabelRecordingMode->setEnabled(fIsRecordingOptionsEnabled);892 m_pComboRecordingMode->setEnabled(fIsRecordingOptionsEnabled);893 894 m_pLabelRecordingFilePath->setEnabled(fIsRecordingOptionsEnabled);895 m_pEditorRecordingFilePath->setEnabled(fIsRecordingOptionsEnabled);896 897 enableDisableRecordingWidgets();898 }899 900 void UIMachineSettingsDisplay::sltHandleRecordingVideoFrameSizeComboboxChange()901 {902 /* Get the proposed size: */903 const int iCurrentIndex = m_pComboRecordingFrameSize->currentIndex();904 const QSize videoCaptureSize = m_pComboRecordingFrameSize->itemData(iCurrentIndex).toSize();905 906 /* Make sure its valid: */907 if (!videoCaptureSize.isValid())908 return;909 910 /* Apply proposed size: */911 m_pSpinboxRecordingFrameWidth->setValue(videoCaptureSize.width());912 m_pSpinboxRecordingFrameHeight->setValue(videoCaptureSize.height());913 }914 915 void UIMachineSettingsDisplay::sltHandleRecordingVideoFrameWidthEditorChange()916 {917 /* Look for preset: */918 lookForCorrespondingFrameSizePreset();919 /* Update quality and bit-rate: */920 sltHandleRecordingVideoQualitySliderChange();921 }922 923 void UIMachineSettingsDisplay::sltHandleRecordingVideoFrameHeightEditorChange()924 {925 /* Look for preset: */926 lookForCorrespondingFrameSizePreset();927 /* Update quality and bit-rate: */928 sltHandleRecordingVideoQualitySliderChange();929 }930 931 void UIMachineSettingsDisplay::sltHandleRecordingVideoFrameRateSliderChange()932 {933 /* Apply proposed frame-rate: */934 m_pSpinboxRecordingFrameRate->blockSignals(true);935 m_pSpinboxRecordingFrameRate->setValue(m_pSliderRecordingFrameRate->value());936 m_pSpinboxRecordingFrameRate->blockSignals(false);937 /* Update quality and bit-rate: */938 sltHandleRecordingVideoQualitySliderChange();939 }940 941 void UIMachineSettingsDisplay::sltHandleRecordingVideoFrameRateEditorChange()942 {943 /* Apply proposed frame-rate: */944 m_pSliderRecordingFrameRate->blockSignals(true);945 m_pSliderRecordingFrameRate->setValue(m_pSpinboxRecordingFrameRate->value());946 m_pSliderRecordingFrameRate->blockSignals(false);947 /* Update quality and bit-rate: */948 sltHandleRecordingVideoQualitySliderChange();949 }950 951 void UIMachineSettingsDisplay::sltHandleRecordingVideoQualitySliderChange()952 {953 /* Calculate/apply proposed bit-rate: */954 m_pSpinboxRecordingVideoQuality->blockSignals(true);955 m_pSpinboxRecordingVideoQuality->setValue(calculateBitRate(m_pSpinboxRecordingFrameWidth->value(),956 m_pSpinboxRecordingFrameHeight->value(),957 m_pSpinboxRecordingFrameRate->value(),958 m_pSliderRecordingVideoQuality->value()));959 m_pSpinboxRecordingVideoQuality->blockSignals(false);960 updateRecordingFileSizeHint();961 }962 963 void UIMachineSettingsDisplay::sltHandleRecordingVideoBitRateEditorChange()964 {965 /* Calculate/apply proposed quality: */966 m_pSliderRecordingVideoQuality->blockSignals(true);967 m_pSliderRecordingVideoQuality->setValue(calculateQuality(m_pSpinboxRecordingFrameWidth->value(),968 m_pSpinboxRecordingFrameHeight->value(),969 m_pSpinboxRecordingFrameRate->value(),970 m_pSpinboxRecordingVideoQuality->value()));971 m_pSliderRecordingVideoQuality->blockSignals(false);972 updateRecordingFileSizeHint();973 }974 975 void UIMachineSettingsDisplay::sltHandleRecordingComboBoxChange()976 {977 enableDisableRecordingWidgets();978 }979 790 980 791 void UIMachineSettingsDisplay::prepare() … … 995 806 { 996 807 /* Prepare main layout: */ 997 QVBoxLayout *pLayout Main= new QVBoxLayout(this);998 if (pLayout Main)808 QVBoxLayout *pLayout = new QVBoxLayout(this); 809 if (pLayout) 999 810 { 1000 811 /* Prepare tab-widget: */ … … 1007 818 prepareTabRecording(); 1008 819 1009 pLayout Main->addWidget(m_pTabWidget);820 pLayout->addWidget(m_pTabWidget); 1010 821 } 1011 822 } … … 1085 896 { 1086 897 /* Prepare 'Recording' tab layout: */ 1087 Q GridLayout *pLayoutRecording = new QGridLayout(m_pTabRecording);898 QVBoxLayout *pLayoutRecording = new QVBoxLayout(m_pTabRecording); 1088 899 if (pLayoutRecording) 1089 900 { 1090 pLayoutRecording->setRowStretch(2, 1); 1091 1092 /* Prepare recording check-box: */ 1093 m_pCheckboxRecording = new QCheckBox(m_pWidgetRecordingSettings); 1094 if (m_pCheckboxRecording) 1095 pLayoutRecording->addWidget(m_pCheckboxRecording, 0, 0, 1, 2); 1096 1097 /* Prepare 20-px shifting spacer: */ 1098 QSpacerItem *pSpacerItem = new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum); 1099 if (pSpacerItem) 1100 pLayoutRecording->addItem(pSpacerItem, 1, 0); 1101 1102 /* Prepare recording settings widget: */ 1103 m_pWidgetRecordingSettings = new QWidget(m_pTabRecording); 1104 if (m_pWidgetRecordingSettings) 1105 { 1106 /* Prepare recording settings widget layout: */ 1107 QGridLayout *pLayoutRecordingSettings = new QGridLayout(m_pWidgetRecordingSettings); 1108 if (pLayoutRecordingSettings) 1109 { 1110 pLayoutRecordingSettings->setContentsMargins(0, 0, 0, 0); 1111 1112 /* Prepare recording mode label: */ 1113 m_pLabelRecordingMode = new QLabel(m_pWidgetRecordingSettings); 1114 if (m_pLabelRecordingMode) 1115 { 1116 m_pLabelRecordingMode->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 1117 pLayoutRecordingSettings->addWidget(m_pLabelRecordingMode, 0, 0); 1118 } 1119 /* Prepare recording mode combo: */ 1120 m_pComboRecordingMode = new QComboBox(m_pWidgetRecordingSettings); 1121 if (m_pComboRecordingMode) 1122 { 1123 if (m_pLabelRecordingMode) 1124 m_pLabelRecordingMode->setBuddy(m_pComboRecordingMode); 1125 m_pComboRecordingMode->insertItem(0, ""); /* UISettingsDefs::RecordingMode_VideoAudio */ 1126 m_pComboRecordingMode->insertItem(1, ""); /* UISettingsDefs::RecordingMode_VideoOnly */ 1127 m_pComboRecordingMode->insertItem(2, ""); /* UISettingsDefs::RecordingMode_AudioOnly */ 1128 1129 pLayoutRecordingSettings->addWidget(m_pComboRecordingMode, 0, 1, 1, 3); 1130 } 1131 1132 /* Prepare recording file path label: */ 1133 m_pLabelRecordingFilePath = new QLabel(m_pWidgetRecordingSettings); 1134 if (m_pLabelRecordingFilePath) 1135 { 1136 m_pLabelRecordingFilePath->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 1137 pLayoutRecordingSettings->addWidget(m_pLabelRecordingFilePath, 1, 0); 1138 } 1139 /* Prepare recording file path editor: */ 1140 m_pEditorRecordingFilePath = new UIFilePathSelector(m_pWidgetRecordingSettings); 1141 if (m_pEditorRecordingFilePath) 1142 { 1143 if (m_pLabelRecordingFilePath) 1144 m_pLabelRecordingFilePath->setBuddy(m_pEditorRecordingFilePath->focusProxy()); 1145 m_pEditorRecordingFilePath->setEditable(false); 1146 m_pEditorRecordingFilePath->setMode(UIFilePathSelector::Mode_File_Save); 1147 1148 pLayoutRecordingSettings->addWidget(m_pEditorRecordingFilePath, 1, 1, 1, 3); 1149 } 1150 1151 /* Prepare recording frame size label: */ 1152 m_pLabelRecordingFrameSize = new QLabel(m_pWidgetRecordingSettings); 1153 if (m_pLabelRecordingFrameSize) 1154 { 1155 m_pLabelRecordingFrameSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 1156 pLayoutRecordingSettings->addWidget(m_pLabelRecordingFrameSize, 2, 0); 1157 } 1158 /* Prepare recording frame size combo: */ 1159 m_pComboRecordingFrameSize = new QComboBox(m_pWidgetRecordingSettings); 1160 if (m_pComboRecordingFrameSize) 1161 { 1162 if (m_pLabelRecordingFrameSize) 1163 m_pLabelRecordingFrameSize->setBuddy(m_pComboRecordingFrameSize); 1164 m_pComboRecordingFrameSize->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); 1165 m_pComboRecordingFrameSize->addItem(""); /* User Defined */ 1166 m_pComboRecordingFrameSize->addItem("320 x 200 (16:10)", QSize(320, 200)); 1167 m_pComboRecordingFrameSize->addItem("640 x 480 (4:3)", QSize(640, 480)); 1168 m_pComboRecordingFrameSize->addItem("720 x 400 (9:5)", QSize(720, 400)); 1169 m_pComboRecordingFrameSize->addItem("720 x 480 (3:2)", QSize(720, 480)); 1170 m_pComboRecordingFrameSize->addItem("800 x 600 (4:3)", QSize(800, 600)); 1171 m_pComboRecordingFrameSize->addItem("1024 x 768 (4:3)", QSize(1024, 768)); 1172 m_pComboRecordingFrameSize->addItem("1152 x 864 (4:3)", QSize(1152, 864)); 1173 m_pComboRecordingFrameSize->addItem("1280 x 720 (16:9)", QSize(1280, 720)); 1174 m_pComboRecordingFrameSize->addItem("1280 x 800 (16:10)", QSize(1280, 800)); 1175 m_pComboRecordingFrameSize->addItem("1280 x 960 (4:3)", QSize(1280, 960)); 1176 m_pComboRecordingFrameSize->addItem("1280 x 1024 (5:4)", QSize(1280, 1024)); 1177 m_pComboRecordingFrameSize->addItem("1366 x 768 (16:9)", QSize(1366, 768)); 1178 m_pComboRecordingFrameSize->addItem("1440 x 900 (16:10)", QSize(1440, 900)); 1179 m_pComboRecordingFrameSize->addItem("1440 x 1080 (4:3)", QSize(1440, 1080)); 1180 m_pComboRecordingFrameSize->addItem("1600 x 900 (16:9)", QSize(1600, 900)); 1181 m_pComboRecordingFrameSize->addItem("1680 x 1050 (16:10)", QSize(1680, 1050)); 1182 m_pComboRecordingFrameSize->addItem("1600 x 1200 (4:3)", QSize(1600, 1200)); 1183 m_pComboRecordingFrameSize->addItem("1920 x 1080 (16:9)", QSize(1920, 1080)); 1184 m_pComboRecordingFrameSize->addItem("1920 x 1200 (16:10)", QSize(1920, 1200)); 1185 m_pComboRecordingFrameSize->addItem("1920 x 1440 (4:3)", QSize(1920, 1440)); 1186 m_pComboRecordingFrameSize->addItem("2880 x 1800 (16:10)", QSize(2880, 1800)); 1187 1188 pLayoutRecordingSettings->addWidget(m_pComboRecordingFrameSize, 2, 1); 1189 } 1190 /* Prepare recording frame width spinbox: */ 1191 m_pSpinboxRecordingFrameWidth = new QSpinBox(m_pWidgetRecordingSettings); 1192 if (m_pSpinboxRecordingFrameWidth) 1193 { 1194 uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxRecordingFrameWidth, 5); 1195 m_pSpinboxRecordingFrameWidth->setMinimum(16); 1196 m_pSpinboxRecordingFrameWidth->setMaximum(2880); 1197 1198 pLayoutRecordingSettings->addWidget(m_pSpinboxRecordingFrameWidth, 2, 2); 1199 } 1200 /* Prepare recording frame height spinbox: */ 1201 m_pSpinboxRecordingFrameHeight = new QSpinBox(m_pWidgetRecordingSettings); 1202 if (m_pSpinboxRecordingFrameHeight) 1203 { 1204 uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxRecordingFrameHeight, 5); 1205 m_pSpinboxRecordingFrameHeight->setMinimum(16); 1206 m_pSpinboxRecordingFrameHeight->setMaximum(1800); 1207 1208 pLayoutRecordingSettings->addWidget(m_pSpinboxRecordingFrameHeight, 2, 3); 1209 } 1210 1211 /* Prepare recording frame rate label: */ 1212 m_pLabelRecordingFrameRate = new QLabel(m_pWidgetRecordingSettings); 1213 if (m_pLabelRecordingFrameRate) 1214 { 1215 m_pLabelRecordingFrameRate->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 1216 pLayoutRecordingSettings->addWidget(m_pLabelRecordingFrameRate, 3, 0); 1217 } 1218 /* Prepare recording frame rate widget: */ 1219 m_pWidgetRecordingFrameRateSettings = new QWidget(m_pWidgetRecordingSettings); 1220 if (m_pWidgetRecordingFrameRateSettings) 1221 { 1222 /* Prepare recording frame rate layout: */ 1223 QVBoxLayout *pLayoutRecordingFrameRate = new QVBoxLayout(m_pWidgetRecordingFrameRateSettings); 1224 if (pLayoutRecordingFrameRate) 1225 { 1226 pLayoutRecordingFrameRate->setContentsMargins(0, 0, 0, 0); 1227 1228 /* Prepare recording frame rate slider: */ 1229 m_pSliderRecordingFrameRate = new QIAdvancedSlider(m_pWidgetRecordingFrameRateSettings); 1230 if (m_pSliderRecordingFrameRate) 1231 { 1232 m_pSliderRecordingFrameRate->setOrientation(Qt::Horizontal); 1233 m_pSliderRecordingFrameRate->setMinimum(1); 1234 m_pSliderRecordingFrameRate->setMaximum(30); 1235 m_pSliderRecordingFrameRate->setPageStep(1); 1236 m_pSliderRecordingFrameRate->setSingleStep(1); 1237 m_pSliderRecordingFrameRate->setTickInterval(1); 1238 m_pSliderRecordingFrameRate->setSnappingEnabled(true); 1239 m_pSliderRecordingFrameRate->setOptimalHint(1, 25); 1240 m_pSliderRecordingFrameRate->setWarningHint(25, 30); 1241 1242 pLayoutRecordingFrameRate->addWidget(m_pSliderRecordingFrameRate); 1243 } 1244 /* Prepare recording frame rate scale layout: */ 1245 QHBoxLayout *pLayoutRecordingFrameRateScale = new QHBoxLayout; 1246 if (pLayoutRecordingFrameRateScale) 1247 { 1248 pLayoutRecordingFrameRateScale->setContentsMargins(0, 0, 0, 0); 1249 1250 /* Prepare recording frame rate min label: */ 1251 m_pLabelRecordingFrameRateMin = new QLabel(m_pWidgetRecordingFrameRateSettings); 1252 if (m_pLabelRecordingFrameRateMin) 1253 pLayoutRecordingFrameRateScale->addWidget(m_pLabelRecordingFrameRateMin); 1254 pLayoutRecordingFrameRateScale->addStretch(); 1255 /* Prepare recording frame rate max label: */ 1256 m_pLabelRecordingFrameRateMax = new QLabel(m_pWidgetRecordingFrameRateSettings); 1257 if (m_pLabelRecordingFrameRateMax) 1258 pLayoutRecordingFrameRateScale->addWidget(m_pLabelRecordingFrameRateMax); 1259 1260 pLayoutRecordingFrameRate->addLayout(pLayoutRecordingFrameRateScale); 1261 } 1262 } 1263 1264 pLayoutRecordingSettings->addWidget(m_pWidgetRecordingFrameRateSettings, 3, 1, 2, 1); 1265 } 1266 /* Prepare recording frame rate spinbox: */ 1267 m_pSpinboxRecordingFrameRate = new QSpinBox(m_pWidgetRecordingSettings); 1268 if (m_pSpinboxRecordingFrameRate) 1269 { 1270 if (m_pLabelRecordingFrameRate) 1271 m_pLabelRecordingFrameRate->setBuddy(m_pSpinboxRecordingFrameRate); 1272 uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxRecordingFrameRate, 3); 1273 m_pSpinboxRecordingFrameRate->setMinimum(1); 1274 m_pSpinboxRecordingFrameRate->setMaximum(30); 1275 1276 pLayoutRecordingSettings->addWidget(m_pSpinboxRecordingFrameRate, 3, 2, 1, 2); 1277 } 1278 1279 /* Prepare recording video quality label: */ 1280 m_pLabelRecordingVideoQuality = new QLabel(m_pWidgetRecordingSettings); 1281 if (m_pLabelRecordingVideoQuality) 1282 { 1283 m_pLabelRecordingVideoQuality->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 1284 pLayoutRecordingSettings->addWidget(m_pLabelRecordingVideoQuality, 5, 0); 1285 } 1286 /* Prepare recording video quality widget: */ 1287 m_pWidgetRecordingVideoQualitySettings = new QWidget(m_pWidgetRecordingSettings); 1288 if (m_pWidgetRecordingVideoQualitySettings) 1289 { 1290 /* Prepare recording video quality layout: */ 1291 QVBoxLayout *pLayoutRecordingVideoQuality = new QVBoxLayout(m_pWidgetRecordingVideoQualitySettings); 1292 if (pLayoutRecordingVideoQuality) 1293 { 1294 pLayoutRecordingVideoQuality->setContentsMargins(0, 0, 0, 0); 1295 1296 /* Prepare recording video quality slider: */ 1297 m_pSliderRecordingVideoQuality = new QIAdvancedSlider(m_pWidgetRecordingVideoQualitySettings); 1298 if (m_pSliderRecordingVideoQuality) 1299 { 1300 m_pSliderRecordingVideoQuality->setOrientation(Qt::Horizontal); 1301 m_pSliderRecordingVideoQuality->setMinimum(1); 1302 m_pSliderRecordingVideoQuality->setMaximum(10); 1303 m_pSliderRecordingVideoQuality->setPageStep(1); 1304 m_pSliderRecordingVideoQuality->setSingleStep(1); 1305 m_pSliderRecordingVideoQuality->setTickInterval(1); 1306 m_pSliderRecordingVideoQuality->setSnappingEnabled(true); 1307 m_pSliderRecordingVideoQuality->setOptimalHint(1, 5); 1308 m_pSliderRecordingVideoQuality->setWarningHint(5, 9); 1309 m_pSliderRecordingVideoQuality->setErrorHint(9, 10); 1310 1311 pLayoutRecordingVideoQuality->addWidget(m_pSliderRecordingVideoQuality); 1312 } 1313 /* Prepare recording video quality scale layout: */ 1314 QHBoxLayout *pLayoutRecordingVideoQialityScale = new QHBoxLayout; 1315 if (pLayoutRecordingVideoQialityScale) 1316 { 1317 pLayoutRecordingVideoQialityScale->setContentsMargins(0, 0, 0, 0); 1318 1319 /* Prepare recording video quality min label: */ 1320 m_pLabelRecordingVideoQualityMin = new QLabel(m_pWidgetRecordingVideoQualitySettings); 1321 if (m_pLabelRecordingVideoQualityMin) 1322 pLayoutRecordingVideoQialityScale->addWidget(m_pLabelRecordingVideoQualityMin); 1323 pLayoutRecordingVideoQialityScale->addStretch(); 1324 /* Prepare recording video quality med label: */ 1325 m_pLabelRecordingVideoQualityMed = new QLabel(m_pWidgetRecordingVideoQualitySettings); 1326 if (m_pLabelRecordingVideoQualityMed) 1327 pLayoutRecordingVideoQialityScale->addWidget(m_pLabelRecordingVideoQualityMed); 1328 pLayoutRecordingVideoQialityScale->addStretch(); 1329 /* Prepare recording video quality max label: */ 1330 m_pLabelRecordingVideoQualityMax = new QLabel(m_pWidgetRecordingVideoQualitySettings); 1331 if (m_pLabelRecordingVideoQualityMax) 1332 pLayoutRecordingVideoQialityScale->addWidget(m_pLabelRecordingVideoQualityMax); 1333 1334 pLayoutRecordingVideoQuality->addLayout(pLayoutRecordingVideoQialityScale); 1335 } 1336 } 1337 1338 pLayoutRecordingSettings->addWidget(m_pWidgetRecordingVideoQualitySettings, 5, 1, 2, 1); 1339 } 1340 /* Prepare recording video quality spinbox: */ 1341 m_pSpinboxRecordingVideoQuality = new QSpinBox(m_pWidgetRecordingSettings); 1342 if (m_pSpinboxRecordingVideoQuality) 1343 { 1344 if (m_pLabelRecordingVideoQuality) 1345 m_pLabelRecordingVideoQuality->setBuddy(m_pSpinboxRecordingVideoQuality); 1346 uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxRecordingVideoQuality, 5); 1347 m_pSpinboxRecordingVideoQuality->setMinimum(VIDEO_CAPTURE_BIT_RATE_MIN); 1348 m_pSpinboxRecordingVideoQuality->setMaximum(VIDEO_CAPTURE_BIT_RATE_MAX); 1349 1350 pLayoutRecordingSettings->addWidget(m_pSpinboxRecordingVideoQuality, 5, 2, 1, 2); 1351 } 1352 1353 /* Prepare recording audio quality label: */ 1354 m_pLabelRecordingAudioQuality = new QLabel(m_pWidgetRecordingSettings); 1355 if (m_pLabelRecordingAudioQuality) 1356 { 1357 m_pLabelRecordingAudioQuality->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 1358 pLayoutRecordingSettings->addWidget(m_pLabelRecordingAudioQuality, 7, 0); 1359 } 1360 /* Prepare recording audio quality widget: */ 1361 m_pWidgetRecordingAudioQualitySettings = new QWidget(m_pWidgetRecordingSettings); 1362 if (m_pWidgetRecordingAudioQualitySettings) 1363 { 1364 /* Prepare recording audio quality layout: */ 1365 QVBoxLayout *pLayoutRecordingAudioQuality = new QVBoxLayout(m_pWidgetRecordingAudioQualitySettings); 1366 if (pLayoutRecordingAudioQuality) 1367 { 1368 pLayoutRecordingAudioQuality->setContentsMargins(0, 0, 0, 0); 1369 1370 /* Prepare recording audio quality slider: */ 1371 m_pSliderRecordingAudioQuality = new QIAdvancedSlider(m_pWidgetRecordingAudioQualitySettings); 1372 if (m_pSliderRecordingAudioQuality) 1373 { 1374 if (m_pLabelRecordingAudioQuality) 1375 m_pLabelRecordingAudioQuality->setBuddy(m_pSliderRecordingAudioQuality); 1376 m_pSliderRecordingAudioQuality->setOrientation(Qt::Horizontal); 1377 m_pSliderRecordingAudioQuality->setMinimum(1); 1378 m_pSliderRecordingAudioQuality->setMaximum(3); 1379 m_pSliderRecordingAudioQuality->setPageStep(1); 1380 m_pSliderRecordingAudioQuality->setSingleStep(1); 1381 m_pSliderRecordingAudioQuality->setTickInterval(1); 1382 m_pSliderRecordingAudioQuality->setSnappingEnabled(true); 1383 m_pSliderRecordingAudioQuality->setOptimalHint(1, 2); 1384 m_pSliderRecordingAudioQuality->setWarningHint(2, 3); 1385 1386 pLayoutRecordingAudioQuality->addWidget(m_pSliderRecordingAudioQuality); 1387 } 1388 /* Prepare recording audio quality scale layout: */ 1389 QHBoxLayout *pLayoutRecordingAudioQialityScale = new QHBoxLayout; 1390 if (pLayoutRecordingAudioQialityScale) 1391 { 1392 pLayoutRecordingAudioQialityScale->setContentsMargins(0, 0, 0, 0); 1393 1394 /* Prepare recording audio quality min label: */ 1395 m_pLabelRecordingAudioQualityMin = new QLabel(m_pWidgetRecordingAudioQualitySettings); 1396 if (m_pLabelRecordingAudioQualityMin) 1397 pLayoutRecordingAudioQialityScale->addWidget(m_pLabelRecordingAudioQualityMin); 1398 pLayoutRecordingAudioQialityScale->addStretch(); 1399 /* Prepare recording audio quality med label: */ 1400 m_pLabelRecordingAudioQualityMed = new QLabel(m_pWidgetRecordingAudioQualitySettings); 1401 if (m_pLabelRecordingAudioQualityMed) 1402 pLayoutRecordingAudioQialityScale->addWidget(m_pLabelRecordingAudioQualityMed); 1403 pLayoutRecordingAudioQialityScale->addStretch(); 1404 /* Prepare recording audio quality max label: */ 1405 m_pLabelRecordingAudioQualityMax = new QLabel(m_pWidgetRecordingAudioQualitySettings); 1406 if (m_pLabelRecordingAudioQualityMax) 1407 pLayoutRecordingAudioQialityScale->addWidget(m_pLabelRecordingAudioQualityMax); 1408 1409 pLayoutRecordingAudioQuality->addLayout(pLayoutRecordingAudioQialityScale); 1410 } 1411 } 1412 1413 pLayoutRecordingSettings->addWidget(m_pWidgetRecordingAudioQualitySettings, 7, 1, 2, 1); 1414 } 1415 1416 /* Prepare recording size hint label: */ 1417 m_pLabelRecordingSizeHint = new QLabel(m_pWidgetRecordingSettings); 1418 if (m_pLabelRecordingSizeHint) 1419 pLayoutRecordingSettings->addWidget(m_pLabelRecordingSizeHint, 9, 1); 1420 1421 /* Prepare recording screens label: */ 1422 m_pLabelRecordingScreens = new QLabel(m_pWidgetRecordingSettings); 1423 if (m_pLabelRecordingScreens) 1424 { 1425 m_pLabelRecordingScreens->setAlignment(Qt::AlignRight | Qt::AlignTop); 1426 pLayoutRecordingSettings->addWidget(m_pLabelRecordingScreens, 10, 0); 1427 } 1428 /* Prepare recording screens scroller: */ 1429 m_pScrollerRecordingScreens = new UIFilmContainer(m_pWidgetRecordingSettings); 1430 if (m_pScrollerRecordingScreens) 1431 { 1432 if (m_pLabelRecordingScreens) 1433 m_pLabelRecordingScreens->setBuddy(m_pScrollerRecordingScreens); 1434 pLayoutRecordingSettings->addWidget(m_pScrollerRecordingScreens, 10, 1, 1, 3); 1435 } 1436 } 1437 1438 pLayoutRecording->addWidget(m_pWidgetRecordingSettings, 1, 1); 1439 } 901 /* Prepare recording editor: */ 902 m_pEditorRecordingSettings = new UIRecordingSettingsEditor(m_pTabRecording); 903 if (m_pEditorRecordingSettings) 904 pLayoutRecording->addWidget(m_pEditorRecordingSettings); 905 906 pLayoutRecording->addStretch(); 1440 907 } 1441 908 … … 1461 928 connect(m_pEditorVRDESettings, &UIVRDESettingsEditor::sigChanged, 1462 929 this, &UIMachineSettingsDisplay::revalidate); 1463 1464 /* Configure 'Recording' connections: */1465 connect(m_pCheckboxRecording, &QCheckBox::toggled,1466 this, &UIMachineSettingsDisplay::sltHandleRecordingCheckboxToggle);1467 connect(m_pComboRecordingMode, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),1468 this, &UIMachineSettingsDisplay::sltHandleRecordingComboBoxChange);1469 connect(m_pComboRecordingFrameSize, static_cast<void(QComboBox::*)(int)>(&QComboBox:: currentIndexChanged),1470 this, &UIMachineSettingsDisplay::sltHandleRecordingVideoFrameSizeComboboxChange);1471 connect(m_pSpinboxRecordingFrameWidth, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),1472 this, &UIMachineSettingsDisplay::sltHandleRecordingVideoFrameWidthEditorChange);1473 connect(m_pSpinboxRecordingFrameHeight, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),1474 this, &UIMachineSettingsDisplay::sltHandleRecordingVideoFrameHeightEditorChange);1475 connect(m_pSliderRecordingFrameRate, &QIAdvancedSlider::valueChanged,1476 this, &UIMachineSettingsDisplay::sltHandleRecordingVideoFrameRateSliderChange);1477 connect(m_pSpinboxRecordingFrameRate, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),1478 this, &UIMachineSettingsDisplay::sltHandleRecordingVideoFrameRateEditorChange);1479 connect(m_pSliderRecordingVideoQuality, &QIAdvancedSlider::valueChanged,1480 this, &UIMachineSettingsDisplay::sltHandleRecordingVideoQualitySliderChange);1481 connect(m_pSpinboxRecordingVideoQuality, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),1482 this, &UIMachineSettingsDisplay::sltHandleRecordingVideoBitRateEditorChange);1483 930 } 1484 931 … … 1502 949 } 1503 950 1504 void UIMachineSettingsDisplay::lookForCorrespondingFrameSizePreset()1505 {1506 /* Look for video-capture size preset: */1507 lookForCorrespondingPreset(m_pComboRecordingFrameSize,1508 QSize(m_pSpinboxRecordingFrameWidth->value(),1509 m_pSpinboxRecordingFrameHeight->value()));1510 }1511 1512 951 void UIMachineSettingsDisplay::updateGuestScreenCount() 1513 952 { … … 1515 954 QVector<BOOL> screens = m_pCache->base().m_vecRecordingScreens; 1516 955 screens.resize(m_pEditorMonitorCount->value()); 1517 m_p ScrollerRecordingScreens->setValue(screens);956 m_pEditorRecordingSettings->setScreens(screens); 1518 957 m_pEditorScaleFactor->setMonitorCount(m_pEditorMonitorCount->value()); 1519 }1520 1521 void UIMachineSettingsDisplay::updateRecordingFileSizeHint()1522 {1523 m_pLabelRecordingSizeHint->setText(tr("<i>About %1MB per 5 minute video</i>").arg(m_pSpinboxRecordingVideoQuality->value() * 300 / 8 / 1024));1524 }1525 1526 /* static */1527 void UIMachineSettingsDisplay::lookForCorrespondingPreset(QComboBox *pComboBox, const QVariant &data)1528 {1529 /* Use passed iterator to look for corresponding preset of passed combo-box: */1530 const int iLookupResult = pComboBox->findData(data);1531 if (iLookupResult != -1 && pComboBox->currentIndex() != iLookupResult)1532 pComboBox->setCurrentIndex(iLookupResult);1533 else if (iLookupResult == -1 && pComboBox->currentIndex() != 0)1534 pComboBox->setCurrentIndex(0);1535 }1536 1537 /* static */1538 int UIMachineSettingsDisplay::calculateBitRate(int iFrameWidth, int iFrameHeight, int iFrameRate, int iQuality)1539 {1540 /* Linear quality<=>bit-rate scale-factor: */1541 const double dResult = (double)iQuality1542 * (double)iFrameWidth * (double)iFrameHeight * (double)iFrameRate1543 / (double)10 /* translate quality to [%] */1544 / (double)1024 /* translate bit-rate to [kbps] */1545 / (double)18.75 /* linear scale factor */;1546 return (int)dResult;1547 }1548 1549 /* static */1550 int UIMachineSettingsDisplay::calculateQuality(int iFrameWidth, int iFrameHeight, int iFrameRate, int iBitRate)1551 {1552 /* Linear bit-rate<=>quality scale-factor: */1553 const double dResult = (double)iBitRate1554 / (double)iFrameWidth / (double)iFrameHeight / (double)iFrameRate1555 * (double)10 /* translate quality to [%] */1556 * (double)1024 /* translate bit-rate to [kbps] */1557 * (double)18.75 /* linear scale factor */;1558 return (int)dResult;1559 958 } 1560 959 … … 1746 1145 if (fSuccess) 1747 1146 { 1748 CRecordingScreenSettingsVector RecordScreenSettingsVector = recordingSettings.GetScreens();1749 for (int iScreenIndex = 0; fSuccess && iScreenIndex < RecordScreenSettingsVector.size(); ++iScreenIndex)1147 CRecordingScreenSettingsVector comRecordingScreenSettingsVector = recordingSettings.GetScreens(); 1148 for (int iScreenIndex = 0; fSuccess && iScreenIndex < comRecordingScreenSettingsVector.size(); ++iScreenIndex) 1750 1149 { 1751 1150 if (newDisplayData.m_vecRecordingScreens[iScreenIndex] == oldDisplayData.m_vecRecordingScreens[iScreenIndex]) 1752 1151 continue; 1753 1152 1754 CRecordingScreenSettings recordingScreenSettings = RecordScreenSettingsVector.at(iScreenIndex);1755 recordingScreenSettings.SetEnabled(newDisplayData.m_vecRecordingScreens[iScreenIndex]);1756 fSuccess = recordingScreenSettings.isOk();1153 CRecordingScreenSettings comRecordingScreenSettings = comRecordingScreenSettingsVector.at(iScreenIndex); 1154 comRecordingScreenSettings.SetEnabled(newDisplayData.m_vecRecordingScreens[iScreenIndex]); 1155 fSuccess = comRecordingScreenSettings.isOk(); 1757 1156 } 1758 1157 } … … 1761 1160 else 1762 1161 { 1763 CRecordingScreenSettingsVector recordingScreenSettingsVector = recordingSettings.GetScreens();1764 for (int iScreenIndex = 0; fSuccess && iScreenIndex < recordingScreenSettingsVector.size(); ++iScreenIndex)1162 CRecordingScreenSettingsVector comRecordingScreenSettingsVector = recordingSettings.GetScreens(); 1163 for (int iScreenIndex = 0; fSuccess && iScreenIndex < comRecordingScreenSettingsVector.size(); ++iScreenIndex) 1765 1164 { 1766 CRecordingScreenSettings recordingScreenSettings = recordingScreenSettingsVector.at(iScreenIndex);1165 CRecordingScreenSettings comRecordingScreenSettings = comRecordingScreenSettingsVector.at(iScreenIndex); 1767 1166 1768 1167 // We should save all the options *before* 'Recording' activation. … … 1771 1170 if (fSuccess && newDisplayData.m_strRecordingFilePath != oldDisplayData.m_strRecordingFilePath) 1772 1171 { 1773 recordingScreenSettings.SetFilename(newDisplayData.m_strRecordingFilePath);1774 Assert( recordingScreenSettings.isOk());1775 fSuccess = recordingScreenSettings.isOk();1172 comRecordingScreenSettings.SetFilename(newDisplayData.m_strRecordingFilePath); 1173 Assert(comRecordingScreenSettings.isOk()); 1174 fSuccess = comRecordingScreenSettings.isOk(); 1776 1175 } 1777 1176 /* Save recording frame width: */ 1778 1177 if (fSuccess && newDisplayData.m_iRecordingVideoFrameWidth != oldDisplayData.m_iRecordingVideoFrameWidth) 1779 1178 { 1780 recordingScreenSettings.SetVideoWidth(newDisplayData.m_iRecordingVideoFrameWidth);1781 Assert( recordingScreenSettings.isOk());1782 fSuccess = recordingScreenSettings.isOk();1179 comRecordingScreenSettings.SetVideoWidth(newDisplayData.m_iRecordingVideoFrameWidth); 1180 Assert(comRecordingScreenSettings.isOk()); 1181 fSuccess = comRecordingScreenSettings.isOk(); 1783 1182 } 1784 1183 /* Save recording frame height: */ 1785 1184 if (fSuccess && newDisplayData.m_iRecordingVideoFrameHeight != oldDisplayData.m_iRecordingVideoFrameHeight) 1786 1185 { 1787 recordingScreenSettings.SetVideoHeight(newDisplayData.m_iRecordingVideoFrameHeight);1788 Assert( recordingScreenSettings.isOk());1789 fSuccess = recordingScreenSettings.isOk();1186 comRecordingScreenSettings.SetVideoHeight(newDisplayData.m_iRecordingVideoFrameHeight); 1187 Assert(comRecordingScreenSettings.isOk()); 1188 fSuccess = comRecordingScreenSettings.isOk(); 1790 1189 } 1791 1190 /* Save recording frame rate: */ 1792 1191 if (fSuccess && newDisplayData.m_iRecordingVideoFrameRate != oldDisplayData.m_iRecordingVideoFrameRate) 1793 1192 { 1794 recordingScreenSettings.SetVideoFPS(newDisplayData.m_iRecordingVideoFrameRate);1795 Assert( recordingScreenSettings.isOk());1796 fSuccess = recordingScreenSettings.isOk();1193 comRecordingScreenSettings.SetVideoFPS(newDisplayData.m_iRecordingVideoFrameRate); 1194 Assert(comRecordingScreenSettings.isOk()); 1195 fSuccess = comRecordingScreenSettings.isOk(); 1797 1196 } 1798 1197 /* Save recording frame bit rate: */ 1799 1198 if (fSuccess && newDisplayData.m_iRecordingVideoBitRate != oldDisplayData.m_iRecordingVideoBitRate) 1800 1199 { 1801 recordingScreenSettings.SetVideoRate(newDisplayData.m_iRecordingVideoBitRate);1802 Assert( recordingScreenSettings.isOk());1803 fSuccess = recordingScreenSettings.isOk();1200 comRecordingScreenSettings.SetVideoRate(newDisplayData.m_iRecordingVideoBitRate); 1201 Assert(comRecordingScreenSettings.isOk()); 1202 fSuccess = comRecordingScreenSettings.isOk(); 1804 1203 } 1805 1204 /* Save recording options: */ 1806 1205 if (fSuccess && newDisplayData.m_strRecordingVideoOptions != oldDisplayData.m_strRecordingVideoOptions) 1807 1206 { 1808 recordingScreenSettings.SetOptions(newDisplayData.m_strRecordingVideoOptions);1809 Assert( recordingScreenSettings.isOk());1810 fSuccess = recordingScreenSettings.isOk();1207 comRecordingScreenSettings.SetOptions(newDisplayData.m_strRecordingVideoOptions); 1208 Assert(comRecordingScreenSettings.isOk()); 1209 fSuccess = comRecordingScreenSettings.isOk(); 1811 1210 } 1812 1211 /* Finally, save the screen's recording state: */ … … 1814 1213 if (fSuccess && newDisplayData.m_vecRecordingScreens != oldDisplayData.m_vecRecordingScreens) 1815 1214 { 1816 recordingScreenSettings.SetEnabled(newDisplayData.m_vecRecordingScreens[iScreenIndex]);1817 Assert( recordingScreenSettings.isOk());1818 fSuccess = recordingScreenSettings.isOk();1215 comRecordingScreenSettings.SetEnabled(newDisplayData.m_vecRecordingScreens[iScreenIndex]); 1216 Assert(comRecordingScreenSettings.isOk()); 1217 fSuccess = comRecordingScreenSettings.isOk(); 1819 1218 } 1820 1219 } … … 1833 1232 else 1834 1233 { 1835 CRecordingScreenSettingsVector recordingScreenSettingsVector = recordingSettings.GetScreens();1836 for (int iScreenIndex = 0; fSuccess && iScreenIndex < recordingScreenSettingsVector.size(); ++iScreenIndex)1837 { 1838 CRecordingScreenSettings recordingScreenSettings = recordingScreenSettingsVector.at(iScreenIndex);1234 CRecordingScreenSettingsVector comRecordingScreenSettingsVector = recordingSettings.GetScreens(); 1235 for (int iScreenIndex = 0; fSuccess && iScreenIndex < comRecordingScreenSettingsVector.size(); ++iScreenIndex) 1236 { 1237 CRecordingScreenSettings comRecordingScreenSettings = comRecordingScreenSettingsVector.at(iScreenIndex); 1839 1238 1840 1239 /* Save recording file path: */ 1841 1240 if (fSuccess && newDisplayData.m_strRecordingFilePath != oldDisplayData.m_strRecordingFilePath) 1842 1241 { 1843 recordingScreenSettings.SetFilename(newDisplayData.m_strRecordingFilePath);1844 Assert( recordingScreenSettings.isOk());1845 fSuccess = recordingScreenSettings.isOk();1242 comRecordingScreenSettings.SetFilename(newDisplayData.m_strRecordingFilePath); 1243 Assert(comRecordingScreenSettings.isOk()); 1244 fSuccess = comRecordingScreenSettings.isOk(); 1846 1245 } 1847 1246 /* Save recording frame width: */ 1848 1247 if (fSuccess && newDisplayData.m_iRecordingVideoFrameWidth != oldDisplayData.m_iRecordingVideoFrameWidth) 1849 1248 { 1850 recordingScreenSettings.SetVideoWidth(newDisplayData.m_iRecordingVideoFrameWidth);1851 Assert( recordingScreenSettings.isOk());1852 fSuccess = recordingScreenSettings.isOk();1249 comRecordingScreenSettings.SetVideoWidth(newDisplayData.m_iRecordingVideoFrameWidth); 1250 Assert(comRecordingScreenSettings.isOk()); 1251 fSuccess = comRecordingScreenSettings.isOk(); 1853 1252 } 1854 1253 /* Save recording frame height: */ 1855 1254 if (fSuccess && newDisplayData.m_iRecordingVideoFrameHeight != oldDisplayData.m_iRecordingVideoFrameHeight) 1856 1255 { 1857 recordingScreenSettings.SetVideoHeight(newDisplayData.m_iRecordingVideoFrameHeight);1858 Assert( recordingScreenSettings.isOk());1859 fSuccess = recordingScreenSettings.isOk();1256 comRecordingScreenSettings.SetVideoHeight(newDisplayData.m_iRecordingVideoFrameHeight); 1257 Assert(comRecordingScreenSettings.isOk()); 1258 fSuccess = comRecordingScreenSettings.isOk(); 1860 1259 } 1861 1260 /* Save recording frame rate: */ 1862 1261 if (fSuccess && newDisplayData.m_iRecordingVideoFrameRate != oldDisplayData.m_iRecordingVideoFrameRate) 1863 1262 { 1864 recordingScreenSettings.SetVideoFPS(newDisplayData.m_iRecordingVideoFrameRate);1865 Assert( recordingScreenSettings.isOk());1866 fSuccess = recordingScreenSettings.isOk();1263 comRecordingScreenSettings.SetVideoFPS(newDisplayData.m_iRecordingVideoFrameRate); 1264 Assert(comRecordingScreenSettings.isOk()); 1265 fSuccess = comRecordingScreenSettings.isOk(); 1867 1266 } 1868 1267 /* Save recording frame bit rate: */ 1869 1268 if (fSuccess && newDisplayData.m_iRecordingVideoBitRate != oldDisplayData.m_iRecordingVideoBitRate) 1870 1269 { 1871 recordingScreenSettings.SetVideoRate(newDisplayData.m_iRecordingVideoBitRate);1872 Assert( recordingScreenSettings.isOk());1873 fSuccess = recordingScreenSettings.isOk();1270 comRecordingScreenSettings.SetVideoRate(newDisplayData.m_iRecordingVideoBitRate); 1271 Assert(comRecordingScreenSettings.isOk()); 1272 fSuccess = comRecordingScreenSettings.isOk(); 1874 1273 } 1875 1274 /* Save capture options: */ 1876 1275 if (fSuccess && newDisplayData.m_strRecordingVideoOptions != oldDisplayData.m_strRecordingVideoOptions) 1877 1276 { 1878 recordingScreenSettings.SetOptions(newDisplayData.m_strRecordingVideoOptions);1879 Assert( recordingScreenSettings.isOk());1880 fSuccess = recordingScreenSettings.isOk();1277 comRecordingScreenSettings.SetOptions(newDisplayData.m_strRecordingVideoOptions); 1278 Assert(comRecordingScreenSettings.isOk()); 1279 fSuccess = comRecordingScreenSettings.isOk(); 1881 1280 } 1882 1281 /* Finally, save the screen's recording state: */ … … 1884 1283 if (fSuccess && newDisplayData.m_vecRecordingScreens != oldDisplayData.m_vecRecordingScreens) 1885 1284 { 1886 recordingScreenSettings.SetEnabled(newDisplayData.m_vecRecordingScreens[iScreenIndex]);1887 Assert( recordingScreenSettings.isOk());1888 fSuccess = recordingScreenSettings.isOk();1285 comRecordingScreenSettings.SetEnabled(newDisplayData.m_vecRecordingScreens[iScreenIndex]); 1286 Assert(comRecordingScreenSettings.isOk()); 1287 fSuccess = comRecordingScreenSettings.isOk(); 1889 1288 } 1890 1289 } … … 1907 1306 return fSuccess; 1908 1307 } 1909 1910 void UIMachineSettingsDisplay::enableDisableRecordingWidgets()1911 {1912 /* Recording options should be enabled only if:1913 * 1. Machine is in 'offline' or 'saved' state and check-box is checked,1914 * 2. Machine is in 'online' state, check-box is checked, and video recording is *disabled* currently. */1915 const bool fIsRecordingOptionsEnabled = ((isMachineOffline() || isMachineSaved()) && m_pCheckboxRecording->isChecked()) ||1916 (isMachineOnline() && !m_pCache->base().m_fRecordingEnabled && m_pCheckboxRecording->isChecked());1917 1918 /* Video Capture Screens option should be enabled only if:1919 * Machine is in *any* valid state and check-box is checked. */1920 const bool fIsVideoCaptureScreenOptionEnabled = isMachineInValidMode() && m_pCheckboxRecording->isChecked();1921 const UISettingsDefs::RecordingMode enmRecordingMode =1922 gpConverter->fromString<UISettingsDefs::RecordingMode>(m_pComboRecordingMode->currentText());1923 const bool fRecordVideo = enmRecordingMode == UISettingsDefs::RecordingMode_VideoOnly1924 || enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio;1925 const bool fRecordAudio = enmRecordingMode == UISettingsDefs::RecordingMode_AudioOnly1926 || enmRecordingMode == UISettingsDefs::RecordingMode_VideoAudio;1927 1928 m_pLabelRecordingFrameSize->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1929 m_pComboRecordingFrameSize->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1930 m_pSpinboxRecordingFrameWidth->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1931 m_pSpinboxRecordingFrameHeight->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1932 1933 m_pLabelRecordingFrameRate->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1934 m_pWidgetRecordingFrameRateSettings->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1935 m_pSpinboxRecordingFrameRate->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1936 1937 m_pLabelRecordingVideoQuality->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1938 m_pWidgetRecordingVideoQualitySettings->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1939 m_pSpinboxRecordingVideoQuality->setEnabled(fIsRecordingOptionsEnabled && fRecordVideo);1940 m_pScrollerRecordingScreens->setEnabled(fIsVideoCaptureScreenOptionEnabled && fRecordVideo);1941 1942 m_pLabelRecordingAudioQuality->setEnabled(fIsRecordingOptionsEnabled && fRecordAudio);1943 m_pWidgetRecordingAudioQualitySettings->setEnabled(fIsRecordingOptionsEnabled && fRecordAudio);1944 1945 m_pLabelRecordingScreens->setEnabled(fIsVideoCaptureScreenOptionEnabled && fRecordVideo);1946 m_pLabelRecordingSizeHint->setEnabled(fIsVideoCaptureScreenOptionEnabled && fRecordVideo);1947 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
r94378 r94436 29 29 30 30 /* Forward declarations: */ 31 class QCheckBox;32 class QComboBox;33 class QLabel;34 class QSpinBox;35 class QIAdvancedSlider;36 31 class QITabWidget; 37 class UIFilePathSelector;38 class UIFilmContainer;39 32 class UIGraphicsControllerEditor; 40 33 #ifdef VBOX_WITH_3D_ACCELERATION … … 42 35 #endif 43 36 class UIMonitorCountEditor; 37 class UIRecordingSettingsEditor; 44 38 class UIScaleFactorEditor; 45 39 class UIVideoMemoryEditor; … … 115 109 #endif 116 110 117 /** Handles recording toggle. */118 void sltHandleRecordingCheckboxToggle();119 /** Handles recording frame size change. */120 void sltHandleRecordingVideoFrameSizeComboboxChange();121 /** Handles recording frame width change. */122 void sltHandleRecordingVideoFrameWidthEditorChange();123 /** Handles recording frame height change. */124 void sltHandleRecordingVideoFrameHeightEditorChange();125 /** Handles recording frame rate slider change. */126 void sltHandleRecordingVideoFrameRateSliderChange();127 /** Handles recording frame rate editor change. */128 void sltHandleRecordingVideoFrameRateEditorChange();129 /** Handles recording quality slider change. */130 void sltHandleRecordingVideoQualitySliderChange();131 /** Handles recording bit-rate editor change. */132 void sltHandleRecordingVideoBitRateEditorChange();133 void sltHandleRecordingComboBoxChange();134 135 111 private: 136 112 … … 153 129 bool shouldWeWarnAboutLowVRAM(); 154 130 155 /** Searches for corresponding frame size preset. */156 void lookForCorrespondingFrameSizePreset();157 131 /** Updates guest-screen count. */ 158 132 void updateGuestScreenCount(); 159 /** Updates recording file size hint. */160 void updateRecordingFileSizeHint();161 /** Searches for the @a data field in corresponding @a pComboBox. */162 static void lookForCorrespondingPreset(QComboBox *pComboBox, const QVariant &data);163 /** Calculates recording video bit-rate for passed @a iFrameWidth, @a iFrameHeight, @a iFrameRate and @a iQuality. */164 static int calculateBitRate(int iFrameWidth, int iFrameHeight, int iFrameRate, int iQuality);165 /** Calculates recording video quality for passed @a iFrameWidth, @a iFrameHeight, @a iFrameRate and @a iBitRate. */166 static int calculateQuality(int iFrameWidth, int iFrameHeight, int iFrameRate, int iBitRate);167 133 /** Saves existing data from cache. */ 168 134 bool saveData(); … … 173 139 /** Saves existing 'Recording' data from cache. */ 174 140 bool saveRecordingData(); 175 /** Decide which of the recording related widgets are to be disabled/enabled. */176 void enableDisableRecordingWidgets();177 141 178 142 /** Holds the guest OS type ID. */ … … 214 178 215 179 /** Holds the 'Recording' tab instance. */ 216 QWidget *m_pTabRecording; 217 /** Holds the recording check-box instance. */ 218 QCheckBox *m_pCheckboxRecording; 219 /** Holds the recording settings widget instance. */ 220 QWidget *m_pWidgetRecordingSettings; 221 /** Holds the recording mode label instance. */ 222 QLabel *m_pLabelRecordingMode; 223 /** Holds the recording mode combo instance. */ 224 QComboBox *m_pComboRecordingMode; 225 /** Holds the recording file path label instance. */ 226 QLabel *m_pLabelRecordingFilePath; 227 /** Holds the recording file path editor instance. */ 228 UIFilePathSelector *m_pEditorRecordingFilePath; 229 /** Holds the recording frame size label instance. */ 230 QLabel *m_pLabelRecordingFrameSize; 231 /** Holds the recording frame size combo instance. */ 232 QComboBox *m_pComboRecordingFrameSize; 233 /** Holds the recording frame width spinbox instance. */ 234 QSpinBox *m_pSpinboxRecordingFrameWidth; 235 /** Holds the recording frame height spinbox instance. */ 236 QSpinBox *m_pSpinboxRecordingFrameHeight; 237 /** Holds the recording frame rate label instance. */ 238 QLabel *m_pLabelRecordingFrameRate; 239 /** Holds the recording frame rate settings widget instance. */ 240 QWidget *m_pWidgetRecordingFrameRateSettings; 241 /** Holds the recording frame rate slider instance. */ 242 QIAdvancedSlider *m_pSliderRecordingFrameRate; 243 /** Holds the recording frame rate spinbox instance. */ 244 QSpinBox *m_pSpinboxRecordingFrameRate; 245 /** Holds the recording frame rate min label instance. */ 246 QLabel *m_pLabelRecordingFrameRateMin; 247 /** Holds the recording frame rate max label instance. */ 248 QLabel *m_pLabelRecordingFrameRateMax; 249 /** Holds the recording video quality label instance. */ 250 QLabel *m_pLabelRecordingVideoQuality; 251 /** Holds the recording video quality settings widget instance. */ 252 QWidget *m_pWidgetRecordingVideoQualitySettings; 253 /** Holds the recording video quality slider instance. */ 254 QIAdvancedSlider *m_pSliderRecordingVideoQuality; 255 /** Holds the recording video quality spinbox instance. */ 256 QSpinBox *m_pSpinboxRecordingVideoQuality; 257 /** Holds the recording video quality min label instance. */ 258 QLabel *m_pLabelRecordingVideoQualityMin; 259 /** Holds the recording video quality med label instance. */ 260 QLabel *m_pLabelRecordingVideoQualityMed; 261 /** Holds the recording video quality max label instance. */ 262 QLabel *m_pLabelRecordingVideoQualityMax; 263 /** Holds the recording audio quality label instance. */ 264 QLabel *m_pLabelRecordingAudioQuality; 265 /** Holds the recording audio quality settings widget instance. */ 266 QWidget *m_pWidgetRecordingAudioQualitySettings; 267 /** Holds the recording audio quality slider instance. */ 268 QIAdvancedSlider *m_pSliderRecordingAudioQuality; 269 /** Holds the recording audio quality min label instance. */ 270 QLabel *m_pLabelRecordingAudioQualityMin; 271 /** Holds the recording audio quality med label instance. */ 272 QLabel *m_pLabelRecordingAudioQualityMed; 273 /** Holds the recording audio quality max label instance. */ 274 QLabel *m_pLabelRecordingAudioQualityMax; 275 /** Holds the recording size hint label instance. */ 276 QLabel *m_pLabelRecordingSizeHint; 277 /** Holds the recording screens label instance. */ 278 QLabel *m_pLabelRecordingScreens; 279 /** Holds the recording screens scroller instance. */ 280 UIFilmContainer *m_pScrollerRecordingScreens; 180 QWidget *m_pTabRecording; 181 /** Holds the Recording settings editor instance. */ 182 UIRecordingSettingsEditor *m_pEditorRecordingSettings; 281 183 /** @} */ 282 184 }; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h
r94028 r94436 111 111 /** Returns the path. */ 112 112 QString path() const { return m_strPath; } 113 /** Returns the path which we pass to QFileDialog as initial path. */ 114 QString initialPath() const { return m_strInitialPath; } 113 115 114 116 /** Returns true if the selected path points to an existing/readable file. */
Note:
See TracChangeset
for help on using the changeset viewer.