VirtualBox

Changeset 98984 in vbox


Ignore:
Timestamp:
Mar 15, 2023 12:22:16 PM (19 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: Reworking keyboard indicator of UIIndicatorsPool; New state for the case when no keyboard is available; Fetching keyboard-state on machine init.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc

    r98977 r98984  
    454454        <file alias="host_iface_remove_disabled_32px.png">images/host_iface_remove_disabled_32px.png</file>
    455455        <file alias="hostkey_16px.png">images/hostkey_16px.png</file>
     456        <file alias="hostkey_disabled_16px.png">images/hostkey_disabled_16px.png</file>
    456457        <file alias="hostkey_captured_16px.png">images/hostkey_captured_16px.png</file>
    457458        <file alias="hostkey_captured_checked_16px.png">images/hostkey_captured_checked_16px.png</file>
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1_x2.qrc

    r98977 r98984  
    454454        <file alias="host_iface_remove_disabled_32px_x2.png">images/x2/host_iface_remove_disabled_32px_x2.png</file>
    455455        <file alias="hostkey_16px_x2.png">images/x2/hostkey_16px_x2.png</file>
     456        <file alias="hostkey_disabled_16px_x2.png">images/x2/hostkey_disabled_16px_x2.png</file>
    456457        <file alias="hostkey_captured_16px_x2.png">images/x2/hostkey_captured_16px_x2.png</file>
    457458        <file alias="hostkey_captured_checked_16px_x2.png">images/x2/hostkey_captured_checked_16px_x2.png</file>
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1_x3.qrc

    r98977 r98984  
    454454        <file alias="host_iface_remove_disabled_32px_x3.png">images/x3/host_iface_remove_disabled_32px_x3.png</file>
    455455        <file alias="hostkey_16px_x3.png">images/x3/hostkey_16px_x3.png</file>
     456        <file alias="hostkey_disabled_16px_x3.png">images/x3/hostkey_disabled_16px_x3.png</file>
    456457        <file alias="hostkey_captured_16px_x3.png">images/x3/hostkey_captured_16px_x3.png</file>
    457458        <file alias="hostkey_captured_checked_16px_x3.png">images/x3/hostkey_captured_checked_16px_x3.png</file>
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1_x4.qrc

    r98977 r98984  
    454454        <file alias="host_iface_remove_disabled_32px_x4.png">images/x4/host_iface_remove_disabled_32px_x4.png</file>
    455455        <file alias="hostkey_16px_x4.png">images/x4/hostkey_16px_x4.png</file>
     456        <file alias="hostkey_disabled_16px_x4.png">images/x4/hostkey_disabled_16px_x4.png</file>
    456457        <file alias="hostkey_captured_16px_x4.png">images/x4/hostkey_captured_16px_x4.png</file>
    457458        <file alias="hostkey_captured_checked_16px_x4.png">images/x4/hostkey_captured_checked_16px_x4.png</file>
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r98979 r98984  
    919919    {
    920920        /* Assign state-icons: */
    921         setStateIcon(0, UIIconPool::iconSet(":/hostkey_16px.png"));
    922         setStateIcon(1, UIIconPool::iconSet(":/hostkey_captured_16px.png"));
    923         setStateIcon(2, UIIconPool::iconSet(":/hostkey_pressed_16px.png"));
    924         setStateIcon(3, UIIconPool::iconSet(":/hostkey_captured_pressed_16px.png"));
    925         setStateIcon(4, UIIconPool::iconSet(":/hostkey_checked_16px.png"));
    926         setStateIcon(5, UIIconPool::iconSet(":/hostkey_captured_checked_16px.png"));
    927         setStateIcon(6, UIIconPool::iconSet(":/hostkey_pressed_checked_16px.png"));
    928         setStateIcon(7, UIIconPool::iconSet(":/hostkey_captured_pressed_checked_16px.png"));
     921        setStateIcon(0, UIIconPool::iconSet(":/hostkey_disabled_16px.png"));
     922        setStateIcon(1, UIIconPool::iconSet(":/hostkey_16px.png"));
     923        setStateIcon(3, UIIconPool::iconSet(":/hostkey_captured_16px.png"));
     924        setStateIcon(5, UIIconPool::iconSet(":/hostkey_pressed_16px.png"));
     925        setStateIcon(7, UIIconPool::iconSet(":/hostkey_captured_pressed_16px.png"));
     926        setStateIcon(9, UIIconPool::iconSet(":/hostkey_checked_16px.png"));
     927        setStateIcon(11, UIIconPool::iconSet(":/hostkey_captured_checked_16px.png"));
     928        setStateIcon(13, UIIconPool::iconSet(":/hostkey_pressed_checked_16px.png"));
     929        setStateIcon(15, UIIconPool::iconSet(":/hostkey_captured_pressed_checked_16px.png"));
    929930        /* Configure connection: */
     931        connect(pMachine, &UIMachine::sigInitialized,
     932                this, &UIIndicatorKeyboard::sltFetchState);
    930933        connect(pMachine, &UIMachine::sigKeyboardStateChange,
    931934                this, static_cast<void(UIIndicatorKeyboard::*)(int)>(&UIIndicatorKeyboard::setState));
    932         setState(pMachine->keyboardState());
    933935        /* Translate finally: */
    934936        retranslateUi();
     
    955957        setToolTip(strToolTip.arg(strFullData));
    956958    }
     959
     960private slots:
     961
     962    /** Fetches the keyboard-state from machine UI. */
     963    void sltFetchState() { setState(m_pMachine->keyboardState()); }
    957964};
    958965
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r98983 r98984  
    476476int UIKeyboardHandler::state() const
    477477{
    478     return (m_fKeyboardCaptured ? UIKeyboardStateType_KeyboardCaptured : 0) |
     478    return uimachine()->machineState() == KMachineState_Null ? UIKeyboardStateType_KeyboardUnavailable :
     479           UIKeyboardStateType_KeyboardAvailable |
     480           (m_fKeyboardCaptured ? UIKeyboardStateType_KeyboardCaptured : 0) |
    479481           (m_fHostComboPressed ? UIKeyboardStateType_HostKeyPressed : 0) |
    480482           (m_fHostKeyComboPressInserted ? UIKeyboardStateType_HostKeyPressedInsertion : 0);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h

    r98784 r98984  
    7777enum UIKeyboardStateType
    7878{
    79     UIKeyboardStateType_KeyboardCaptured        = RT_BIT(0),
    80     UIKeyboardStateType_HostKeyPressed          = RT_BIT(1),
    81     UIKeyboardStateType_HostKeyPressedInsertion = RT_BIT(2)
     79    UIKeyboardStateType_KeyboardUnavailable     = 0,
     80    UIKeyboardStateType_KeyboardAvailable       = RT_BIT(0),
     81    UIKeyboardStateType_KeyboardCaptured        = RT_BIT(1),
     82    UIKeyboardStateType_HostKeyPressed          = RT_BIT(2),
     83    UIKeyboardStateType_HostKeyPressedInsertion = RT_BIT(3)
    8284};
    8385
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