- Timestamp:
- Mar 15, 2023 10:37:32 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r98977 r98978 587 587 588 588 /** Recording states. */ 589 enum UIIndicatorStateRecording 590 { 591 UIIndicatorStateRecording_Disabled = 0, 592 UIIndicatorStateRecording_Enabled = 1, 593 UIIndicatorStateRecording_Paused = 2 589 enum RecordingState 590 { 591 RecordingState_Unavailable = 0, 592 RecordingState_Disabled = 1, 593 RecordingState_Enabled = 2, 594 RecordingState_Paused = 3 594 595 }; 595 596 … … 603 604 { 604 605 /* Assign state-icons: */ 605 setStateIcon(UIIndicatorStateRecording_Disabled, UIIconPool::iconSet(":/video_capture_16px.png")); 606 setStateIcon(UIIndicatorStateRecording_Enabled, UIIconPool::iconSet(":/movie_reel_16px.png")); 607 setStateIcon(UIIndicatorStateRecording_Paused, UIIconPool::iconSet(":/movie_reel_16px.png")); 606 setStateIcon(RecordingState_Unavailable, UIIconPool::iconSet(":/video_capture_disabled_16px.png")); 607 setStateIcon(RecordingState_Disabled, UIIconPool::iconSet(":/video_capture_16px.png")); 608 setStateIcon(RecordingState_Enabled, UIIconPool::iconSet(":/movie_reel_16px.png")); 609 setStateIcon(RecordingState_Paused, UIIconPool::iconSet(":/movie_reel_16px.png")); 610 /* Configure connection: */ 611 connect(pMachine, &UIMachine::sigInitialized, 612 this, &UIIndicatorRecording::updateAppearance); 608 613 /* Create *enabled* state animation: */ 609 614 m_pAnimation = UIAnimationLoop::installAnimationLoop(this, "rotationAngle", 610 611 615 "rotationAngleStart", "rotationAngleFinal", 616 1000); 612 617 /* Translate finally: */ 613 618 retranslateUi(); … … 625 630 QPainter painter(this); 626 631 /* Configure painter for *enabled* state: */ 627 if (state() == UIIndicatorStateRecording_Enabled)632 if (state() == RecordingState_Enabled) 628 633 { 629 634 /* Configure painter for smooth animation: */ … … 655 660 setToolTip(s_strTable.arg(strFullData)); 656 661 /* Set initial indicator state: */ 657 if (!fRecordingEnabled) 658 setState(UIIndicatorStateRecording_Disabled); 659 else if (!fMachinePaused) 660 setState(UIIndicatorStateRecording_Enabled); 661 else 662 setState(UIIndicatorStateRecording_Paused); 662 RecordingState enmState = RecordingState_Unavailable; 663 if (m_pMachine->isSessionValid()) 664 { 665 if (!fRecordingEnabled) 666 enmState = RecordingState_Disabled; 667 else if (!fMachinePaused) 668 enmState = RecordingState_Enabled; 669 else 670 enmState = RecordingState_Paused; 671 } 672 setState(enmState); 663 673 } 664 674 … … 671 681 switch (iState) 672 682 { 673 case UIIndicatorStateRecording_Disabled:683 case RecordingState_Disabled: 674 684 m_pAnimation->stop(); 675 685 m_dRotationAngle = 0; 676 686 break; 677 case UIIndicatorStateRecording_Enabled:687 case RecordingState_Enabled: 678 688 m_pAnimation->start(); 679 689 break; 680 case UIIndicatorStateRecording_Paused:690 case RecordingState_Paused: 681 691 m_pAnimation->stop(); 682 692 break;
Note:
See TracChangeset
for help on using the changeset viewer.