Changeset 64659 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 14, 2016 2:19:26 PM (8 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
r62493 r64659 669 669 switch (runtimeMenuInputActionType) 670 670 { 671 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard: strResult = "Keyboard"; break;672 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings: strResult = "KeyboardSettings"; break;673 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD: strResult = "TypeCAD"; break;671 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard: strResult = "Keyboard"; break; 672 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings: strResult = "KeyboardSettings"; break; 673 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD: strResult = "TypeCAD"; break; 674 674 #ifdef VBOX_WS_X11 675 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS: strResult = "TypeCABS"; break;675 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS: strResult = "TypeCABS"; break; 676 676 #endif /* VBOX_WS_X11 */ 677 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak: strResult = "TypeCtrlBreak"; break; 678 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert: strResult = "TypeInsert"; break; 679 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse: strResult = "Mouse"; break; 680 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration: strResult = "MouseIntegration"; break; 681 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_All: strResult = "All"; break; 677 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak: strResult = "TypeCtrlBreak"; break; 678 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert: strResult = "TypeInsert"; break; 679 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen: strResult = "TypePrintScreen"; break; 680 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen: strResult = "TypeAltPrintScreen"; break; 681 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse: strResult = "Mouse"; break; 682 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration: strResult = "MouseIntegration"; break; 683 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_All: strResult = "All"; break; 682 684 default: 683 685 { … … 694 696 /* Here we have some fancy stuff allowing us 695 697 * to search through the keys using 'case-insensitive' rule: */ 696 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuInputActionType> values;697 keys << "Keyboard"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard;698 keys << "KeyboardSettings"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings;699 keys << "TypeCAD"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD;698 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuInputActionType> values; 699 keys << "Keyboard"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard; 700 keys << "KeyboardSettings"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings; 701 keys << "TypeCAD"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD; 700 702 #ifdef VBOX_WS_X11 701 keys << "TypeCABS"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS;703 keys << "TypeCABS"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS; 702 704 #endif /* VBOX_WS_X11 */ 703 keys << "TypeCtrlBreak"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak; 704 keys << "TypeInsert"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert; 705 keys << "Mouse"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse; 706 keys << "MouseIntegration"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration; 707 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_All; 705 keys << "TypeCtrlBreak"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak; 706 keys << "TypeInsert"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert; 707 keys << "TypePrintScreen"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen; 708 keys << "TypeAltPrintScreen"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen; 709 keys << "Mouse"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse; 710 keys << "MouseIntegration"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration; 711 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_All; 708 712 /* Invalid type for unknown words: */ 709 713 if (!keys.contains(strRuntimeMenuInputActionType, Qt::CaseInsensitive)) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r62493 r64659 426 426 enum RuntimeMenuInputActionType 427 427 { 428 RuntimeMenuInputActionType_Invalid = 0,429 RuntimeMenuInputActionType_Keyboard = RT_BIT(0),430 RuntimeMenuInputActionType_KeyboardSettings = RT_BIT(1),431 RuntimeMenuInputActionType_TypeCAD = RT_BIT(2),428 RuntimeMenuInputActionType_Invalid = 0, 429 RuntimeMenuInputActionType_Keyboard = RT_BIT(0), 430 RuntimeMenuInputActionType_KeyboardSettings = RT_BIT(1), 431 RuntimeMenuInputActionType_TypeCAD = RT_BIT(2), 432 432 #ifdef VBOX_WS_X11 433 RuntimeMenuInputActionType_TypeCABS = RT_BIT(3),433 RuntimeMenuInputActionType_TypeCABS = RT_BIT(3), 434 434 #endif /* VBOX_WS_X11 */ 435 RuntimeMenuInputActionType_TypeCtrlBreak = RT_BIT(4), 436 RuntimeMenuInputActionType_TypeInsert = RT_BIT(5), 437 RuntimeMenuInputActionType_Mouse = RT_BIT(6), 438 RuntimeMenuInputActionType_MouseIntegration = RT_BIT(7), 439 RuntimeMenuInputActionType_All = 0xFFFF 435 RuntimeMenuInputActionType_TypeCtrlBreak = RT_BIT(4), 436 RuntimeMenuInputActionType_TypeInsert = RT_BIT(5), 437 RuntimeMenuInputActionType_TypePrintScreen = RT_BIT(6), 438 RuntimeMenuInputActionType_TypeAltPrintScreen = RT_BIT(7), 439 RuntimeMenuInputActionType_Mouse = RT_BIT(8), 440 RuntimeMenuInputActionType_MouseIntegration = RT_BIT(9), 441 RuntimeMenuInputActionType_All = 0xFFFF 440 442 }; 441 443 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r62493 r64659 1188 1188 setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Insert")); 1189 1189 setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Insert")); 1190 } 1191 }; 1192 1193 class UIActionSimplePerformTypePrintScreen : public UIActionSimple 1194 { 1195 Q_OBJECT; 1196 1197 public: 1198 1199 UIActionSimplePerformTypePrintScreen(UIActionPool *pParent) 1200 : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png") {} 1201 1202 protected: 1203 1204 /** Returns action extra-data ID. */ 1205 virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen; } 1206 /** Returns action extra-data key. */ 1207 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen); } 1208 /** Returns whether action is allowed. */ 1209 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen); } 1210 1211 QString shortcutExtraDataID() const 1212 { 1213 return QString("TypePrintScreen"); 1214 } 1215 1216 void retranslateUi() 1217 { 1218 setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Print Screen")); 1219 setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Print Screen")); 1220 } 1221 }; 1222 1223 class UIActionSimplePerformTypeAltPrintScreen : public UIActionSimple 1224 { 1225 Q_OBJECT; 1226 1227 public: 1228 1229 UIActionSimplePerformTypeAltPrintScreen(UIActionPool *pParent) 1230 : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png") {} 1231 1232 protected: 1233 1234 /** Returns action extra-data ID. */ 1235 virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen; } 1236 /** Returns action extra-data key. */ 1237 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen); } 1238 /** Returns whether action is allowed. */ 1239 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen); } 1240 1241 QString shortcutExtraDataID() const 1242 { 1243 return QString("TypeAltPrintScreen"); 1244 } 1245 1246 void retranslateUi() 1247 { 1248 setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Alt Print Screen")); 1249 setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Alt Print Screen")); 1190 1250 } 1191 1251 }; … … 2145 2205 m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak] = new UIActionSimplePerformTypeCtrlBreak(this); 2146 2206 m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert] = new UIActionSimplePerformTypeInsert(this); 2207 m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen] = new UIActionSimplePerformTypePrintScreen(this); 2208 m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen] = new UIActionSimplePerformTypeAltPrintScreen(this); 2147 2209 m_pool[UIActionIndexRT_M_Input_M_Mouse] = new UIActionMenuMouse(this); 2148 2210 m_pool[UIActionIndexRT_M_Input_M_Mouse_T_Integration] = new UIActionToggleMouseIntegration(this); … … 2868 2930 /* 'Type Insert' action: */ 2869 2931 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert)) || fSeparator; 2932 /* 'Type Print Screen' action: */ 2933 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen)) || fSeparator; 2934 /* 'Type Alt Print Screen' action: */ 2935 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen)) || fSeparator; 2870 2936 2871 2937 /* Mark menu as valid: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r62493 r64659 88 88 UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak, 89 89 UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert, 90 UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen, 91 UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen, 90 92 UIActionIndexRT_M_Input_M_Mouse, 91 93 UIActionIndexRT_M_Input_M_Mouse_T_Integration, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r63321 r64659 1019 1019 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak)); 1020 1020 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert)); 1021 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen)); 1022 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen)); 1021 1023 1022 1024 /* Move actions into running-n-paused actions group: */ … … 1131 1133 connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert), SIGNAL(triggered()), 1132 1134 this, SLOT(sltTypeInsert())); 1135 connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen), SIGNAL(triggered()), 1136 this, SLOT(sltTypePrintScreen())); 1137 connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen), SIGNAL(triggered()), 1138 this, SLOT(sltTypeAltPrintScreen())); 1133 1139 connect(actionPool()->action(UIActionIndexRT_M_Input_M_Mouse_T_Integration), SIGNAL(toggled(bool)), 1134 1140 this, SLOT(sltToggleMouseIntegration(bool))); … … 1505 1511 } 1506 1512 1513 void UIMachineLogic::sltTypePrintScreen() 1514 { 1515 static QVector<LONG> sequence(8); 1516 sequence[0] = 0xE0; /* Extended flag */ 1517 sequence[1] = 0x2A; /* Print.. down */ 1518 sequence[2] = 0xE0; /* Extended flag */ 1519 sequence[3] = 0x37; /* ..Screen down */ 1520 sequence[4] = 0xE0; /* Extended flag */ 1521 sequence[5] = 0x37 | 0x80; /* ..Screen up */ 1522 sequence[6] = 0xE0; /* Extended flag */ 1523 sequence[7] = 0x2A | 0x80; /* Print.. up */ 1524 keyboard().PutScancodes(sequence); 1525 AssertWrapperOk(keyboard()); 1526 } 1527 1528 void UIMachineLogic::sltTypeAltPrintScreen() 1529 { 1530 static QVector<LONG> sequence(10); 1531 sequence[0] = 0x38; /* Alt down */ 1532 sequence[1] = 0xE0; /* Extended flag */ 1533 sequence[2] = 0x2A; /* Print.. down */ 1534 sequence[3] = 0xE0; /* Extended flag */ 1535 sequence[4] = 0x37; /* ..Screen down */ 1536 sequence[5] = 0xE0; /* Extended flag */ 1537 sequence[6] = 0x37 | 0x80; /* ..Screen up */ 1538 sequence[7] = 0xE0; /* Extended flag */ 1539 sequence[8] = 0x2A | 0x80; /* Print.. up */ 1540 sequence[9] = 0x38 | 0x80; /* Alt up */ 1541 keyboard().PutScancodes(sequence); 1542 AssertWrapperOk(keyboard()); 1543 } 1544 1507 1545 void UIMachineLogic::sltTakeSnapshot() 1508 1546 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r62493 r64659 265 265 void sltTypeCtrlBreak(); 266 266 void sltTypeInsert(); 267 void sltTypePrintScreen(); 268 void sltTypeAltPrintScreen(); 267 269 void sltTakeSnapshot(); 268 270 void sltShowInformationDialog();
Note:
See TracChangeset
for help on using the changeset viewer.