Changeset 98489 in vbox
- Timestamp:
- Feb 7, 2023 11:45:36 AM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r98488 r98489 1420 1420 } 1421 1421 } 1422 1423 void UIDetailsGenerator::acquireRecordingStatusInfo(CMachine &comMachine, QString &strInfo, 1424 bool &fRecordingEnabled) 1425 { 1426 /* Get recording settings: */ 1427 CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings(); 1428 fRecordingEnabled = comRecordingSettings.GetEnabled(); 1429 if (fRecordingEnabled) 1430 { 1431 /* For now all screens have the same config: */ 1432 CRecordingScreenSettings comRecordingScreen0Settings = comRecordingSettings.GetScreenSettings(0); 1433 const bool fVideoEnabled = comRecordingScreen0Settings.IsFeatureEnabled(KRecordingFeature_Video); 1434 const bool fAudioEnabled = comRecordingScreen0Settings.IsFeatureEnabled(KRecordingFeature_Audio); 1435 1436 /* Compose tool-tip: */ 1437 QString strToolTip; 1438 if (fVideoEnabled && fAudioEnabled) 1439 strToolTip = QApplication::translate("UIIndicatorsPool", "Video/audio recording file", "Recording tooltip"); 1440 else if (fAudioEnabled) 1441 strToolTip = QApplication::translate("UIIndicatorsPool", "Audio recording file", "Recording tooltip"); 1442 else if (fVideoEnabled) 1443 strToolTip = QApplication::translate("UIIndicatorsPool", "Video recording file", "Recording tooltip"); 1444 strInfo += e_strTableRow2 1445 .arg(strToolTip) 1446 .arg(comRecordingScreen0Settings.GetFilename()); 1447 } 1448 /* Handle 'no-recording' case: */ 1449 else 1450 { 1451 strInfo += e_strTableRow1 1452 .arg(QApplication::translate("UIIndicatorsPool", "Recording disabled", "Recording tooltip")); 1453 } 1454 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.h
r98488 r98489 108 108 bool &fAcceleration3D); 109 109 110 SHARED_LIBRARY_STUFF void acquireRecordingStatusInfo(CMachine &comMachine, QString &strInfo, 111 bool &fRecordingEnabled); 112 110 113 /** Holds the table row format 1. */ 111 114 extern const QString e_strTableRow1; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r98488 r98489 30 30 #include <QHBoxLayout> 31 31 #include <QPainter> 32 #include <QStyle> 32 33 #include <QTimer> 33 34 … … 46 47 47 48 /* COM includes: */ 48 #include "CRecordingSettings.h"49 #include "CRecordingScreenSettings.h"50 49 #include "CMachine.h" 51 50 #include "CMachineDebugger.h" … … 567 566 }; 568 567 569 /** Recording modes. */ 570 enum UIIndicatorStateRecordingMode 571 { 572 UIIndicatorStateRecordingMode_None = RT_BIT(0), 573 UIIndicatorStateRecordingMode_Video = RT_BIT(1), 574 UIIndicatorStateRecordingMode_Audio = RT_BIT(2) 575 }; 576 577 public: 578 579 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 568 public: 569 570 /** Constructs indicator passing @a pMachine to the base-class. */ 580 571 UIIndicatorRecording(UIMachine *pMachine, UISession *pSession) 581 572 : UISessionStateStatusBarIndicator(IndicatorType_Recording, pMachine, pSession) 582 573 , m_pAnimation(0) 583 574 , m_dRotationAngle(0) 584 , m_enmRecordingMode(UIIndicatorStateRecordingMode_None)585 575 { 586 576 /* Assign state-icons: */ … … 648 638 void updateAppearance() 649 639 { 650 /* Get machine: */ 651 const CMachine comMachine = m_pSession->machine(); 652 const bool fMachinePaused = m_pSession->isPaused(); 653 654 /* Update indicator state early: */ 655 CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings(); 656 Assert(comRecordingSettings.isOk()); 657 if (!comRecordingSettings.GetEnabled()) 640 QString strFullData; 641 bool fRecordingEnabled = false; 642 bool fMachinePaused = false; 643 m_pMachine->acquireRecordingStatusInfo(strFullData, fRecordingEnabled, fMachinePaused); 644 645 /* Update tool-tip: */ 646 setToolTip(s_strTable.arg(strFullData)); 647 /* Set initial indicator state: */ 648 if (!fRecordingEnabled) 658 649 setState(UIIndicatorStateRecording_Disabled); 659 650 else if (!fMachinePaused) … … 661 652 else 662 653 setState(UIIndicatorStateRecording_Paused); 663 664 updateRecordingMode();665 666 /* Prepare tool-tip: */667 QString strFullData;668 switch (state())669 {670 case UIIndicatorStateRecording_Disabled:671 {672 strFullData += s_strTableRow1673 .arg(QApplication::translate("UIIndicatorsPool", "Recording disabled", "Recording tooltip"));674 break;675 }676 case UIIndicatorStateRecording_Enabled:677 case UIIndicatorStateRecording_Paused:678 {679 QString strToolTip;680 if ( m_enmRecordingMode & UIIndicatorStateRecordingMode_Audio681 && m_enmRecordingMode & UIIndicatorStateRecordingMode_Video)682 strToolTip = QApplication::translate("UIIndicatorsPool", "Video/audio recording file", "Recording tooltip");683 else if (m_enmRecordingMode & UIIndicatorStateRecordingMode_Audio)684 strToolTip = QApplication::translate("UIIndicatorsPool", "Audio recording file", "Recording tooltip");685 else if (m_enmRecordingMode & UIIndicatorStateRecordingMode_Video)686 strToolTip = QApplication::translate("UIIndicatorsPool", "Video recording file", "Recording tooltip");687 688 /* For now all screens have the same config: */689 CRecordingScreenSettings comRecordingScreen0Settings = comRecordingSettings.GetScreenSettings(0);690 Assert(comRecordingScreen0Settings.isOk());691 692 strFullData += s_strTableRow2693 .arg(strToolTip)694 .arg(comRecordingScreen0Settings.GetFilename());695 break;696 }697 default:698 break;699 }700 701 /* Update tool-tip: */702 setToolTip(s_strTable.arg(strFullData));703 654 } 704 655 … … 712 663 void setRotationAngle(double dRotationAngle) { m_dRotationAngle = dRotationAngle; update(); } 713 664 714 /* Parses RecordScreenSettings::Options and updates m_enmRecordingMode accordingly. */715 void updateRecordingMode()716 {717 m_enmRecordingMode = UIIndicatorStateRecordingMode_None;718 719 /* Get machine: */720 if (!m_pSession)721 return;722 const CMachine comMachine = m_pSession->machine();723 if (comMachine.isNull())724 return;725 726 CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings();727 /* For now all screens have the same config: */728 CRecordingScreenSettings recordingScreen0Settings = comRecordingSettings.GetScreenSettings(0);729 if (recordingScreen0Settings.IsFeatureEnabled(KRecordingFeature_Video))730 m_enmRecordingMode = (UIIndicatorStateRecordingMode)((int)m_enmRecordingMode | (int)UIIndicatorStateRecordingMode_Video);731 732 if (recordingScreen0Settings.IsFeatureEnabled(KRecordingFeature_Audio))733 m_enmRecordingMode = (UIIndicatorStateRecordingMode)((int)m_enmRecordingMode | (int)UIIndicatorStateRecordingMode_Audio);734 }735 736 665 /** Holds the rotation animation instance. */ 737 666 UIAnimationLoop *m_pAnimation; 738 667 /** Holds current rotation angle. */ 739 double m_dRotationAngle; 740 741 /** Holds the recording mode. */ 742 UIIndicatorStateRecordingMode m_enmRecordingMode; 668 double m_dRotationAngle; 743 669 }; 744 670 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98488 r98489 486 486 { 487 487 uisession()->acquireDisplayStatusInfo(strInfo, fAcceleration3D); 488 } 489 490 void UIMachine::acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused) 491 { 492 uisession()->acquireRecordingStatusInfo(strInfo, fRecordingEnabled, fMachinePaused); 488 493 } 489 494 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98488 r98489 395 395 /** Acquires status info for Display indicator. */ 396 396 void acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D); 397 /** Acquires status info for Recording indicator. */ 398 void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused); 397 399 /** @} */ 398 400 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98488 r98489 365 365 CMachine comMachine = machine(); 366 366 UIDetailsGenerator::acquireDisplayStatusInfo(comMachine, strInfo, fAcceleration3D); 367 } 368 369 void UISession::acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused) 370 { 371 CMachine comMachine = machine(); 372 fMachinePaused = isPaused(); 373 UIDetailsGenerator::acquireRecordingStatusInfo(comMachine, strInfo, fRecordingEnabled); 367 374 } 368 375 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98488 r98489 281 281 /** Acquires status info for Display indicator. */ 282 282 void acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D); 283 /** Acquires status info for Recording indicator. */ 284 void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused); 283 285 /** @} */ 284 286
Note:
See TracChangeset
for help on using the changeset viewer.