Changeset 98786 in vbox
- Timestamp:
- Feb 28, 2023 3:53:25 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156097
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r98784 r98786 78 78 #include "CUpdateAgent.h" 79 79 #include "CVRDEServer.h" 80 #include "CVRDEServerInfo.h" 80 81 81 82 /* Other VBox stuff: */ … … 745 746 746 747 /* static */ 748 void UINotificationMessage::cannotAcquireVRDEServerInfoParameter(const CVRDEServerInfo &comVRDEServerInfo) 749 { 750 createMessage( 751 QApplication::translate("UIMessageCenter", "VRDE Server Info failure ..."), 752 QApplication::translate("UIMessageCenter", "Failed to acquire VRDE server parameter.") + 753 UIErrorString::formatErrorInfo(comVRDEServerInfo)); 754 } 755 756 /* static */ 747 757 void UINotificationMessage::cannotAcquireSnapshotParameter(const CSnapshot &comSnapshot) 748 758 { … … 906 916 QApplication::translate("UIMessageCenter", "Failed to acquire cloud machine parameter.") + 907 917 UIErrorString::formatErrorInfo(comCloudMachine), 918 QString(), QString(), pParent); 919 } 920 921 /* static */ 922 void UINotificationMessage::cannotAcquireGuestParameter(const CGuest &comGuest, UINotificationCenter *pParent /* = 0 */) 923 { 924 createMessage( 925 QApplication::translate("UIMessageCenter", "Guest failure ..."), 926 QApplication::translate("UIMessageCenter", "Failed to acquire guest parameter.") + 927 UIErrorString::formatErrorInfo(comGuest), 908 928 QString(), QString(), pParent); 909 929 } -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r98784 r98786 81 81 class CVirtualBoxErrorInfo; 82 82 class CVRDEServer; 83 class CVRDEServerInfo; 83 84 class CUnattended; 85 84 86 85 87 /** UINotificationObject extension for message functionality. */ … … 355 357 * @param comServer Brings the object parameter get acquired from. */ 356 358 static void cannotAcquireVRDEServerParameter(const CVRDEServer &comServer); 359 /** Notifies about inability to acquire IVRDEServerInfo parameter. 360 * @param comVRDEServerInfo Brings the object parameter get acquired from. */ 361 static void cannotAcquireVRDEServerInfoParameter(const CVRDEServerInfo &comVRDEServerInfo); 357 362 /** Notifies about inability to acquire IVirtualSystemDescription parameter. 358 363 * @param comVsd Brings the object parameter get acquired from. */ … … 379 384 static void cannotAcquireCloudMachineParameter(const CCloudMachine &comCloudMachine, 380 385 UINotificationCenter *pParent = 0); 386 /** Notifies about inability to acquire IGuest parameter. 387 * @param comGuest Brings the object parameter get acquired from. */ 388 static void cannotAcquireGuestParameter(const CGuest &comGuest, 389 UINotificationCenter *pParent = 0); 381 390 382 391 /** Notifies about inability to change IMedium parameter. -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98784 r98786 672 672 } 673 673 674 bool UIMachine::acquireGuestAdditionsVersion(QString &strGAVersion) 675 { 676 return uisession()->acquireGuestAdditionsVersion(strGAVersion); 677 } 678 bool UIMachine::acquireGuestAdditionsRevision(ULONG &uRevision) 679 { 680 return uisession()->acquireGuestAdditionsRevision(uRevision); 681 } 682 674 683 bool UIMachine::putScancode(LONG iCode) 675 684 { … … 790 799 { 791 800 return uisession()->setNetworkCableConnected(uSlot, fConnected); 801 } 802 803 bool UIMachine::acquireVRDEServerPort(LONG &uPort) 804 { 805 return uisession()->acquireVRDEServerPort(uPort); 792 806 } 793 807 … … 923 937 { 924 938 return uisession()->acquireEffectiveCPULoad(uLoad); 939 } 940 941 bool UIMachine::acquireUptime(LONG64 &uLoad) 942 { 943 return uisession()->acquireUptime(uLoad); 925 944 } 926 945 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98784 r98786 398 398 /** Returns whether guest additions supports seamless. */ 399 399 bool isGuestSupportsSeamless() const; 400 /** Acquires the guest addition's version. */ 401 bool acquireGuestAdditionsVersion(QString &strGAVersion); 402 /** Acquires the guest addition's revision. */ 403 bool acquireGuestAdditionsRevision(ULONG &uRevision); 400 404 /** @} */ 401 405 … … 541 545 /** Set whether network adapter cable is connected. */ 542 546 bool setNetworkCableConnected(ulong uSlot, bool fConnected); 547 /** Acquires VRDE server port. */ 548 bool acquireVRDEServerPort(LONG &uPort); 543 549 /** @} */ 544 550 … … 596 602 /** Acquires effective CPU @a uLoad. */ 597 603 bool acquireEffectiveCPULoad(ulong &uLoad); 604 /** Acquires uptime @a uUpTime as milliseconds. */ 605 bool acquireUptime(LONG64 &uUpTime); 598 606 599 607 #ifdef VBOX_WITH_DEBUGGER_GUI -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98784 r98786 79 79 #include "CUSBDeviceFilters.h" 80 80 #include "CVRDEServer.h" 81 #include "CVRDEServerInfo.h" 81 82 #ifdef VBOX_WITH_NETFLT 82 83 # include "CNetworkAdapter.h" … … 889 890 } 890 891 892 bool UISession::acquireVRDEServerPort(LONG &uPort) 893 { 894 CConsole comConsole = console(); 895 CVRDEServerInfo comVRDEServerInfo = comConsole.GetVRDEServerInfo(); 896 bool fSuccess = comConsole.isOk(); 897 898 if (!fSuccess) 899 UINotificationMessage::cannotAcquireConsoleParameter(comConsole); 900 LONG uVRDEPort = comVRDEServerInfo.GetPort(); 901 fSuccess = comVRDEServerInfo.isOk(); 902 903 if (!fSuccess) 904 UINotificationMessage::cannotAcquireVRDEServerInfoParameter(comVRDEServerInfo); 905 uPort = uVRDEPort; 906 return fSuccess; 907 } 908 891 909 bool UISession::guestAdditionsUpgradable() 892 910 { … … 910 928 911 929 return true; 930 } 931 932 bool UISession::acquireGuestAdditionsVersion(QString &strGAVersion) 933 { 934 CGuest &comGuest = guest(); 935 QString strVersion = comGuest.GetAdditionsVersion(); 936 const bool fSuccess = comGuest.isOk(); 937 if (!fSuccess) 938 UINotificationMessage::cannotAcquireGuestParameter(comGuest); 939 else 940 strGAVersion = strVersion; 941 return fSuccess; 942 } 943 944 bool UISession::acquireGuestAdditionsRevision(ULONG &uRevision) 945 { 946 CGuest &comGuest = guest(); 947 ULONG uRev = comGuest.GetAdditionsRevision(); 948 const bool fSuccess = comGuest.isOk(); 949 if (!fSuccess) 950 UINotificationMessage::cannotAcquireGuestParameter(comGuest); 951 else 952 uRevision = uRev; 953 return fSuccess; 912 954 } 913 955 … … 1669 1711 else 1670 1712 uLoad = uPctExecuting + uPctOther; 1713 return fSuccess; 1714 } 1715 1716 bool UISession::acquireUptime(LONG64 &uUpTime) 1717 { 1718 CMachineDebugger comDebugger = debugger(); 1719 LONG64 uTime = comDebugger.GetUptime(); 1720 const bool fSuccess = comDebugger.isOk(); 1721 if (!fSuccess) 1722 UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger); 1723 else 1724 uUpTime = uTime; 1671 1725 return fSuccess; 1672 1726 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98784 r98786 358 358 /** Set whether network adapter cable is connected. */ 359 359 bool setNetworkCableConnected(ulong uSlot, bool fConnected); 360 /** Acquires VRDE server port. */ 361 bool acquireVRDEServerPort(LONG &uPort); 360 362 /** @} */ 361 363 … … 372 374 /** Returns whether GA can be upgraded. */ 373 375 bool guestAdditionsUpgradable(); 376 /** Acquires the guest addition's version. */ 377 bool acquireGuestAdditionsVersion(QString &strGAVersion); 378 /** Acquires the guest addition's revision. */ 379 bool acquireGuestAdditionsRevision(ULONG &uRevision); 374 380 /** @} */ 375 381 … … 511 517 /** Acquires effective CPU @a uLoad. */ 512 518 bool acquireEffectiveCPULoad(ulong &uLoad); 519 /** Acquires uptime @a uUpTime. */ 520 bool acquireUptime(LONG64 &uUpTime); 513 521 514 522 #ifdef VBOX_WITH_DEBUGGER_GUI -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r98385 r98786 46 46 #include "CDisplay.h" 47 47 #include "CGraphicsAdapter.h" 48 #include "CGuest.h"49 48 #include "CMachineDebugger.h" 50 49 #include "CVRDEServerInfo.h" … … 252 251 QString UIRuntimeInfoWidget::screenResolution(int iScreenID) 253 252 { 253 AssertPtrReturn(gpMachine, QString()); 254 254 /* Determine resolution: */ 255 ULONGuWidth = 0;256 ULONGuHeight = 0;257 ULONGuBpp = 0;258 LONGxOrigin = 0;259 LONGyOrigin = 0;255 ulong uWidth = 0; 256 ulong uHeight = 0; 257 ulong uBpp = 0; 258 long xOrigin = 0; 259 long yOrigin = 0; 260 260 KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled; 261 m_console.GetDisplay().GetScreenResolution(iScreenID, uWidth, uHeight, uBpp, xOrigin, yOrigin, monitorStatus);261 gpMachine->acquireGuestScreenParameters(iScreenID, uWidth, uHeight, uBpp, xOrigin, yOrigin, monitorStatus); 262 262 QString strResolution = QString("%1x%2").arg(uWidth).arg(uHeight); 263 263 if (uBpp) … … 312 312 void UIRuntimeInfoWidget::updateUpTime() 313 313 { 314 CMachineDebugger debugger = m_console.GetDebugger(); 315 uint32_t uUpSecs = (debugger.GetUptime() / 5000) * 5; 314 AssertPtrReturnVoid(gpMachine); 315 LONG64 uUptime; 316 if (!gpMachine->acquireUptime(uUptime)) 317 return; 318 uint64_t uUpSecs = (uUptime / 5000) * 5; 316 319 char szUptime[32]; 317 uint 32_t uUpDays = uUpSecs / (60 * 60 * 24);320 uint64_t uUpDays = uUpSecs / (60 * 60 * 24); 318 321 uUpSecs -= uUpDays * 60 * 60 * 24; 319 uint 32_t uUpHours = uUpSecs / (60 * 60);322 uint64_t uUpHours = uUpSecs / (60 * 60); 320 323 uUpSecs -= uUpHours * 60 * 60; 321 uint 32_t uUpMins = uUpSecs / 60;324 uint64_t uUpMins = uUpSecs / 60; 322 325 uUpSecs -= uUpMins * 60; 323 326 RTStrPrintf(szUptime, sizeof(szUptime), "%dd %02d:%02d:%02d", … … 344 347 void UIRuntimeInfoWidget::updateOSTypeRow() 345 348 { 346 QString strOSType = m_console.GetGuest().GetOSTypeId(); 349 AssertPtrReturnVoid(gpMachine); 350 QString strOSType = gpMachine->osTypeId(); 347 351 if (strOSType.isEmpty()) 348 352 strOSType = m_strOSNotDetected; … … 354 358 void UIRuntimeInfoWidget::updateVirtualizationInfo() 355 359 { 356 357 /* Determine virtualization attributes: */ 358 CMachineDebugger debugger = m_console.GetDebugger(); 360 AssertPtrReturnVoid(gpMachine); 361 KVMExecutionEngine enmExecutionEngineType = gpMachine->vmExecutionEngine(); 359 362 360 363 QString strExecutionEngine; 361 switch ( debugger.GetExecutionEngine())364 switch (enmExecutionEngineType) 362 365 { 363 366 case KVMExecutionEngine_HwVirt: … … 377 380 break; 378 381 } 379 QString strNestedPaging = debugger.GetHWVirtExNestedPagingEnabled() ?382 QString strNestedPaging = gpMachine->isHWVirtExNestedPagingEnabled() ? 380 383 m_strNestedPagingActive : m_strNestedPagingInactive; 381 QString strUnrestrictedExecution = debugger.GetHWVirtExUXEnabled() ?384 QString strUnrestrictedExecution = gpMachine->isHWVirtExUXEnabled() ? 382 385 m_strUnrestrictedExecutionActive : m_strUnrestrictedExecutionInactive; 383 386 QString strParavirtProvider = gpConverter->toString(m_machine.GetEffectiveParavirtProvider()); … … 391 394 void UIRuntimeInfoWidget::updateGAsVersion() 392 395 { 393 CGuest guest = m_console.GetGuest(); 394 QString strGAVersion = guest.GetAdditionsVersion(); 396 AssertPtrReturnVoid(gpMachine); 397 QString strGAVersion; 398 gpMachine->acquireGuestAdditionsVersion(strGAVersion); 395 399 if (strGAVersion.isEmpty()) 396 400 strGAVersion = m_strGANotDetected; 397 401 else 398 402 { 399 ULONG uRevision = guest.GetAdditionsRevision(); 403 ULONG uRevision = 0; 404 gpMachine->acquireGuestAdditionsRevision(uRevision); 400 405 if (uRevision != 0) 401 406 strGAVersion += QString(" r%1").arg(uRevision); … … 406 411 void UIRuntimeInfoWidget::updateVRDE() 407 412 { 408 int iVRDEPort = m_console.GetVRDEServerInfo().GetPort(); 413 AssertPtrReturnVoid(gpMachine); 414 LONG iVRDEPort = 0; 415 gpMachine->acquireVRDEServerPort(iVRDEPort); 409 416 QString strVRDEInfo = (iVRDEPort == 0 || iVRDEPort == -1) ? 410 417 m_strVRDEPortNotAvailable : QString("%1").arg(iVRDEPort); … … 507 514 , m_pCopyWholeTableAction(0) 508 515 { 509 if (!m_console.isNull())510 m_comGuest = m_console.GetGuest();511 516 connect(pMachine, &UIMachine::sigAdditionsStateChange, this, &UIInformationRuntime::sltGuestAdditionsStateChange); 512 517 connect(pMachine, &UIMachine::sigGuestMonitorChange, this, &UIInformationRuntime::sltGuestMonitorChange); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h
r98385 r98786 38 38 #include "COMEnums.h" 39 39 #include "CConsole.h" 40 #include "CGuest.h"41 40 #include "CMachine.h" 42 41 … … 86 85 CMachine m_machine; 87 86 CConsole m_console; 88 CGuest m_comGuest;89 87 90 88 /** Holds the instance of layout we create. */
Note:
See TracChangeset
for help on using the changeset viewer.