public void ActionExecCommand() { QShortcut sender = (QShortcut)Sender(); if (sender.Key.ToString() == "F5") { // Update text of command GetCommandFromList(); } else if (sender.Key.ToString() == "F6") { // Update text of command, send it and receive response GetCommandFromList(); ExchangeData(); } }
private void UpdateReactors() { // Configure events reactors Connect(mainwindow_Ui.action_Exit,SIGNAL("activated()"),this,SLOT("ActionExit()")); Connect(mainwindow_Ui.action_Open,SIGNAL("activated()"),this,SLOT("ActionOpen()")); Connect(mainwindow_Ui.action_Close,SIGNAL("activated()"),this,SLOT("ActionClose()")); Connect(mainwindow_Ui.action_Info,SIGNAL("activated()"),this,SLOT("ActionInfo()")); Connect(mainwindow_Ui.action_SerialSettings,SIGNAL("activated()"),this,SLOT("ActionSettingsSerial()")); Connect(mainwindow_Ui.action_ATR,SIGNAL("activated()"),this,SLOT("ActionATR()")); Connect(mainwindow_Ui.BtnSend,SIGNAL("clicked()"),this,SLOT("ActionSendCommand()")); Connect(mainwindow_Ui.LstCommands,SIGNAL("itemDoubleClicked(QListWidgetItem*)"),this,SLOT("ActionAddCommand(QListWidgetItem*)")); QShortcut qsc = new QShortcut(new QKeySequence("F5"),mainwindow_Ui.LstCommands); Connect(qsc,SIGNAL("activated()"),this,SLOT("ActionExecCommand()")); qsc = new QShortcut(new QKeySequence("F6"),mainwindow_Ui.LstCommands); Connect(qsc,SIGNAL("activated()"),this,SLOT("ActionExecCommand()")); }