Changeset 98516 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 9, 2023 11:24:06 AM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r98503 r98516 62 62 #include "CHostOnlyNetwork.h" 63 63 #include "CKeyboard.h" 64 #include "CMachineDebugger.h" 64 65 #include "CMediumAttachment.h" 65 66 #include "CMouse.h" … … 670 671 671 672 /* static */ 673 void UINotificationMessage::cannotAcquireMachineDebuggerParameter(const CMachineDebugger &comMachineDebugger) 674 { 675 createMessage( 676 QApplication::translate("UIMessageCenter", "Debugger failure ..."), 677 QApplication::translate("UIMessageCenter", "Failed to acquire machine debugger parameter.") + 678 UIErrorString::formatErrorInfo(comMachineDebugger)); 679 } 680 681 /* static */ 672 682 void UINotificationMessage::cannotAcquireConsoleParameter(const CConsole &comConsole) 673 683 { … … 834 844 .arg(CMachine(comMachine).GetName()) + 835 845 UIErrorString::formatErrorInfo(comMachine)); 846 } 847 848 /* static */ 849 void UINotificationMessage::cannotChangeMachineDebuggerParameter(const CMachineDebugger &comMachineDebugger) 850 { 851 createMessage( 852 QApplication::translate("UIMessageCenter", "Debugger failure ..."), 853 QApplication::translate("UIMessageCenter", "Failed to change the parameter of machine debugger.") + 854 UIErrorString::formatErrorInfo(comMachineDebugger)); 836 855 } 837 856 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r98503 r98516 73 73 class CEmulatedUSB; 74 74 class CKeyboard; 75 class CMachineDebugger; 75 76 class CMouse; 76 77 class CNetworkAdapter; … … 295 296 * @param comMachine Brings the object parameter get acquired from. */ 296 297 static void cannotAcquireMachineParameter(const CMachine &comMachine); 298 /** Notifies about inability to acquire IMachineDebugger parameter. 299 * @param comMachineDebugger Brings the object parameter get acquired from. */ 300 static void cannotAcquireMachineDebuggerParameter(const CMachineDebugger &comMachineDebugger); 297 301 /** Notifies about inability to acquire IConsole parameter. 298 302 * @param comConsole Brings the object parameter get acquired from. */ … … 353 357 * @param comMachine Brings the object parameter being changed for. */ 354 358 static void cannotChangeMachineParameter(const CMachine &comMachine); 359 /** Notifies about inability to change IMachineDebugger parameter. 360 * @param comMachineDebugger Brings the object parameter being changed for. */ 361 static void cannotChangeMachineDebuggerParameter(const CMachineDebugger &comMachineDebugger); 355 362 /** Notifies about inability to change IGraphicsAdapter parameter. 356 363 * @param comAdapter Brings the object parameter being changed for. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r98491 r98516 742 742 void sltHandleTimeout() 743 743 { 744 m_ pMachine->acquireCpuLoadPercentage(m_iCPULoadPercentage);744 m_iCPULoadPercentage = m_pMachine->cpuLoadPercentage(); 745 745 update(); 746 746 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98503 r98516 534 534 } 535 535 536 void UIMachine::acquireCpuLoadPercentage(int &iPercentage)537 {538 uisession()->acquireCpuLoadPercentage(iPercentage);539 }540 541 536 void UIMachine::acquireFeaturesStatusInfo(QString &strInfo, KVMExecutionEngine &enmEngine) 542 537 { … … 546 541 isHWVirtExUXEnabled(), 547 542 paravirtProvider()); 543 } 544 545 void UIMachine::setLogEnabled(bool fEnabled) 546 { 547 uisession()->setLogEnabled(fEnabled); 548 } 549 550 bool UIMachine::isLogEnabled() 551 { 552 return uisession()->isLogEnabled(); 553 } 554 555 int UIMachine::cpuLoadPercentage() 556 { 557 return uisession()->cpuLoadPercentage(); 548 558 } 549 559 … … 1890 1900 void UIMachine::updateVirtualizationState() 1891 1901 { 1892 m_enmVMExecutionEngine = uisession()-> debugger().GetExecutionEngine();1893 m_fIsHWVirtExNestedPagingEnabled = uisession()-> debugger().GetHWVirtExNestedPagingEnabled();1894 m_fIsHWVirtExUXEnabled = uisession()-> debugger().GetHWVirtExUXEnabled();1902 m_enmVMExecutionEngine = uisession()->executionEngineType(); 1903 m_fIsHWVirtExNestedPagingEnabled = uisession()->isHwVirtExNestedPagingEnabled(); 1904 m_fIsHWVirtExUXEnabled = uisession()->isHwVirtExUXEnabled(); 1895 1905 m_enmParavirtProvider = uisession()->machine().GetEffectiveParavirtProvider(); 1896 1906 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98503 r98516 419 419 /** Acquires status info for Recording indicator. */ 420 420 void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused); 421 /** Acquires CPU load @a iPercentage. */422 void acquireCpuLoadPercentage(int &iPercentage);423 421 /** Acquires status info for Features indicator. */ 424 422 void acquireFeaturesStatusInfo(QString &strInfo, KVMExecutionEngine &enmEngine); 423 /** @} */ 424 425 /** @name Debugger stuff. 426 ** @{ */ 427 /** Defines whether log is @a fEnabled. */ 428 void setLogEnabled(bool fEnabled); 429 /** Returns whether log is enabled. */ 430 bool isLogEnabled(); 431 432 /** Returns CPU load percentage. */ 433 int cpuLoadPercentage(); 425 434 /** @} */ 426 435 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r98503 r98516 307 307 { 308 308 return uisession()->guest(); 309 }310 311 CMachineDebugger& UIMachineLogic::debugger() const312 {313 return uisession()->debugger();314 309 } 315 310 … … 2484 2479 void UIMachineLogic::sltLoggingToggled(bool fState) 2485 2480 { 2486 NOREF(fState); 2487 if (!debugger().isNull() && debugger().isOk()) 2488 debugger().SetLogEnabled(fState); 2481 uimachine()->setLogEnabled(fState); 2489 2482 } 2490 2483 … … 3000 2993 void UIMachineLogic::updateMenuDebug(QMenu*) 3001 2994 { 3002 /* The "Logging" item. */ 3003 bool fEnabled = false; 3004 bool fChecked = false; 3005 if (!debugger().isNull() && debugger().isOk()) 3006 { 3007 fEnabled = true; 3008 fChecked = debugger().GetLogEnabled() != FALSE; 3009 } 3010 if (fEnabled != actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->isEnabled()) 3011 actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->setEnabled(fEnabled); 3012 if (fChecked != actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->isChecked()) 3013 actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->setChecked(fChecked); 2995 const bool fEnabled = uimachine()->isLogEnabled(); 2996 actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->blockSignals(true); 2997 actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->setChecked(fEnabled); 2998 actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->blockSignals(false); 3014 2999 } 3015 3000 #endif /* VBOX_WITH_DEBUGGER_GUI */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r98503 r98516 60 60 class CGuest; 61 61 class CMouse; 62 class CMachineDebugger;63 62 class CSnapshot; 64 63 class CUSBDevice; … … 128 127 /** Returns the console's guest reference. */ 129 128 CGuest& guest() const; 130 /** Returns the console's debugger reference. */131 CMachineDebugger& debugger() const;132 129 133 130 /** Returns the machine name. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98503 r98516 1455 1455 { 1456 1456 return uisession()->display(); 1457 }1458 1459 CGuest& UIMachineView::guest() const1460 {1461 return uisession()->guest();1462 1457 } 1463 1458 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r98378 r98516 282 282 /** Returns the console's display reference. */ 283 283 CDisplay& display() const; 284 /** Returns the console's guest reference. */285 CGuest& guest() const;286 284 287 285 /* Protected getters: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98503 r98516 463 463 } 464 464 465 void UISession::acquireCpuLoadPercentage(int &iPercentage) 465 void UISession::acquireFeaturesStatusInfo(QString &strInfo, KVMExecutionEngine &enmEngine, 466 bool fNestedPagingEnabled, bool fUxEnabled, 467 KParavirtProvider enmProvider) 468 { 469 CMachine comMachine = machine(); 470 UIDetailsGenerator::acquireFeaturesStatusInfo(comMachine, strInfo, 471 enmEngine, 472 fNestedPagingEnabled, fUxEnabled, 473 enmProvider); 474 } 475 476 void UISession::setLogEnabled(bool fEnabled) 477 { 478 CMachineDebugger comDebugger = debugger(); 479 comDebugger.SetLogEnabled(fEnabled ? TRUE : FALSE); 480 if (!comDebugger.isOk()) 481 UINotificationMessage::cannotChangeMachineDebuggerParameter(comDebugger); 482 } 483 484 bool UISession::isLogEnabled() 485 { 486 CMachineDebugger comDebugger = debugger(); 487 const BOOL fEnabled = comDebugger.GetLogEnabled(); 488 if (!comDebugger.isOk()) 489 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 490 return fEnabled == TRUE; 491 } 492 493 KVMExecutionEngine UISession::executionEngineType() 494 { 495 CMachineDebugger comDebugger = debugger(); 496 const KVMExecutionEngine enmEngine = comDebugger.GetExecutionEngine(); 497 if (!comDebugger.isOk()) 498 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 499 return enmEngine; 500 } 501 502 bool UISession::isHwVirtExNestedPagingEnabled() 503 { 504 CMachineDebugger comDebugger = debugger(); 505 const BOOL fEnabled = comDebugger.GetHWVirtExNestedPagingEnabled(); 506 if (!comDebugger.isOk()) 507 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 508 return fEnabled == TRUE; 509 } 510 511 bool UISession::isHwVirtExUXEnabled() 512 { 513 CMachineDebugger comDebugger = debugger(); 514 const BOOL fEnabled = comDebugger.GetHWVirtExUXEnabled(); 515 if (!comDebugger.isOk()) 516 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 517 return fEnabled == TRUE; 518 } 519 520 int UISession::cpuLoadPercentage() 466 521 { 467 522 CMachineDebugger comDebugger = debugger(); … … 470 525 ULONG uPctOther; 471 526 comDebugger.GetCPULoad(0x7fffffff, uPctExecuting, uPctHalted, uPctOther); 472 iPercentage = uPctExecuting + uPctOther; 473 } 474 475 void UISession::acquireFeaturesStatusInfo(QString &strInfo, KVMExecutionEngine &enmEngine, 476 bool fNestedPagingEnabled, bool fUxEnabled, 477 KParavirtProvider enmProvider) 478 { 479 CMachine comMachine = machine(); 480 UIDetailsGenerator::acquireFeaturesStatusInfo(comMachine, strInfo, 481 enmEngine, 482 fNestedPagingEnabled, fUxEnabled, 483 enmProvider); 527 if (!comDebugger.isOk()) 528 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 529 return uPctExecuting + uPctOther; 484 530 } 485 531 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98503 r98516 319 319 /** Acquires status info for Recording indicator. */ 320 320 void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused); 321 /** Acquires CPU load @a iPercentage. */322 void acquireCpuLoadPercentage(int &iPercentage);323 321 /** Acquires status info for Features indicator. */ 324 322 void acquireFeaturesStatusInfo(QString &strInfo, KVMExecutionEngine &enmEngine, 325 323 bool fNestedPagingEnabled, bool fUxEnabled, 326 324 KParavirtProvider enmProvider); 325 /** @} */ 326 327 /** @name Debugger stuff. 328 ** @{ */ 329 /** Defines whether log is @a fEnabled. */ 330 void setLogEnabled(bool fEnabled); 331 /** Returns whether log is enabled. */ 332 bool isLogEnabled(); 333 334 /** Returns VM's execution engine type. */ 335 KVMExecutionEngine executionEngineType(); 336 /** Returns whether nested paging hardware virtualization extension is enabled. */ 337 bool isHwVirtExNestedPagingEnabled(); 338 /** Returns whether UX hardware virtualization extension is enabled. */ 339 bool isHwVirtExUXEnabled(); 340 341 /** Returns CPU load percentage. */ 342 int cpuLoadPercentage(); 327 343 /** @} */ 328 344
Note:
See TracChangeset
for help on using the changeset viewer.