Skip to content

Commit 4cb8ee6

Browse files
committed
Send button and send EOL combobox changes set focus to send textbox.
1 parent 557460f commit 4cb8ee6

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

SUSTerm/mainwindow.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
4848
connect(ui->lineEdit_toSend, SIGNAL(returnPressed()), this, SLOT(ButtonSendPressed()));
4949
connect(ui->comboBox_bauds, SIGNAL(currentIndexChanged(const QString &)), this,
5050
SLOT(CBoxBaudsChanged()));
51+
connect(ui->comboBox_EOL, SIGNAL(currentIndexChanged(const QString &)), this,
52+
SLOT(CBoxEOLChanged()));
5153
connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(MenuBarExitClick()));
5254
connect(ui->actionASCII_Terminal, SIGNAL(triggered()), this, SLOT(MenuBarTermAsciiClick()));
5355
connect(ui->actionHEX_Terminal, SIGNAL(triggered()), this, SLOT(MenuBarTermHexClick()));
@@ -274,7 +276,7 @@ void MainWindow::ClosePort(void)
274276

275277
/**************************************************************************************************/
276278

277-
/* Bauds change */
279+
/* Bauds and Send EOL bytes change */
278280

279281
// ComboBox Bauds change event handler
280282
void MainWindow::CBoxBaudsChanged(void)
@@ -290,6 +292,14 @@ void MainWindow::CBoxBaudsChanged(void)
290292
}
291293
}
292294

295+
// ComboBox EOL change event handler
296+
void MainWindow::CBoxEOLChanged(void)
297+
{
298+
qDebug("Send EOL changed.");
299+
300+
ui->lineEdit_toSend->setFocus();
301+
}
302+
293303
/**************************************************************************************************/
294304

295305
/* Serial Receive */
@@ -670,6 +680,7 @@ void MainWindow::ButtonSendPressed(void)
670680
qDebug("Send Button pressed.");
671681
SerialSend();
672682
ui->lineEdit_toSend->clear();
683+
ui->lineEdit_toSend->setFocus();
673684
}
674685

675686
// Serial send data from lineEdit box

SUSTerm/mainwindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class MainWindow : public QMainWindow
6060
void ButtonSendPressed(void);
6161
void SerialReceive(void);
6262
void CBoxBaudsChanged(void);
63+
void CBoxEOLChanged(void);
6364
bool eventFilter(QObject *target, QEvent *event);
6465
void SerialPortErrorHandler(void);
6566
void MenuBarExitClick(void);

0 commit comments

Comments
 (0)