VirtualBox

Changeset 98382 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 1, 2023 12:59:50 PM (23 months ago)
Author:
vboxsync
Message:

Merging r155235 and r155243 from gui4 branch: FE/Qt: Runtime UI: Small cleanup in UISession code related to action-pool, additions stuff and UIConsoleEventHandler.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3:79645-79692
        21 /branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228
         21/branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243
        2222/trunk/src:92342,154921
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2/src/VBox:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3/src/VBox:79645-79692
        21 /branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228
         21/branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243
  • trunk/src/VBox/Frontends

    • Property svn:mergeinfo
      •  

        old new  
        1616/branches/dsen/gui2/src/VBox/Frontends:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        1717/branches/dsen/gui3/src/VBox/Frontends:79645-79692
        18 /branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228
         18/branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp

    r98309 r98382  
    450450        {
    451451            CKeyboardLedsChangedEvent comEventSpecific(pEvent);
    452             emit sigKeyboardLedsChangeEvent(comEventSpecific.GetNumLock(),
    453                                             comEventSpecific.GetCapsLock(),
    454                                             comEventSpecific.GetScrollLock());
     452            emit sigKeyboardLedsChange(comEventSpecific.GetNumLock(),
     453                                       comEventSpecific.GetCapsLock(),
     454                                       comEventSpecific.GetScrollLock());
    455455            break;
    456456        }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r98309 r98382  
    169169        void sigCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY);
    170170        /** Notifies about keyboard LEDs change for @a fNumLock, @a fCapsLock and @a fScrollLock. */
    171         void sigKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock);
     171        void sigKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
    172172        /** Notifies about machine @a state change. */
    173173        void sigStateChange(KMachineState state);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp

    r98377 r98382  
    6363    void sigCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY);
    6464    /** Notifies about keyboard LEDs change for @a fNumLock, @a fCapsLock and @a fScrollLock. */
    65     void sigKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock);
     65    void sigKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
    6666    /** Notifies about machine @a state change. */
    6767    void sigStateChange(KMachineState state);
     
    251251           this, &UIConsoleEventHandlerProxy::sigCursorPositionChange,
    252252            Qt::DirectConnection);
    253     connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigKeyboardLedsChangeEvent,
    254             this, &UIConsoleEventHandlerProxy::sigKeyboardLedsChangeEvent,
     253    connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigKeyboardLedsChange,
     254            this, &UIConsoleEventHandlerProxy::sigKeyboardLedsChange,
    255255            Qt::DirectConnection);
    256256    connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigStateChange,
     
    359359            this, &UIConsoleEventHandler::sigCursorPositionChange,
    360360            Qt::QueuedConnection);
    361     connect(m_pProxy, &UIConsoleEventHandlerProxy::sigKeyboardLedsChangeEvent,
    362             this, &UIConsoleEventHandler::sigKeyboardLedsChangeEvent,
     361    connect(m_pProxy, &UIConsoleEventHandlerProxy::sigKeyboardLedsChange,
     362            this, &UIConsoleEventHandler::sigKeyboardLedsChange,
    363363            Qt::QueuedConnection);
    364364    connect(m_pProxy, &UIConsoleEventHandlerProxy::sigStateChange,
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h

    r98377 r98382  
    6868    void sigCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY);
    6969    /** Notifies about keyboard LEDs change for @a fNumLock, @a fCapsLock and @a fScrollLock. */
    70     void sigKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock);
     70    void sigKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
    7171    /** Notifies about machine @a state change. */
    7272    void sigStateChange(KMachineState state);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98379 r98382  
    6868#include "CAudioSettings.h"
    6969#include "CGraphicsAdapter.h"
     70#include "CHostNetworkInterface.h"
    7071#include "CHostUSBDevice.h"
    71 #include "CRecordingSettings.h"
    72 #include "CSystemProperties.h"
    73 #include "CStorageController.h"
     72#include "CHostVideoInputDevice.h"
     73#include "CMedium.h"
    7474#include "CMediumAttachment.h"
    7575#include "CNetworkAdapter.h"
    76 #include "CHostNetworkInterface.h"
    77 #include "CVRDEServer.h"
     76#include "CSnapshot.h"
     77#include "CRecordingSettings.h"
     78#include "CStorageController.h"
     79#include "CSystemProperties.h"
    7880#include "CUSBController.h"
    7981#include "CUSBDeviceFilter.h"
    8082#include "CUSBDeviceFilters.h"
    81 #include "CHostVideoInputDevice.h"
    82 #include "CSnapshot.h"
    83 #include "CMedium.h"
     83#include "CVRDEServer.h"
    8484
    8585/* External includes: */
     
    408408}
    409409
     410bool UISession::guestAdditionsUpgradable()
     411{
     412    if (!machine().isOk())
     413        return false;
     414
     415    /* Auto GA update is currently for Windows and Linux guests only */
     416    const CGuestOSType osType = uiCommon().vmGuestOSType(machine().GetOSTypeId());
     417    if (!osType.isOk())
     418        return false;
     419
     420    const QString strGuestFamily = osType.GetFamilyId();
     421    bool fIsWindowOrLinux = strGuestFamily.contains("windows", Qt::CaseInsensitive) || strGuestFamily.contains("linux", Qt::CaseInsensitive);
     422
     423    if (!fIsWindowOrLinux)
     424        return false;
     425
     426    /* Also check whether we have something to update automatically: */
     427    if (m_ulGuestAdditionsRunLevel < (ULONG)KAdditionsRunLevelType_Userland)
     428        return false;
     429
     430    return true;
     431}
     432
    410433bool UISession::setPause(bool fOn)
    411434{
     
    495518#endif /* RT_OS_DARWIN */
    496519
    497 void UISession::sltKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock)
     520void UISession::sltKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock)
    498521{
    499522    /* Check if something had changed: */
     
    767790void UISession::sltAdditionsChange()
    768791{
    769     /* Variable flags: */
    770     ULONG ulGuestAdditionsRunLevel = guest().GetAdditionsRunLevel();
     792    /* Acquire actual states: */
     793    const ULONG ulGuestAdditionsRunLevel = guest().GetAdditionsRunLevel();
    771794    LONG64 lLastUpdatedIgnored;
    772     bool fIsGuestSupportsGraphics = guest().GetFacilityStatus(KAdditionsFacilityType_Graphics, lLastUpdatedIgnored)
    773                                     == KAdditionsFacilityStatus_Active;
    774     bool fIsGuestSupportsSeamless = guest().GetFacilityStatus(KAdditionsFacilityType_Seamless, lLastUpdatedIgnored)
    775                                     == KAdditionsFacilityStatus_Active;
     795    const bool fIsGuestSupportsGraphics = guest().GetFacilityStatus(KAdditionsFacilityType_Graphics, lLastUpdatedIgnored)
     796                                        == KAdditionsFacilityStatus_Active;
     797    const bool fIsGuestSupportsSeamless = guest().GetFacilityStatus(KAdditionsFacilityType_Seamless, lLastUpdatedIgnored)
     798                                        == KAdditionsFacilityStatus_Active;
     799
    776800    /* Check if something had changed: */
    777     if (m_ulGuestAdditionsRunLevel != ulGuestAdditionsRunLevel ||
    778         m_fIsGuestSupportsGraphics != fIsGuestSupportsGraphics ||
    779         m_fIsGuestSupportsSeamless != fIsGuestSupportsSeamless)
     801    if (   m_ulGuestAdditionsRunLevel != ulGuestAdditionsRunLevel
     802        || m_fIsGuestSupportsGraphics != fIsGuestSupportsGraphics
     803        || m_fIsGuestSupportsSeamless != fIsGuestSupportsSeamless)
    780804    {
    781805        /* Store new data: */
     
    791815
    792816        /* Notify listeners about GA state really changed: */
    793         LogRel(("GUI: UISession::sltAdditionsChange: GA state really changed, notifying listeners\n"));
     817        LogRel(("GUI: UISession::sltAdditionsChange: GA state really changed, notifying listeners.\n"));
    794818        emit sigAdditionsStateActualChange();
    795819    }
     820    else
     821        LogRel(("GUI: UISession::sltAdditionsChange: GA state doesn't really changed, still notifying listeners.\n"));
    796822
    797823    /* Notify listeners about GA state change event came: */
    798     LogRel(("GUI: UISession::sltAdditionsChange: GA state change event came, notifying listeners\n"));
    799824    emit sigAdditionsStateChange();
    800825}
     
    940965    connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigCursorPositionChange,
    941966            this, &UISession::sigCursorPositionChange);
    942     connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigKeyboardLedsChangeEvent,
    943             this, &UISession::sltKeyboardLedsChangeEvent);
     967    connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigKeyboardLedsChange,
     968            this, &UISession::sltKeyboardLedsChange);
    944969    connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigStateChange,
    945970            this, &UISession::sltStateChange);
     
    17431768}
    17441769
    1745 bool UISession::guestAdditionsUpgradable()
    1746 {
    1747     if (!machine().isOk())
    1748         return false;
    1749 
    1750     /* Auto GA update is currently for Windows and Linux guests only */
    1751     const CGuestOSType osType = uiCommon().vmGuestOSType(machine().GetOSTypeId());
    1752     if (!osType.isOk())
    1753         return false;
    1754 
    1755     const QString strGuestFamily = osType.GetFamilyId();
    1756     bool fIsWindowOrLinux = strGuestFamily.contains("windows", Qt::CaseInsensitive) || strGuestFamily.contains("linux", Qt::CaseInsensitive);
    1757 
    1758     if (!fIsWindowOrLinux)
    1759         return false;
    1760 
    1761     /* Also check whether we have something to update automatically: */
    1762     const ULONG ulGuestAdditionsRunLevel = guest().GetAdditionsRunLevel();
    1763     if (ulGuestAdditionsRunLevel < (ULONG)KAdditionsRunLevelType_Userland)
    1764         return false;
    1765 
    1766     return true;
    1767 }
    1768 
    17691770#ifdef VBOX_GUI_WITH_KEYS_RESET_HANDLER
    17701771/**
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98379 r98382  
    165165    const QString& machineName() const { return m_strMachineName; }
    166166
    167     UIActionPool* actionPool() const { return m_pActionPool; }
    168167    KMachineState machineStatePrevious() const { return m_machineStatePrevious; }
    169168    KMachineState machineState() const { return m_machineState; }
     169    UIActionPool *actionPool() const { return m_pActionPool; }
    170170    UIMachineLogic* machineLogic() const;
    171171    QWidget* mainMachineWindow() const;
     
    232232     * detail of the Additions which the GUI should not ideally have to know. */
    233233    bool isGuestSupportsSeamless() const { return isGuestSupportsGraphics() && m_fIsGuestSupportsSeamless; }
     234    /** Returns whether GA can be upgraded. */
     235    bool guestAdditionsUpgradable();
    234236
    235237    /* Keyboard getters: */
     
    334336
    335337    /* Console events slots */
    336     void sltKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock);
     338    void sltKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
    337339    void sltStateChange(KMachineState state);
    338340    void sltAdditionsChange();
     
    426428    /** Updates action restrictions. */
    427429    void updateActionRestrictions();
    428 
    429     /* Check if GA can be upgraded. */
    430     bool guestAdditionsUpgradable();
    431430
    432431    /* Private variables: */
Note: See TracChangeset for help on using the changeset viewer.

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