Changeset 98602 in vbox
- Timestamp:
- Feb 16, 2023 1:40:24 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r98569 r98602 690 690 UIIndicatorFeatures(UIMachine *pMachine) 691 691 : UISessionStateStatusBarIndicator(IndicatorType_Features, pMachine) 692 , m_ iCPULoadPercentage(0)692 , m_uEffectiveCPULoad(0) 693 693 { 694 694 /* Assign state-icons: */ … … 731 731 painter.setBrush(gradient); 732 732 /* Use 20% of the icon width to draw the indicator bar: */ 733 painter.drawRect(QRect(QPoint(0.8 * width(), (100 - m_ iCPULoadPercentage) / 100.f * height()),733 painter.drawRect(QRect(QPoint(0.8 * width(), (100 - m_uEffectiveCPULoad) / 100.f * height()), 734 734 QPoint(width(), height()))); 735 735 /* Draw an empty rect. around the CPU load bar: */ … … 760 760 void sltHandleTimeout() 761 761 { 762 m_ iCPULoadPercentage = m_pMachine->cpuLoadPercentage();762 m_pMachine->acquireEffectiveCPULoad(m_uEffectiveCPULoad); 763 763 update(); 764 764 } … … 782 782 QTimer *m_pTimerAutoUpdate; 783 783 784 /** Holds the current CPU load percentage. */785 int m_iCPULoadPercentage;784 /** Holds the effective CPU load. */ 785 ulong m_uEffectiveCPULoad; 786 786 }; 787 787 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98601 r98602 605 605 } 606 606 607 voidUIMachine::setLogEnabled(bool fEnabled)608 { 609 uisession()->setLogEnabled(fEnabled);610 } 611 612 bool UIMachine:: isLogEnabled()613 { 614 return uisession()-> isLogEnabled();615 } 616 617 int UIMachine::cpuLoadPercentage()618 { 619 return uisession()-> cpuLoadPercentage();607 bool UIMachine::setLogEnabled(bool fEnabled) 608 { 609 return uisession()->setLogEnabled(fEnabled); 610 } 611 612 bool UIMachine::acquireWhetherLogEnabled(bool &fEnabled) 613 { 614 return uisession()->acquireWhetherLogEnabled(fEnabled); 615 } 616 617 bool UIMachine::acquireEffectiveCPULoad(ulong &uLoad) 618 { 619 return uisession()->acquireEffectiveCPULoad(uLoad); 620 620 } 621 621 … … 1966 1966 void UIMachine::updateVirtualizationState() 1967 1967 { 1968 m_enmVMExecutionEngine = uisession()->executionEngineType();1969 m_fIsHWVirtExNestedPagingEnabled = uisession()->isHwVirtExNestedPagingEnabled();1970 m_fIsHWVirtExUXEnabled = uisession()->isHwVirtExUXEnabled();1968 uisession()->acquireExecutionEngineType(m_enmVMExecutionEngine); 1969 uisession()->acquireWhetherHwVirtExNestedPagingEnabled(m_fIsHWVirtExNestedPagingEnabled); 1970 uisession()->acquireWhetherHwVirtExUXEnabled(m_fIsHWVirtExUXEnabled); 1971 1971 m_enmParavirtProvider = uisession()->machine().GetEffectiveParavirtProvider(); 1972 1972 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98601 r98602 453 453 ** @{ */ 454 454 /** Defines whether log is @a fEnabled. */ 455 voidsetLogEnabled(bool fEnabled);456 /** Returns whether log is enabled. */457 bool isLogEnabled();458 459 /** Returns CPU load percentage. */460 int cpuLoadPercentage();455 bool setLogEnabled(bool fEnabled); 456 /** Acquires whether log is @a fEnabled. */ 457 bool acquireWhetherLogEnabled(bool &fEnabled); 458 459 /** Acquires effective CPU @a uLoad. */ 460 bool acquireEffectiveCPULoad(ulong &uLoad); 461 461 /** @} */ 462 462 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r98601 r98602 3005 3005 void UIMachineLogic::updateMenuDebug(QMenu*) 3006 3006 { 3007 const bool fEnabled = uimachine()->isLogEnabled(); 3007 bool fEnabled = false; 3008 uimachine()->acquireWhetherLogEnabled(fEnabled); 3008 3009 actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->blockSignals(true); 3009 3010 actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->setChecked(fEnabled); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98601 r98602 640 640 } 641 641 642 voidUISession::setLogEnabled(bool fEnabled)642 bool UISession::setLogEnabled(bool fEnabled) 643 643 { 644 644 CMachineDebugger comDebugger = debugger(); 645 645 comDebugger.SetLogEnabled(fEnabled ? TRUE : FALSE); 646 if (!comDebugger.isOk()) 646 const bool fSuccess = comDebugger.isOk(); 647 if (!fSuccess) 647 648 UINotificationMessage::cannotChangeMachineDebuggerParameter(comDebugger); 648 } 649 650 bool UISession::isLogEnabled() 649 return fSuccess; 650 } 651 652 bool UISession::acquireWhetherLogEnabled(bool &fEnabled) 651 653 { 652 654 CMachineDebugger comDebugger = debugger(); 653 const BOOL fEnabled = comDebugger.GetLogEnabled(); 654 if (!comDebugger.isOk()) 655 const BOOL fLogEnabled = comDebugger.GetLogEnabled(); 656 const bool fSuccess = comDebugger.isOk(); 657 if (!fSuccess) 655 658 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 656 return fEnabled == TRUE; 657 } 658 659 KVMExecutionEngine UISession::executionEngineType() 659 else 660 fEnabled = fLogEnabled == TRUE; 661 return fSuccess; 662 } 663 664 bool UISession::acquireExecutionEngineType(KVMExecutionEngine &enmType) 660 665 { 661 666 CMachineDebugger comDebugger = debugger(); 662 const KVMExecutionEngine enmEngine = comDebugger.GetExecutionEngine(); 663 if (!comDebugger.isOk()) 667 const KVMExecutionEngine enmEngineType = comDebugger.GetExecutionEngine(); 668 const bool fSuccess = comDebugger.isOk(); 669 if (!fSuccess) 664 670 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 665 return enmEngine; 666 } 667 668 bool UISession::isHwVirtExNestedPagingEnabled() 671 else 672 enmType = enmEngineType; 673 return fSuccess; 674 } 675 676 bool UISession::acquireWhetherHwVirtExNestedPagingEnabled(bool &fEnabled) 669 677 { 670 678 CMachineDebugger comDebugger = debugger(); 671 const BOOL fEnabled = comDebugger.GetHWVirtExNestedPagingEnabled(); 672 if (!comDebugger.isOk()) 679 const BOOL fFeatureEnabled = comDebugger.GetHWVirtExNestedPagingEnabled(); 680 const bool fSuccess = comDebugger.isOk(); 681 if (!fSuccess) 673 682 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 674 return fEnabled == TRUE; 675 } 676 677 bool UISession::isHwVirtExUXEnabled() 683 else 684 fEnabled = fFeatureEnabled == TRUE; 685 return fSuccess; 686 } 687 688 bool UISession::acquireWhetherHwVirtExUXEnabled(bool &fEnabled) 678 689 { 679 690 CMachineDebugger comDebugger = debugger(); 680 const BOOL fEnabled = comDebugger.GetHWVirtExUXEnabled(); 681 if (!comDebugger.isOk()) 691 const BOOL fFeatureEnabled = comDebugger.GetHWVirtExUXEnabled(); 692 const bool fSuccess = comDebugger.isOk(); 693 if (!fSuccess) 682 694 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 683 return fEnabled == TRUE; 684 } 685 686 int UISession::cpuLoadPercentage() 695 else 696 fEnabled = fFeatureEnabled == TRUE; 697 return fSuccess; 698 } 699 700 bool UISession::acquireEffectiveCPULoad(ulong &uLoad) 687 701 { 688 702 CMachineDebugger comDebugger = debugger(); … … 691 705 ULONG uPctOther; 692 706 comDebugger.GetCPULoad(0x7fffffff, uPctExecuting, uPctHalted, uPctOther); 693 if (!comDebugger.isOk()) 707 const bool fSuccess = comDebugger.isOk(); 708 if (!fSuccess) 694 709 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 695 return uPctExecuting + uPctOther; 710 else 711 uLoad = uPctExecuting + uPctOther; 712 return fSuccess; 696 713 } 697 714 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98601 r98602 355 355 ** @{ */ 356 356 /** Defines whether log is @a fEnabled. */ 357 voidsetLogEnabled(bool fEnabled);358 /** Returns whether log is enabled. */359 bool isLogEnabled();360 361 /** Returns VM's execution engine type. */362 KVMExecutionEngine executionEngineType();363 /** Returns whether nested paging hardware virtualization extension is enabled. */364 bool isHwVirtExNestedPagingEnabled();365 /** Returns whether UX hardware virtualization extension is enabled. */366 bool isHwVirtExUXEnabled();367 368 /** Returns CPU load percentage. */369 int cpuLoadPercentage();357 bool setLogEnabled(bool fEnabled); 358 /** Acquires whether log is @a fEnabled. */ 359 bool acquireWhetherLogEnabled(bool &fEnabled); 360 361 /** Acquires VM's execution engine @a enmType. */ 362 bool acquireExecutionEngineType(KVMExecutionEngine &enmType); 363 /** Acquires whether nested paging hardware virtualization extension is @a fEnabled. */ 364 bool acquireWhetherHwVirtExNestedPagingEnabled(bool &fEnabled); 365 /** Acquires whether UX hardware virtualization extension is @a fEnabled. */ 366 bool acquireWhetherHwVirtExUXEnabled(bool &fEnabled); 367 368 /** Acquires effective CPU @a uLoad. */ 369 bool acquireEffectiveCPULoad(ulong &uLoad); 370 370 /** @} */ 371 371
Note:
See TracChangeset
for help on using the changeset viewer.