VirtualBox

Changeset 98801 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 1, 2023 8:39:09 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156120
Message:

FE/Qt: bugref:10322: Runtime UI: A bit of fixes for r156071 and r156097.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r98786 r98801  
    746746
    747747/* 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));
     748void UINotificationMessage::cannotAcquireGuestParameter(const CGuest &comGuest)
     749{
     750    createMessage(
     751        QApplication::translate("UIMessageCenter", "Guest failure ..."),
     752        QApplication::translate("UIMessageCenter", "Failed to acquire guest parameter.") +
     753        UIErrorString::formatErrorInfo(comGuest));
    754754}
    755755
     
    851851        QApplication::translate("UIMessageCenter", "Failed to acquire VRDE server parameter.") +
    852852        UIErrorString::formatErrorInfo(comServer));
     853}
     854
     855/* static */
     856void UINotificationMessage::cannotAcquireVRDEServerInfoParameter(const CVRDEServerInfo &comServerInfo)
     857{
     858    createMessage(
     859        QApplication::translate("UIMessageCenter", "VRDE server info failure ..."),
     860        QApplication::translate("UIMessageCenter", "Failed to acquire VRDE server info parameter.") +
     861        UIErrorString::formatErrorInfo(comServerInfo));
    853862}
    854863
     
    916925        QApplication::translate("UIMessageCenter", "Failed to acquire cloud machine parameter.") +
    917926        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),
    928927        QString(), QString(), pParent);
    929928}
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r98786 r98801  
    8383class CVRDEServerInfo;
    8484class CUnattended;
    85 
    8685
    8786/** UINotificationObject extension for message functionality. */
     
    324323          * @param  comConsole  Brings the object parameter get acquired from. */
    325324        static void cannotAcquireConsoleParameter(const CConsole &comConsole);
     325        /** Notifies about inability to acquire IGuest parameter.
     326          * @param  comGuest  Brings the object parameter get acquired from. */
     327        static void cannotAcquireGuestParameter(const CGuest &comGuest);
    326328        /** Notifies about inability to acquire ISnapshot parameter.
    327329          * @param  comSnapshot  Brings the object parameter get acquired from. */
     
    384386        static void cannotAcquireCloudMachineParameter(const CCloudMachine &comCloudMachine,
    385387                                                       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);
    390388
    391389        /** Notifies about inability to change IMedium parameter.
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98787 r98801  
    642642}
    643643
     644bool UIMachine::acquireVRDEServerPort(long &iPort)
     645{
     646    return uisession()->acquireVRDEServerPort(iPort);
     647}
     648
    644649bool UIMachine::acquireWhetherRecordingSettingsPresent(bool &fPresent)
    645650{
     
    672677}
    673678
    674 bool UIMachine::acquireGuestAdditionsVersion(QString &strGAVersion)
    675 {
    676     return uisession()->acquireGuestAdditionsVersion(strGAVersion);
    677 }
    678 bool UIMachine::acquireGuestAdditionsRevision(ULONG &uRevision)
     679bool UIMachine::acquireGuestAdditionsVersion(QString &strVersion)
     680{
     681    return uisession()->acquireGuestAdditionsVersion(strVersion);
     682}
     683
     684bool UIMachine::acquireGuestAdditionsRevision(ulong &uRevision)
    679685{
    680686    return uisession()->acquireGuestAdditionsRevision(uRevision);
     
    804810{
    805811    return uisession()->setNetworkCableConnected(uSlot, fConnected);
    806 }
    807 
    808 bool UIMachine::acquireVRDEServerPort(LONG &uPort)
    809 {
    810     return uisession()->acquireVRDEServerPort(uPort);
    811812}
    812813
     
    944945}
    945946
    946 bool UIMachine::acquireUptime(LONG64 &uLoad)
    947 {
    948     return uisession()->acquireUptime(uLoad);
     947bool UIMachine::acquireUptime(LONG64 &iUpTime)
     948{
     949    return uisession()->acquireUptime(iUpTime);
    949950}
    950951
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98787 r98801  
    382382        /** Defines whether VRDE server is enabled. */
    383383        bool setVRDEServerEnabled(bool fEnabled);
     384        /** Acquires VRDE server port. */
     385        bool acquireVRDEServerPort(long &iPort);
    384386
    385387        /** Acquires whether recording settings is present. */
     
    400402        bool isGuestSupportsSeamless() const;
    401403        /** Acquires the guest addition's version. */
    402         bool acquireGuestAdditionsVersion(QString &strGAVersion);
     404        bool acquireGuestAdditionsVersion(QString &strVersion);
    403405        /** Acquires the guest addition's revision. */
    404         bool acquireGuestAdditionsRevision(ULONG &uRevision);
     406        bool acquireGuestAdditionsRevision(ulong &uRevision);
    405407    /** @} */
    406408
     
    548550        /** Set whether network adapter cable is connected. */
    549551        bool setNetworkCableConnected(ulong uSlot, bool fConnected);
    550         /** Acquires VRDE server port. */
    551         bool acquireVRDEServerPort(LONG &uPort);
    552552    /** @} */
    553553
     
    605605        /** Acquires effective CPU @a uLoad. */
    606606        bool acquireEffectiveCPULoad(ulong &uLoad);
    607         /** Acquires uptime @a uUpTime as milliseconds. */
    608         bool acquireUptime(LONG64 &uUpTime);
     607        /** Acquires uptime @a iUpTime as milliseconds. */
     608        bool acquireUptime(LONG64 &iUpTime);
    609609
    610610#ifdef VBOX_WITH_DEBUGGER_GUI
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98787 r98801  
    945945}
    946946
    947 bool UISession::acquireVRDEServerPort(LONG &uPort)
    948 {
    949     CConsole comConsole = console();
    950     CVRDEServerInfo comVRDEServerInfo = comConsole.GetVRDEServerInfo();
    951     bool fSuccess = comConsole.isOk();
    952 
    953     if (!fSuccess)
    954         UINotificationMessage::cannotAcquireConsoleParameter(comConsole);
    955     LONG uVRDEPort = comVRDEServerInfo.GetPort();
    956     fSuccess = comVRDEServerInfo.isOk();
    957 
    958     if (!fSuccess)
    959         UINotificationMessage::cannotAcquireVRDEServerInfoParameter(comVRDEServerInfo);
    960     uPort = uVRDEPort;
    961     return fSuccess;
    962 }
    963 
    964947bool UISession::guestAdditionsUpgradable()
    965948{
     
    985968}
    986969
    987 bool UISession::acquireGuestAdditionsVersion(QString &strGAVersion)
    988 {
    989     CGuest &comGuest = guest();
    990     QString strVersion = comGuest.GetAdditionsVersion();
     970bool UISession::acquireGuestAdditionsVersion(QString &strVersion)
     971{
     972    CGuest comGuest = guest();
     973    const QString strGAVersion = comGuest.GetAdditionsVersion();
    991974    const bool fSuccess = comGuest.isOk();
    992975    if (!fSuccess)
    993976        UINotificationMessage::cannotAcquireGuestParameter(comGuest);
    994977    else
    995         strGAVersion = strVersion;
    996     return fSuccess;
    997 }
    998 
    999 bool UISession::acquireGuestAdditionsRevision(ULONG &uRevision)
    1000 {
    1001     CGuest &comGuest = guest();
    1002     ULONG uRev = comGuest.GetAdditionsRevision();
     978        strVersion = strGAVersion;
     979    return fSuccess;
     980}
     981
     982bool UISession::acquireGuestAdditionsRevision(ulong &uRevision)
     983{
     984    CGuest comGuest = guest();
     985    const ULONG uGARevision = comGuest.GetAdditionsRevision();
    1003986    const bool fSuccess = comGuest.isOk();
    1004987    if (!fSuccess)
    1005988        UINotificationMessage::cannotAcquireGuestParameter(comGuest);
    1006989    else
    1007         uRevision = uRev;
     990        uRevision = uGARevision;
    1008991    return fSuccess;
    1009992}
     
    14971480}
    14981481
     1482bool UISession::acquireVRDEServerPort(long &iPort)
     1483{
     1484    CConsole comConsole = console();
     1485    const CVRDEServerInfo comVRDEServerInfo = comConsole.GetVRDEServerInfo();
     1486    bool fSuccess = comConsole.isOk();
     1487    if (!fSuccess)
     1488        UINotificationMessage::cannotAcquireConsoleParameter(comConsole);
     1489    else
     1490    {
     1491        const LONG iVRDEPort = comVRDEServerInfo.GetPort();
     1492        fSuccess = comVRDEServerInfo.isOk();
     1493        if (!fSuccess)
     1494            UINotificationMessage::cannotAcquireVRDEServerInfoParameter(comVRDEServerInfo);
     1495        else
     1496            iPort = iVRDEPort;
     1497    }
     1498    return fSuccess;
     1499}
     1500
    14991501bool UISession::acquireWhetherRecordingSettingsPresent(bool &fPresent)
    15001502{
     
    16511653
    16521654void UISession::generateMachineInformationAudio(const UIExtraDataMetaDefs::DetailsElementOptionTypeAudio &fOptions,
    1653                                         UITextTable &returnTable)
     1655                                                UITextTable &returnTable)
    16541656{
    16551657    CMachine comMachine = machine();
     
    16581660
    16591661void UISession::generateMachineInformationNetwork(const UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork &fOptions,
    1660                                         UITextTable &returnTable)
     1662                                                  UITextTable &returnTable)
    16611663{
    16621664    CMachine comMachine = machine();
     
    16641666}
    16651667void UISession::generateMachineInformationSerial(const UIExtraDataMetaDefs::DetailsElementOptionTypeSerial &fOptions,
    1666                                         UITextTable &returnTable)
     1668                                                 UITextTable &returnTable)
    16671669{
    16681670    CMachine comMachine = machine();
     
    16711673
    16721674void UISession::generateMachineInformationUSB(const UIExtraDataMetaDefs::DetailsElementOptionTypeUsb &fOptions,
    1673                                         UITextTable &returnTable)
     1675                                              UITextTable &returnTable)
    16741676{
    16751677    CMachine comMachine = machine();
     
    17691771}
    17701772
    1771 bool UISession::acquireUptime(LONG64 &uUpTime)
     1773bool UISession::acquireUptime(LONG64 &iUpTime)
    17721774{
    17731775    CMachineDebugger comDebugger = debugger();
    1774     LONG64 uTime = comDebugger.GetUptime();
     1776    const LONG64 iGuestUpTime = comDebugger.GetUptime();
    17751777    const bool fSuccess = comDebugger.isOk();
    17761778    if (!fSuccess)
    17771779        UINotificationMessage::cannotAcquireMachineDebuggerParameter(comDebugger);
    17781780    else
    1779         uUpTime = uTime;
     1781        iUpTime = iGuestUpTime;
    17801782    return fSuccess;
    17811783}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98787 r98801  
    361361        /** Set whether network adapter cable is connected. */
    362362        bool setNetworkCableConnected(ulong uSlot, bool fConnected);
    363         /** Acquires VRDE server port. */
    364         bool acquireVRDEServerPort(LONG &uPort);
    365363    /** @} */
    366364
     
    378376        bool guestAdditionsUpgradable();
    379377        /** Acquires the guest addition's version. */
    380         bool acquireGuestAdditionsVersion(QString &strGAVersion);
     378        bool acquireGuestAdditionsVersion(QString &strVersion);
    381379        /** Acquires the guest addition's revision. */
    382         bool acquireGuestAdditionsRevision(ULONG &uRevision);
     380        bool acquireGuestAdditionsRevision(ulong &uRevision);
    383381    /** @} */
    384382
     
    463461        /** Defines whether VRDE server is enabled. */
    464462        bool setVRDEServerEnabled(bool fEnabled);
     463        /** Acquires VRDE server port. */
     464        bool acquireVRDEServerPort(long &iPort);
    465465
    466466        /** Acquires whether recording settings is present. */
     
    520520        /** Acquires effective CPU @a uLoad. */
    521521        bool acquireEffectiveCPULoad(ulong &uLoad);
    522         /** Acquires uptime @a uUpTime. */
    523         bool acquireUptime(LONG64 &uUpTime);
     522        /** Acquires uptime @a iUpTime as milliseconds. */
     523        bool acquireUptime(LONG64 &iUpTime);
    524524
    525525#ifdef VBOX_WITH_DEBUGGER_GUI
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r98786 r98801  
    401401    else
    402402    {
    403         ULONG uRevision = 0;
     403        ulong uRevision = 0;
    404404        gpMachine->acquireGuestAdditionsRevision(uRevision);
    405405        if (uRevision != 0)
     
    412412{
    413413    AssertPtrReturnVoid(gpMachine);
    414     LONG iVRDEPort = 0;
     414    long iVRDEPort = 0;
    415415    gpMachine->acquireVRDEServerPort(iVRDEPort);
    416     QString strVRDEInfo = (iVRDEPort == 0 || iVRDEPort == -1) ?
    417         m_strVRDEPortNotAvailable : QString("%1").arg(iVRDEPort);
    418    updateInfoRow(InfoRow_RemoteDesktop, QString("%1").arg(m_strRemoteDesktopLabel), strVRDEInfo);
     416    const QString strVRDEInfo = (iVRDEPort == 0 || iVRDEPort == -1)
     417                              ? m_strVRDEPortNotAvailable
     418                              : QString("%1").arg(iVRDEPort);
     419    updateInfoRow(InfoRow_RemoteDesktop, QString("%1").arg(m_strRemoteDesktopLabel), strVRDEInfo);
    419420}
    420421
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette