VirtualBox

Changeset 48510 in vbox for trunk


Ignore:
Timestamp:
Sep 17, 2013 6:32:07 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 5105: Runtime UI: Some changes to r89019.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r48504 r48510  
    21822182//           session().GetMachine().GetName().toAscii().constData());
    21832183
    2184     /* Here we have to save current host LED lock states in UISession registry.
    2185      * [void] uisession() -> setHostNumLock(), setHostCapsLock(), setHostScrollLock() can be used for that. */
     2184    /* Here we have to store host LED lock states to UISession registry.
     2185     * This can be done for each keyboard separately, just keep in mind keyboard IDs.
     2186     * [void] uisession() -> setHostLockStates() can be used for that. */
    21862187
    21872188    /* Here we have to update host LED lock states using values provided by UISession registry.
     
    21982199
    21992200    /* Here we have to restore host LED lock states from UISession registry.
    2200      * [bool] uisession() -> isHostNumLock(), isHostCapsLock(), isHostScrollLock() can be used for that. */
     2201     * This can be done for each keyboard separately, just use the same keyboard IDs.
     2202     * [bool] uisession() -> getHostLockStates() can be used for that. */
    22012203}
    22022204
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r48504 r48510  
    9999    , m_fCapsLock(false)
    100100    , m_fScrollLock(false)
    101     , m_fHostNumLock(false)
    102     , m_fHostCapsLock(false)
    103     , m_fHostScrollLock(false)
    104101    , m_uNumLockAdaptionCnt(2)
    105102    , m_uCapsLockAdaptionCnt(2)
     
    467464}
    468465
     466void UISession::setHostLockStates(const QString &strKeyboardID, bool fNum, bool fCaps, bool fScroll)
     467{
     468    /* Acquire modifiable reference, create default value if doesn't exists: */
     469    UIKeyboardLocks &hostLock = m_hostLocks[strKeyboardID];
     470    /* Save passed values: */
     471    hostLock.m_num = fNum;
     472    hostLock.m_caps = fCaps;
     473    hostLock.m_scroll = fScroll;
     474}
     475
     476void UISession::getHostLockStates(const QString &strKeyboardID, bool &fNum, bool &fCaps, bool &fScroll)
     477{
     478    /* Acquire modifiable reference, create default value if doesn't exists: */
     479    UIKeyboardLocks &hostLock = m_hostLocks[strKeyboardID];
     480    /* Load cached values: */
     481    fNum = hostLock.m_num;
     482    fCaps = hostLock.m_caps;
     483    fScroll = hostLock.m_scroll;
     484}
     485
    469486bool UISession::setPause(bool fOn)
    470487{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r48504 r48510  
    2424#include <QCursor>
    2525#include <QEvent>
     26#include <QMap>
    2627
    2728/* GUI includes: */
     
    7778};
    7879
     80/* Keyboard Lock container: */
     81struct UIKeyboardLocks
     82{
     83    /* Constructor: */
     84    UIKeyboardLocks()
     85        : m_num(false)
     86        , m_caps(false)
     87        , m_scroll(false)
     88    {}
     89    /* Variables: */
     90    bool m_num;
     91    bool m_caps;
     92    bool m_scroll;
     93};
     94typedef QMap<QString, UIKeyboardLocks> UIKeyboardLocksMap;
     95
    7996class UISession : public QObject
    8097{
     
    134151    bool isCapsLock() const { return m_fCapsLock; }
    135152    bool isScrollLock() const { return m_fScrollLock; }
    136     bool isHostNumLock() const { return m_fHostNumLock; }
    137     bool isHostCapsLock() const { return m_fHostCapsLock; }
    138     bool isHostScrollLock() const { return m_fHostScrollLock; }
    139     void setHostNumLock(bool fHostNumLock) { m_fHostNumLock = fHostNumLock; }
    140     void setHostCapsLock(bool fHostCapsLock) { m_fHostCapsLock = fHostCapsLock; }
    141     void setHostScrollLock(bool fHostScrollLock) { m_fHostScrollLock = fHostScrollLock; }
    142153    uint numLockAdaptionCnt() const { return m_uNumLockAdaptionCnt; }
    143154    uint capsLockAdaptionCnt() const { return m_uCapsLockAdaptionCnt; }
     155    void setHostLockStates(const QString &strKeyboardID, bool fNum, bool fCaps, bool fScroll);
     156    void getHostLockStates(const QString &strKeyboardID, bool &fNum, bool &fCaps, bool &fScroll);
    144157
    145158    /* Mouse getters: */
     
    306319    bool m_fCapsLock : 1;
    307320    bool m_fScrollLock : 1;
    308     bool m_fHostNumLock : 1;
    309     bool m_fHostCapsLock : 1;
    310     bool m_fHostScrollLock : 1;
    311321    uint m_uNumLockAdaptionCnt;
    312322    uint m_uCapsLockAdaptionCnt;
     323    UIKeyboardLocksMap m_hostLocks;
    313324
    314325    /* Mouse flags: */
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