VirtualBox

Ignore:
Timestamp:
Feb 20, 2015 5:12:21 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 7462: Runtime UI: Extend Input menu / Keyboard sub-menu with few additional combinations. Rework NLS set for those conbinations to be separate.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r54303 r54337  
    650650        case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS:          strResult = "TypeCABS"; break;
    651651#endif /* Q_WS_X11 */
     652        case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak:     strResult = "TypeCtrlBreak"; break;
     653        case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert:        strResult = "TypeInsert"; break;
    652654        case UIExtraDataMetaDefs::RuntimeMenuInputActionType_All:               strResult = "All"; break;
    653655        default:
     
    674676    keys << "TypeCABS";          values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS;
    675677#endif /* Q_WS_X11 */
     678    keys << "TypeCtrlBreak";     values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak;
     679    keys << "TypeInsert";        values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert;
    676680    keys << "All";               values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_All;
    677681    /* Invalid type for unknown words: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r54303 r54337  
    416416        RuntimeMenuInputActionType_TypeCABS          = RT_BIT(5),
    417417#endif /* Q_WS_X11 */
     418        RuntimeMenuInputActionType_TypeCtrlBreak     = RT_BIT(6),
     419        RuntimeMenuInputActionType_TypeInsert        = RT_BIT(7),
    418420        RuntimeMenuInputActionType_All               = 0xFFFF
    419421    };
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r54303 r54337  
    11251125    void retranslateUi()
    11261126    {
    1127         setName(QApplication::translate("UIActionPool", "&Insert Ctrl-Alt-Del"));
    1128         setStatusTip(QApplication::translate("UIActionPool", "Send the Ctrl-Alt-Del sequence to the virtual machine"));
     1127        setName(QApplication::translate("UIActionPool", "&Insert %1").arg("Ctrl-Alt-Del"));
     1128        setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Ctrl-Alt-Del"));
    11291129    }
    11301130};
     
    11611161    void retranslateUi()
    11621162    {
    1163         setName(QApplication::translate("UIActionPool", "Ins&ert Ctrl-Alt-Backspace"));
    1164         setStatusTip(QApplication::translate("UIActionPool", "Send the Ctrl-Alt-Backspace sequence to the virtual machine"));
     1163        setName(QApplication::translate("UIActionPool", "&Insert %1").arg("Ctrl-Alt-Backspace"));
     1164        setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Ctrl-Alt-Backspace"));
    11651165    }
    11661166};
    11671167#endif /* Q_WS_X11 */
     1168
     1169class UIActionSimplePerformTypeCtrlBreak : public UIActionSimple
     1170{
     1171    Q_OBJECT;
     1172
     1173public:
     1174
     1175    UIActionSimplePerformTypeCtrlBreak(UIActionPool *pParent)
     1176        : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png") {}
     1177
     1178protected:
     1179
     1180    /** Returns action extra-data ID. */
     1181    virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak; }
     1182    /** Returns action extra-data key. */
     1183    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak); }
     1184    /** Returns whether action is allowed. */
     1185    virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak); }
     1186
     1187    QString shortcutExtraDataID() const
     1188    {
     1189        return QString("TypeCtrlBreak");
     1190    }
     1191
     1192    void retranslateUi()
     1193    {
     1194        setName(QApplication::translate("UIActionPool", "&Insert %1").arg("Ctrl-Break"));
     1195        setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Ctrl-Break"));
     1196    }
     1197};
     1198
     1199class UIActionSimplePerformTypeInsert : public UIActionSimple
     1200{
     1201    Q_OBJECT;
     1202
     1203public:
     1204
     1205    UIActionSimplePerformTypeInsert(UIActionPool *pParent)
     1206        : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png") {}
     1207
     1208protected:
     1209
     1210    /** Returns action extra-data ID. */
     1211    virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert; }
     1212    /** Returns action extra-data key. */
     1213    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert); }
     1214    /** Returns whether action is allowed. */
     1215    virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert); }
     1216
     1217    QString shortcutExtraDataID() const
     1218    {
     1219        return QString("TypeInsert");
     1220    }
     1221
     1222    void retranslateUi()
     1223    {
     1224        setName(QApplication::translate("UIActionPool", "&Insert %1").arg("Insert"));
     1225        setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Insert"));
     1226    }
     1227};
    11681228
    11691229class UIActionMenuDevices : public UIActionMenu
     
    20362096    m_pool[UIActionIndexRT_M_Input_S_TypeCABS] = new UIActionSimplePerformTypeCABS(this);
    20372097#endif /* Q_WS_X11 */
     2098    m_pool[UIActionIndexRT_M_Input_S_TypeCtrlBreak] = new UIActionSimplePerformTypeCtrlBreak(this);
     2099    m_pool[UIActionIndexRT_M_Input_S_TypeInsert] = new UIActionSimplePerformTypeInsert(this);
    20382100
    20392101    /* 'Devices' actions: */
     
    27442806    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_S_TypeCABS)) || fSeparator;
    27452807#endif /* Q_WS_X11 */
     2808    /* 'Type Ctrl-Break' action: */
     2809    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_S_TypeCtrlBreak)) || fSeparator;
     2810    /* 'Type Insert' action: */
     2811    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_S_TypeInsert)) || fSeparator;
    27462812
    27472813    /* Mark menu as valid: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r54303 r54337  
    8484    UIActionIndexRT_M_Input_S_TypeCABS,
    8585#endif /* Q_WS_X11 */
     86    UIActionIndexRT_M_Input_S_TypeCtrlBreak,
     87    UIActionIndexRT_M_Input_S_TypeInsert,
    8688
    8789    /* 'Devices' menu actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r54305 r54337  
    919919    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_S_TypeCABS));
    920920#endif /* Q_WS_X11 */
     921    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_S_TypeCtrlBreak));
     922    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_S_TypeInsert));
    921923
    922924    /* Move actions into running-n-paused actions group: */
     
    10171019            this, SLOT(sltTypeCABS()));
    10181020#endif /* Q_WS_X11 */
     1021    connect(actionPool()->action(UIActionIndexRT_M_Input_S_TypeCtrlBreak), SIGNAL(triggered()),
     1022            this, SLOT(sltTypeCtrlBreak()));
     1023    connect(actionPool()->action(UIActionIndexRT_M_Input_S_TypeInsert), SIGNAL(triggered()),
     1024            this, SLOT(sltTypeInsert()));
    10191025
    10201026    /* 'Devices' actions connections: */
     
    13151321{
    13161322    static QVector<LONG> sequence(6);
    1317     sequence[0] = 0x1d; /* Ctrl down */
    1318     sequence[1] = 0x38; /* Alt down */
    1319     sequence[2] = 0x0E; /* Backspace down */
    1320     sequence[3] = 0x8E; /* Backspace up */
    1321     sequence[4] = 0xb8; /* Alt up */
    1322     sequence[5] = 0x9d; /* Ctrl up */
     1323    sequence[0] = 0x1d;        /* Ctrl down */
     1324    sequence[1] = 0x38;        /* Alt down */
     1325    sequence[2] = 0x0E;        /* Backspace down */
     1326    sequence[3] = 0x0E | 0x80; /* Backspace up */
     1327    sequence[4] = 0x38 | 0x80; /* Alt up */
     1328    sequence[5] = 0x1d | 0x80; /* Ctrl up */
    13231329    keyboard().PutScancodes(sequence);
    13241330    AssertWrapperOk(keyboard());
    13251331}
    13261332#endif /* Q_WS_X11 */
     1333
     1334void UIMachineLogic::sltTypeCtrlBreak()
     1335{
     1336    static QVector<LONG> sequence(4);
     1337    sequence[0] = 0x1d;        /* Ctrl down */
     1338    sequence[1] = 0x46;        /* Break down */
     1339    sequence[2] = 0x46 | 0x80; /* Break up */
     1340    sequence[3] = 0x1d | 0x80; /* Ctrl up */
     1341    keyboard().PutScancodes(sequence);
     1342    AssertWrapperOk(keyboard());
     1343}
     1344
     1345void UIMachineLogic::sltTypeInsert()
     1346{
     1347    static QVector<LONG> sequence(4);
     1348    sequence[0] = 0xE0;        /* Extended flag */
     1349    sequence[1] = 0x52;        /* Insert down */
     1350    sequence[2] = 0xE0;        /* Extended flag */
     1351    sequence[3] = 0x52 | 0x80; /* Insert up */
     1352    keyboard().PutScancodes(sequence);
     1353    AssertWrapperOk(keyboard());
     1354}
    13271355
    13281356void UIMachineLogic::sltTakeSnapshot()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r54303 r54337  
    248248    void sltTypeCABS();
    249249#endif /* Q_WS_X11 */
     250    void sltTypeCtrlBreak();
     251    void sltTypeInsert();
    250252    void sltTakeSnapshot();
    251253    void sltShowInformationDialog();
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