Changeset 54337 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 20, 2015 5:12:21 PM (10 years ago)
- 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 650 650 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS: strResult = "TypeCABS"; break; 651 651 #endif /* Q_WS_X11 */ 652 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak: strResult = "TypeCtrlBreak"; break; 653 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert: strResult = "TypeInsert"; break; 652 654 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_All: strResult = "All"; break; 653 655 default: … … 674 676 keys << "TypeCABS"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS; 675 677 #endif /* Q_WS_X11 */ 678 keys << "TypeCtrlBreak"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak; 679 keys << "TypeInsert"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert; 676 680 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_All; 677 681 /* Invalid type for unknown words: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r54303 r54337 416 416 RuntimeMenuInputActionType_TypeCABS = RT_BIT(5), 417 417 #endif /* Q_WS_X11 */ 418 RuntimeMenuInputActionType_TypeCtrlBreak = RT_BIT(6), 419 RuntimeMenuInputActionType_TypeInsert = RT_BIT(7), 418 420 RuntimeMenuInputActionType_All = 0xFFFF 419 421 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r54303 r54337 1125 1125 void retranslateUi() 1126 1126 { 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")); 1129 1129 } 1130 1130 }; … … 1161 1161 void retranslateUi() 1162 1162 { 1163 setName(QApplication::translate("UIActionPool", " Ins&ertCtrl-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")); 1165 1165 } 1166 1166 }; 1167 1167 #endif /* Q_WS_X11 */ 1168 1169 class UIActionSimplePerformTypeCtrlBreak : public UIActionSimple 1170 { 1171 Q_OBJECT; 1172 1173 public: 1174 1175 UIActionSimplePerformTypeCtrlBreak(UIActionPool *pParent) 1176 : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png") {} 1177 1178 protected: 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 1199 class UIActionSimplePerformTypeInsert : public UIActionSimple 1200 { 1201 Q_OBJECT; 1202 1203 public: 1204 1205 UIActionSimplePerformTypeInsert(UIActionPool *pParent) 1206 : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png") {} 1207 1208 protected: 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 }; 1168 1228 1169 1229 class UIActionMenuDevices : public UIActionMenu … … 2036 2096 m_pool[UIActionIndexRT_M_Input_S_TypeCABS] = new UIActionSimplePerformTypeCABS(this); 2037 2097 #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); 2038 2100 2039 2101 /* 'Devices' actions: */ … … 2744 2806 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_S_TypeCABS)) || fSeparator; 2745 2807 #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; 2746 2812 2747 2813 /* Mark menu as valid: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r54303 r54337 84 84 UIActionIndexRT_M_Input_S_TypeCABS, 85 85 #endif /* Q_WS_X11 */ 86 UIActionIndexRT_M_Input_S_TypeCtrlBreak, 87 UIActionIndexRT_M_Input_S_TypeInsert, 86 88 87 89 /* 'Devices' menu actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r54305 r54337 919 919 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_S_TypeCABS)); 920 920 #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)); 921 923 922 924 /* Move actions into running-n-paused actions group: */ … … 1017 1019 this, SLOT(sltTypeCABS())); 1018 1020 #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())); 1019 1025 1020 1026 /* 'Devices' actions connections: */ … … 1315 1321 { 1316 1322 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] = 0x 8E; /* Backspace up */1321 sequence[4] = 0x b8; /* Alt up */1322 sequence[5] = 0x 9d; /* 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 */ 1323 1329 keyboard().PutScancodes(sequence); 1324 1330 AssertWrapperOk(keyboard()); 1325 1331 } 1326 1332 #endif /* Q_WS_X11 */ 1333 1334 void 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 1345 void 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 } 1327 1355 1328 1356 void UIMachineLogic::sltTakeSnapshot() -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r54303 r54337 248 248 void sltTypeCABS(); 249 249 #endif /* Q_WS_X11 */ 250 void sltTypeCtrlBreak(); 251 void sltTypeInsert(); 250 252 void sltTakeSnapshot(); 251 253 void sltShowInformationDialog();
Note:
See TracChangeset
for help on using the changeset viewer.