@@ -263,6 +263,7 @@ void MainWindow::settingsLoadAll()
263
263
ui->checkBoxAutoSizeColumnsLogTable ->setChecked (appSettings.value (" GUI_Elements/checkBoxAutoSizeColumnsLogTable.isChecked" , true ).value <bool >());
264
264
ui->checkBoxScrollLogEnableSorting ->setChecked (appSettings.value (" GUI_Elements/checkBoxScrollLogEnableSorting.isChecked" , true ).value <bool >()); ui->checkBoxScrollLogEnableSorting ->setChecked (appSettings.value (" GUI_Elements/checkBoxScrollLogEnableSorting.isChecked" , true ).value <bool >());
265
265
ui->comboBoxAddTextMode ->setCurrentIndex (appSettings.value (" GUI_Elements/comboBoxAddTextMode.currentIndex" ).value <int >());
266
+ ui->comboBoxLineEnding ->setCurrentIndex (appSettings.value (" GUI_Elements/comboBoxLineEnding.currentIndex" ).value <int >());
266
267
ui->comboBoxBaudRates ->setCurrentIndex (appSettings.value (" GUI_Elements/comboBoxBaudRates.currentIndex" ).value <int >());
267
268
ui->comboBoxClockSource ->setCurrentIndex (appSettings.value (" GUI_Elements/comboBoxClockSource.currentIndex" ).value <int >());
268
269
ui->comboBoxDataBits ->setCurrentIndex (appSettings.value (" GUI_Elements/comboBoxDataBits.currentIndex" ).value <int >());
@@ -374,6 +375,7 @@ void MainWindow::settingsSaveAll()
374
375
appSettings.setValue (" GUI_Elements/checkBoxAutoSizeColumnsLogTable.isChecked" , ui->checkBoxAutoSizeColumnsLogTable ->isChecked ());
375
376
appSettings.setValue (" GUI_Elements/checkBoxAutoScrollLogTable.isChecked" , ui->checkBoxAutoScrollLogTable ->isChecked ());
376
377
appSettings.setValue (" GUI_Elements/comboBoxAddTextMode.currentIndex" , ui->comboBoxAddTextMode ->currentIndex ());
378
+ appSettings.setValue (" GUI_Elements/comboBoxLineEnding.currentIndex" , ui->comboBoxLineEnding ->currentIndex ());
377
379
appSettings.setValue (" GUI_Elements/comboBoxBaudRates.currentIndex" , ui->comboBoxBaudRates ->currentIndex ());
378
380
appSettings.setValue (" GUI_Elements/comboBoxClockSource.currentIndex" , ui->comboBoxClockSource ->currentIndex ());
379
381
appSettings.setValue (" GUI_Elements/comboBoxDataBits.currentIndex" , ui->comboBoxDataBits ->currentIndex ());
@@ -1306,6 +1308,18 @@ void MainWindow::sendMessageKeyEvent(QKeyEvent *event)
1306
1308
1307
1309
void MainWindow::sendSerial (QString message) // TODO - move to serial - error via signal/slot
1308
1310
{
1311
+ if (ui->comboBoxLineEnding ->currentIndex () == 1 )
1312
+ {
1313
+ message = message + " \n " ;
1314
+ }
1315
+ else if (ui->comboBoxLineEnding ->currentIndex () == 2 )
1316
+ {
1317
+ message = message + " \r " ;
1318
+ }
1319
+ else if (ui->comboBoxLineEnding ->currentIndex () == 3 )
1320
+ {
1321
+ message = message + " \r\n " ;
1322
+ }
1309
1323
if (!serial.send (message))
1310
1324
this ->addLog (" App >>\t Unable to send! Serial port closed !" , true );
1311
1325
}
0 commit comments