VirtualBox

Changeset 98384 in vbox for trunk


Ignore:
Timestamp:
Feb 1, 2023 1:04:15 PM (2 years ago)
Author:
vboxsync
Message:

Merging r155248 from gui4 branch: FE/Qt: Runtime UI: Move keyboard stuff from UISession to UIMachine; Not that heavy but dangerous rework.

Location:
trunk
Files:
12 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,155235,155243
         21/branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248
        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,155235,155243
         21/branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248
  • 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,155235,155243
         18/branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r98379 r98384  
    12601260        setStateIcon(7, UIIconPool::iconSet(":/hostkey_captured_pressed_checked_16px.png"));
    12611261        /* Configure connection: */
    1262         connect(pSession, &UISession::sigKeyboardStateChange,
     1262        connect(pMachine, &UIMachine::sigKeyboardStateChange,
    12631263                this, static_cast<void(UIIndicatorKeyboard::*)(int)>(&UIIndicatorKeyboard::setState));
    1264         setState(pSession->keyboardState());
     1264        setState(pMachine->keyboardState());
    12651265        /* Translate finally: */
    12661266        retranslateUi();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r98379 r98384  
    18331833#if defined(VBOX_WS_MAC)
    18341834
    1835     /* if (uisession()->numLockAdaptionCnt()) ... - NumLock isn't implemented by Mac OS X so ignore it. */
    1836     if (uisession()->capsLockAdaptionCnt() && (uisession()->isCapsLock() ^ !!(::GetCurrentEventKeyModifiers() & alphaLock)))
    1837     {
    1838         uisession()->setCapsLockAdaptionCnt(uisession()->capsLockAdaptionCnt() - 1);
     1835    /* if (uimachine()->numLockAdaptionCnt()) ... - NumLock isn't implemented by Mac OS X so ignore it. */
     1836    if (uimachine()->capsLockAdaptionCnt() && (uimachine()->isCapsLock() ^ !!(::GetCurrentEventKeyModifiers() & alphaLock)))
     1837    {
     1838        uimachine()->setCapsLockAdaptionCnt(uimachine()->capsLockAdaptionCnt() - 1);
    18391839        piCodes[(*puCount)++] = 0x3a;
    18401840        piCodes[(*puCount)++] = 0x3a | 0x80;
     
    18421842         * capslock.  For simplicity, only do this if shift is not
    18431843         * already held down. */
    1844         if (uisession()->isCapsLock() && !(m_pressedKeys[0x2a] & IsKeyPressed))
     1844        if (uimachine()->isCapsLock() && !(m_pressedKeys[0x2a] & IsKeyPressed))
    18451845        {
    18461846            piCodes[(*puCount)++] = 0x2a;
     
    18511851#elif defined(VBOX_WS_WIN)
    18521852
    1853     if (uisession()->numLockAdaptionCnt() && (uisession()->isNumLock() ^ !!(GetKeyState(VK_NUMLOCK))))
    1854     {
    1855         uisession()->setNumLockAdaptionCnt(uisession()->numLockAdaptionCnt() - 1);
     1853    if (uimachine()->numLockAdaptionCnt() && (uimachine()->isNumLock() ^ !!(GetKeyState(VK_NUMLOCK))))
     1854    {
     1855        uimachine()->setNumLockAdaptionCnt(uimachine()->numLockAdaptionCnt() - 1);
    18561856        piCodes[(*puCount)++] = 0x45;
    18571857        piCodes[(*puCount)++] = 0x45 | 0x80;
    18581858    }
    1859     if (uisession()->capsLockAdaptionCnt() && (uisession()->isCapsLock() ^ !!(GetKeyState(VK_CAPITAL))))
    1860     {
    1861         uisession()->setCapsLockAdaptionCnt(uisession()->capsLockAdaptionCnt() - 1);
     1859    if (uimachine()->capsLockAdaptionCnt() && (uimachine()->isCapsLock() ^ !!(GetKeyState(VK_CAPITAL))))
     1860    {
     1861        uimachine()->setCapsLockAdaptionCnt(uimachine()->capsLockAdaptionCnt() - 1);
    18621862        piCodes[(*puCount)++] = 0x3a;
    18631863        piCodes[(*puCount)++] = 0x3a | 0x80;
     
    18651865         * capslock.  For simplicity, only do this if shift is not
    18661866         * already held down. */
    1867         if (uisession()->isCapsLock() && !(m_pressedKeys[0x2a] & IsKeyPressed))
     1867        if (uimachine()->isCapsLock() && !(m_pressedKeys[0x2a] & IsKeyPressed))
    18681868        {
    18691869            piCodes[(*puCount)++] = 0x2a;
     
    18911891    XFreeModifiermap(map);
    18921892
    1893     if (uisession()->numLockAdaptionCnt() && (uisession()->isNumLock() ^ !!(uMask & uKeyMaskNum)))
    1894     {
    1895         uisession()->setNumLockAdaptionCnt(uisession()->numLockAdaptionCnt() - 1);
     1893    if (uimachine()->numLockAdaptionCnt() && (uimachine()->isNumLock() ^ !!(uMask & uKeyMaskNum)))
     1894    {
     1895        uimachine()->setNumLockAdaptionCnt(uimachine()->numLockAdaptionCnt() - 1);
    18961896        piCodes[(*puCount)++] = 0x45;
    18971897        piCodes[(*puCount)++] = 0x45 | 0x80;
    18981898    }
    1899     if (uisession()->capsLockAdaptionCnt() && (uisession()->isCapsLock() ^ !!(uMask & uKeyMaskCaps)))
    1900     {
    1901         uisession()->setCapsLockAdaptionCnt(uisession()->capsLockAdaptionCnt() - 1);
     1899    if (uimachine()->capsLockAdaptionCnt() && (uimachine()->isCapsLock() ^ !!(uMask & uKeyMaskCaps)))
     1900    {
     1901        uimachine()->setCapsLockAdaptionCnt(uimachine()->capsLockAdaptionCnt() - 1);
    19021902        piCodes[(*puCount)++] = 0x3a;
    19031903        piCodes[(*puCount)++] = 0x3a | 0x80;
     
    19051905         * capslock.  For simplicity, only do this if shift is not
    19061906         * already held down. */
    1907         if (uisession()->isCapsLock() && !(m_pressedKeys[0x2a] & IsKeyPressed))
     1907        if (uimachine()->isCapsLock() && !(m_pressedKeys[0x2a] & IsKeyPressed))
    19081908        {
    19091909            piCodes[(*puCount)++] = 0x2a;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98379 r98384  
    219219}
    220220
     221void UIMachine::sltHandleKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock)
     222{
     223    /* Check if something had changed: */
     224    if (   m_fNumLock != fNumLock
     225        || m_fCapsLock != fCapsLock
     226        || m_fScrollLock != fScrollLock)
     227    {
     228        /* Store new num lock data: */
     229        if (m_fNumLock != fNumLock)
     230        {
     231            m_fNumLock = fNumLock;
     232            m_uNumLockAdaptionCnt = 2;
     233        }
     234
     235        /* Store new caps lock data: */
     236        if (m_fCapsLock != fCapsLock)
     237        {
     238            m_fCapsLock = fCapsLock;
     239            m_uCapsLockAdaptionCnt = 2;
     240        }
     241
     242        /* Store new scroll lock data: */
     243        if (m_fScrollLock != fScrollLock)
     244        {
     245            m_fScrollLock = fScrollLock;
     246        }
     247
     248        /* Notify listeners: */
     249        emit sigKeyboardLedsChange();
     250    }
     251}
     252
    221253void UIMachine::sltMousePointerShapeChange(const UIMousePointerShapeData &shapeData)
    222254{
     
    312344    , m_pMachineLogic(0)
    313345    , m_pMachineWindowIcon(0)
     346    , m_fNumLock(false)
     347    , m_fCapsLock(false)
     348    , m_fScrollLock(false)
     349    , m_uNumLockAdaptionCnt(2)
     350    , m_uCapsLockAdaptionCnt(2)
     351    , m_iKeyboardState(0)
    314352    , m_fIsHidingHostPointer(true)
    315353    , m_fIsValidPointerShapePresent(false)
     
    366404void UIMachine::prepareSessionConnections()
    367405{
     406    /* Keyboard stuff: */
     407    connect(uisession(), &UISession::sigKeyboardLedsChange,
     408            this, &UIMachine::sltHandleKeyboardLedsChange);
     409
     410    /* Mouse stuff: */
    368411    connect(uisession(), &UISession::sigMousePointerShapeChange,
    369412            this, &UIMachine::sltMousePointerShapeChange);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98379 r98384  
    5959    /** Requests async visual-state change. */
    6060    void sigRequestAsyncVisualStateChange(UIVisualStateType visualStateType);
     61
     62    /** @name Keyboard stuff.
     63     ** @{ */
     64        /** Notifies about keyboard LEDs change. */
     65        void sigKeyboardLedsChange();
     66
     67        /** Notifies listeners about keyboard state-change. */
     68        void sigKeyboardStateChange(int iState);
     69    /** @} */
    6170
    6271    /** @name Mouse cursor stuff.
     
    111120        QString machineWindowNamePostfix() const { return m_strMachineWindowNamePostfix; }
    112121#endif
     122    /** @} */
     123
     124    /** @name Keyboard stuff.
     125     ** @{ */
     126        /** Returns the NUM lock status. */
     127        bool isNumLock() const { return m_fNumLock; }
     128        /** Returns the CAPS lock status. */
     129        bool isCapsLock() const { return m_fCapsLock; }
     130        /** Returns the SCROLL lock status. */
     131        bool isScrollLock() const { return m_fScrollLock; }
     132
     133        /** Returns the NUM lock adaption count. */
     134        uint numLockAdaptionCnt() const { return m_uNumLockAdaptionCnt; }
     135        /** Defines the NUM lock adaption @a uCount. */
     136        void setNumLockAdaptionCnt(uint uCount) { m_uNumLockAdaptionCnt = uCount; }
     137
     138        /** Returns the CAPS lock adaption count. */
     139        uint capsLockAdaptionCnt() const { return m_uCapsLockAdaptionCnt; }
     140        /** Defines the CAPS lock adaption @a uCount. */
     141        void setCapsLockAdaptionCnt(uint uCount) { m_uCapsLockAdaptionCnt = uCount; }
     142
     143        /** Returns the keyboard-state. */
     144        int keyboardState() const { return m_iKeyboardState; }
    113145    /** @} */
    114146
     
    159191public slots:
    160192
     193    /** @name Keyboard stuff.
     194     ** @{ */
     195        /** Defines @a iKeyboardState. */
     196        void setKeyboardState(int iKeyboardState) { m_iKeyboardState = iKeyboardState; emit sigKeyboardStateChange(m_iKeyboardState); }
     197    /** @} */
     198
    161199    /** @name Mouse cursor stuff.
    162200     ** @{ */
     
    172210    /** Visual state-change handler. */
    173211    void sltChangeVisualState(UIVisualStateType visualStateType);
     212
     213    /** @name Keyboard stuff.
     214     ** @{ */
     215        /** Handles signal about keyboard LEDs change.
     216          * @param  fNumLock     Brings NUM lock status.
     217          * @param  fCapsLock    Brings CAPS lock status.
     218          * @param  fScrollLock  Brings SCROLL lock status. */
     219        void sltHandleKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
     220    /** @} */
    174221
    175222    /** @name Mouse cursor stuff.
     
    217264    /** Cleanup routine: Machine-logic stuff. */
    218265    void cleanupMachineLogic();
    219     /** Cleanup machine-window icon. */
     266    /** Cleanup routine: Machine-window icon. */
    220267    void cleanupMachineWindowIcon();
    221268    /** Cleanup routine: Session stuff. */
     
    286333    /** @} */
    287334
     335    /** @name Keyboard stuff.
     336     ** @{ */
     337        /** Holds the NUM lock status. */
     338        bool  m_fNumLock;
     339        /** Holds the CAPS lock status. */
     340        bool  m_fCapsLock;
     341        /** Holds the SCROLL lock status. */
     342        bool  m_fScrollLock;
     343
     344        /** Holds the NUM lock adaption count. */
     345        uint  m_uNumLockAdaptionCnt;
     346        /** Holds the CAPS lock adaption count. */
     347        uint  m_uCapsLockAdaptionCnt;
     348
     349        /** Holds the keyboard-state. */
     350        int  m_iKeyboardState;
     351    /** @} */
     352
    288353    /** @name Mouse cursor stuff.
    289354     ** @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r98379 r98384  
    641641
    642642#if defined(VBOX_WS_MAC)
    643     DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock());
     643    DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uimachine()->isNumLock(), uimachine()->isCapsLock(), uimachine()->isScrollLock());
    644644#elif defined(VBOX_WS_WIN)
    645     if (!winHidLedsInSync(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock()))
     645    if (!winHidLedsInSync(uimachine()->isNumLock(), uimachine()->isCapsLock(), uimachine()->isScrollLock()))
    646646    {
    647647        keyboardHandler()->winSkipKeyboardEvents(true);
    648         WinHidDevicesBroadcastLeds(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock());
     648        WinHidDevicesBroadcastLeds(uimachine()->isNumLock(), uimachine()->isCapsLock(), uimachine()->isScrollLock());
    649649        keyboardHandler()->winSkipKeyboardEvents(false);
    650650    }
     
    811811    /* Set new handler: */
    812812    m_pKeyboardHandler = pKeyboardHandler;
    813     /* Connect to session: */
     813    /* Connect to uimachine: */
    814814    connect(m_pKeyboardHandler, &UIKeyboardHandler::sigStateChange,
    815             uisession(), &UISession::setKeyboardState);
     815            uimachine(), &UIMachine::setKeyboardState);
    816816}
    817817
     
    889889    connect(uisession(), &UISession::sigAdditionsStateActualChange, this, &UIMachineLogic::sltAdditionsStateChanged);
    890890    connect(uimachine(), &UIMachine::sigMouseCapabilityChange, this, &UIMachineLogic::sltMouseCapabilityChanged);
    891     connect(uisession(), &UISession::sigKeyboardLedsChange, this, &UIMachineLogic::sltKeyboardLedsChanged);
     891    connect(uimachine(), &UIMachine::sigKeyboardLedsChange, this, &UIMachineLogic::sltKeyboardLedsChanged);
    892892    connect(uisession(), &UISession::sigUSBDeviceStateChange, this, &UIMachineLogic::sltUSBDeviceStateChange);
    893893    connect(uisession(), &UISession::sigRuntimeError, this, &UIMachineLogic::sltRuntimeError);
     
    11471147    setKeyboardHandler(UIKeyboardHandler::create(this, visualStateType()));
    11481148    setMouseHandler(UIMouseHandler::create(this, visualStateType()));
    1149     /* Update UI session values with current: */
    1150     uisession()->setKeyboardState(keyboardHandler()->state());
     1149    /* Update UI machine values with current: */
     1150    uimachine()->setKeyboardState(keyboardHandler()->state());
    11511151    uimachine()->setMouseState(mouseHandler()->state());
    11521152}
     
    14391439    disconnect(uisession(), &UISession::sigAdditionsStateActualChange, this, &UIMachineLogic::sltAdditionsStateChanged);
    14401440    disconnect(uimachine(), &UIMachine::sigMouseCapabilityChange, this, &UIMachineLogic::sltMouseCapabilityChanged);
    1441     disconnect(uisession(), &UISession::sigKeyboardLedsChange, this, &UIMachineLogic::sltKeyboardLedsChanged);
     1441    disconnect(uimachine(), &UIMachine::sigKeyboardLedsChange, this, &UIMachineLogic::sltKeyboardLedsChanged);
    14421442    disconnect(uisession(), &UISession::sigUSBDeviceStateChange, this, &UIMachineLogic::sltUSBDeviceStateChange);
    14431443    disconnect(uisession(), &UISession::sigRuntimeError, this, &UIMachineLogic::sltRuntimeError);
     
    20672067    {
    20682068        QWidget *pCenterWidget = windowManager().realParentWindow(activeMachineWindow());
    2069         m_pSoftKeyboardDialog = new UISoftKeyboard(0, uisession(), pCenterWidget, machine().GetName());
     2069        m_pSoftKeyboardDialog = new UISoftKeyboard(0, uimachine(), uisession(),
     2070                                                   pCenterWidget, machine().GetName());
    20702071        connect(m_pSoftKeyboardDialog, &UISoftKeyboard::sigClose, this, &UIMachineLogic::sltCloseSoftKeyboardDefault);
    20712072    }
     
    26822683        m_pHostLedsState = DarwinHidDevicesKeepLedsState();
    26832684    if (m_pHostLedsState != NULL)
    2684         DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock());
     2685        DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uimachine()->isNumLock(), uimachine()->isCapsLock(), uimachine()->isScrollLock());
    26852686#elif defined(VBOX_WS_WIN)
    26862687    if (m_pHostLedsState == NULL)
    26872688        m_pHostLedsState = WinHidDevicesKeepLedsState();
    26882689    keyboardHandler()->winSkipKeyboardEvents(true);
    2689     WinHidDevicesBroadcastLeds(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock());
     2690    WinHidDevicesBroadcastLeds(uimachine()->isNumLock(), uimachine()->isCapsLock(), uimachine()->isScrollLock());
    26902691    keyboardHandler()->winSkipKeyboardEvents(false);
    26912692#else
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98382 r98384  
    517517}
    518518#endif /* RT_OS_DARWIN */
    519 
    520 void UISession::sltKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock)
    521 {
    522     /* Check if something had changed: */
    523     if (   m_fNumLock != fNumLock
    524         || m_fCapsLock != fCapsLock
    525         || m_fScrollLock != fScrollLock)
    526     {
    527         /* Store new num lock data: */
    528         if (m_fNumLock != fNumLock)
    529         {
    530             m_fNumLock = fNumLock;
    531             m_uNumLockAdaptionCnt = 2;
    532         }
    533 
    534         /* Store new caps lock data: */
    535         if (m_fCapsLock != fCapsLock)
    536         {
    537             m_fCapsLock = fCapsLock;
    538             m_uCapsLockAdaptionCnt = 2;
    539         }
    540 
    541         /* Store new scroll lock data: */
    542         if (m_fScrollLock != fScrollLock)
    543         {
    544             m_fScrollLock = fScrollLock;
    545         }
    546 
    547         /* Notify listeners about mouse capability changed: */
    548         emit sigKeyboardLedsChange();
    549     }
    550 }
    551519
    552520void UISession::sltStateChange(KMachineState state)
     
    852820    , m_fIsGuestSupportsGraphics(false)
    853821    , m_fIsGuestSupportsSeamless(false)
    854     /* Mouse flags: */
    855     , m_fNumLock(false)
    856     , m_fCapsLock(false)
    857     , m_fScrollLock(false)
    858     , m_uNumLockAdaptionCnt(2)
    859     , m_uCapsLockAdaptionCnt(2)
    860822    /* CPU hardware virtualization features for VM: */
    861823    , m_enmVMExecutionEngine(KVMExecutionEngine_NotSet)
     
    966928            this, &UISession::sigCursorPositionChange);
    967929    connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigKeyboardLedsChange,
    968             this, &UISession::sltKeyboardLedsChange);
     930            this, &UISession::sigKeyboardLedsChange);
    969931    connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigStateChange,
    970932            this, &UISession::sltStateChange);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98382 r98384  
    8282
    8383    /* Console callback signals: */
    84     /** Notifies listeners about keyboard state-change. */
    85     void sigKeyboardStateChange(int iState);
    8684    /** Notifies listeners about mouse pointer shape change. */
    8785    void sigMousePointerShapeChange(const UIMousePointerShapeData &shapeData);
     
    9290    /** Notifies listeners about cursor position change. */
    9391    void sigCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY);
    94     void sigKeyboardLedsChange();
     92    void sigKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
    9593    void sigMachineStateChange();
    9694    void sigAdditionsStateChange();
     
    235233    bool guestAdditionsUpgradable();
    236234
    237     /* Keyboard getters: */
    238     /** Returns keyboard-state. */
    239     int keyboardState() const { return m_iKeyboardState; }
    240     bool isNumLock() const { return m_fNumLock; }
    241     bool isCapsLock() const { return m_fCapsLock; }
    242     bool isScrollLock() const { return m_fScrollLock; }
    243     uint numLockAdaptionCnt() const { return m_uNumLockAdaptionCnt; }
    244     uint capsLockAdaptionCnt() const { return m_uCapsLockAdaptionCnt; }
    245 
    246235    /* Common setters: */
    247236    bool pause() { return setPause(true); }
     
    251240    void setAutoCaptureDisabled(bool fIsAutoCaptureDisabled) { m_fIsAutoCaptureDisabled = fIsAutoCaptureDisabled; }
    252241    void forgetPreviousMachineState() { m_machineStatePrevious = m_machineState; }
    253 
    254     /* Keyboard setters: */
    255     void setNumLockAdaptionCnt(uint uNumLockAdaptionCnt) { m_uNumLockAdaptionCnt = uNumLockAdaptionCnt; }
    256     void setCapsLockAdaptionCnt(uint uCapsLockAdaptionCnt) { m_uCapsLockAdaptionCnt = uCapsLockAdaptionCnt; }
    257242
    258243    /* Screen visibility status for host-desires: */
     
    319304    void sltMountDVDAdHoc(const QString &strSource);
    320305
    321     /** Defines @a iKeyboardState. */
    322     void setKeyboardState(int iKeyboardState) { m_iKeyboardState = iKeyboardState; emit sigKeyboardStateChange(m_iKeyboardState); }
    323 
    324306    /** Closes Runtime UI. */
    325307    void closeRuntimeUI();
     
    336318
    337319    /* Console events slots */
    338     void sltKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
    339320    void sltStateChange(KMachineState state);
    340321    void sltAdditionsChange();
     
    513494    bool  m_fIsGuestSupportsSeamless : 1;
    514495
    515     /* Keyboard flags: */
    516     /** Holds the keyboard-state. */
    517     int m_iKeyboardState;
    518     bool m_fNumLock : 1;
    519     bool m_fCapsLock : 1;
    520     bool m_fScrollLock : 1;
    521     uint m_uNumLockAdaptionCnt;
    522     uint m_uCapsLockAdaptionCnt;
    523 
    524496    /** Copy of IMachineDebugger::ExecutionEngine */
    525497    KVMExecutionEngine m_enmVMExecutionEngine;
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r98103 r98384  
    5454#include "UIExtraDataManager.h"
    5555#include "UIIconPool.h"
     56#include "UIMachine.h"
    5657#include "UIMessageCenter.h"
    5758#include "UIModalWindowManager.h"
     
    39233924*********************************************************************************************************************************/
    39243925
    3925 UISoftKeyboard::UISoftKeyboard(QWidget *pParent,
    3926                                UISession *pSession, QWidget *pCenterWidget, QString strMachineName /* = QString()*/)
     3926UISoftKeyboard::UISoftKeyboard(QWidget *pParent, UIMachine *pMachine, UISession *pSession,
     3927                               QWidget *pCenterWidget, QString strMachineName /* = QString() */)
    39273928    : QMainWindowWithRestorableGeometryAndRetranslateUi(pParent)
     3929    , m_pMachine(pMachine)
    39283930    , m_pSession(pSession)
    39293931    , m_pCenterWidget(pCenterWidget)
     
    40304032void UISoftKeyboard::sltKeyboardLedsChange()
    40314033{
    4032     bool fNumLockLed = m_pSession->isNumLock();
    4033     bool fCapsLockLed = m_pSession->isCapsLock();
    4034     bool fScrollLockLed = m_pSession->isScrollLock();
     4034    bool fNumLockLed = m_pMachine->isNumLock();
     4035    bool fCapsLockLed = m_pMachine->isCapsLock();
     4036    bool fScrollLockLed = m_pMachine->isScrollLock();
    40354037    if (m_pKeyboardWidget)
    40364038        m_pKeyboardWidget->updateLockKeyStates(fCapsLockLed, fNumLockLed, fScrollLockLed);
     
    42954297void UISoftKeyboard::prepareConnections()
    42964298{
    4297     connect(m_pSession, &UISession::sigKeyboardLedsChange, this, &UISoftKeyboard::sltKeyboardLedsChange);
     4299    connect(m_pMachine, &UIMachine::sigKeyboardLedsChange, this, &UISoftKeyboard::sltKeyboardLedsChange);
    42984300    connect(m_pKeyboardWidget, &UISoftKeyboardWidget::sigPutKeyboardSequence, this, &UISoftKeyboard::sltPutKeyboardSequence);
    42994301    connect(m_pKeyboardWidget, &UISoftKeyboardWidget::sigPutUsageCodesPress, this, &UISoftKeyboard::sltPutUsageCodesPress);
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h

    r98103 r98384  
    4848class UIKeyboardLayoutEditor;
    4949class UILayoutSelector;
     50class UIMachine;
    5051class UISession;
    5152class UISoftKeyboardKey;
     
    7172public:
    7273
    73     UISoftKeyboard(QWidget *pParent, UISession *pSession, QWidget *pCenterWidget,
    74                    QString strMachineName = QString());
     74    UISoftKeyboard(QWidget *pParent, UIMachine *pMachine, UISession *pSession,
     75                   QWidget *pCenterWidget, QString strMachineName = QString());
    7576    ~UISoftKeyboard();
    7677
     
    131132    CKeyboard& keyboard() const;
    132133
     134    UIMachine     *m_pMachine;
    133135    UISession     *m_pSession;
    134136    QWidget       *m_pCenterWidget;
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