@@ -346,7 +346,7 @@ void MainWindow::settingsLoadAll()
346
346
347
347
ui->tabWidgetControlSection ->setCurrentIndex (appSettings.value (" GUI_Elements/tabWidgetControlSection.currentIndex" ).value <int >());
348
348
349
- ui->radioButtonScrollToButtom ->setChecked (appSettings.value (" GUI_Elements/radioButtonScrollToButtom .isChecked" ).value <bool >());
349
+ ui->checkBoxScrollToButtom ->setChecked (appSettings.value (" GUI_Elements/checkBoxScrollToButtom .isChecked" ).value <bool >());
350
350
351
351
ui->lineEditCustomParsingRules ->setText (appSettings.value (" data/lineEditCustomParsingRules.text" ).value <QString>());
352
352
ui->lineEditUDPTargetIP ->setText (appSettings.value (" data/lineEditUDPTargetIP.text" ).value <QString>());
@@ -446,7 +446,7 @@ void MainWindow::settingsSaveAll()
446
446
447
447
appSettings.setValue (" GUI_Elements/tabWidgetControlSection.currentIndex" , ui->tabWidgetControlSection ->currentIndex ());
448
448
449
- appSettings.setValue (" GUI_Elements/radioButtonScrollToButtom .isChecked" , ui->radioButtonScrollToButtom ->isChecked ());
449
+ appSettings.setValue (" GUI_Elements/checkBoxScrollToButtom .isChecked" , ui->checkBoxScrollToButtom ->isChecked ());
450
450
451
451
452
452
appSettings.setValue (" data/lineEditCustomParsingRules.text" , ui->lineEditCustomParsingRules ->text ());
@@ -879,6 +879,10 @@ void MainWindow::addLog(QString text, bool appendAsLine)
879
879
if (ui->checkBoxShowTime ->isChecked ())
880
880
text = currentDateTime + text;
881
881
882
+ // Replace control chars
883
+ if (ui->checkBoxShowControlChars ->isChecked ())
884
+ text = controlCharactersVisibleConvert (text);
885
+
882
886
if (!appendAsLine)
883
887
{
884
888
int sliderPosVertical = ui->textBrowserLogs ->verticalScrollBar ()->value ();
@@ -890,7 +894,7 @@ void MainWindow::addLog(QString text, bool appendAsLine)
890
894
ui->textBrowserLogs ->horizontalScrollBar ()->setValue (sliderPosHorizontal);
891
895
892
896
893
- if (!ui->radioButtonScrollToButtom ->isChecked ())
897
+ if (!ui->checkBoxScrollToButtom ->isChecked ())
894
898
ui->textBrowserLogs ->verticalScrollBar ()->setValue (sliderPosVertical);
895
899
else
896
900
ui->textBrowserLogs ->verticalScrollBar ()->setValue ( ui->textBrowserLogs ->verticalScrollBar ()->maximum ());
@@ -902,6 +906,20 @@ void MainWindow::addLog(QString text, bool appendAsLine)
902
906
}
903
907
}
904
908
909
+ QString MainWindow::controlCharactersVisibleConvert (QString text)
910
+ {
911
+ if (text.replace (" \r\n " , " \\ r\\ n\r\n " ).isEmpty ())
912
+ {
913
+ text.replace (" \r " , " \\ r\r " );
914
+ text.replace (" \n " , " \\ n\n " );
915
+ }
916
+
917
+ text.replace (' ' , QChar (183 ));
918
+ text.replace (" \t " , " \\ t\t " );
919
+
920
+ return text;
921
+ }
922
+
905
923
void MainWindow::addLogBytes (QByteArray bytes, bool hexToBinary, bool appendAsLine)
906
924
{
907
925
if (ui->pushButtonTextLogToggle ->isChecked () == false )
@@ -933,7 +951,7 @@ void MainWindow::addLogBytes(QByteArray bytes, bool hexToBinary, bool appendAsLi
933
951
934
952
ui->textBrowserLogs ->horizontalScrollBar ()->setValue (sliderPosHorizontal);
935
953
936
- if (!ui->radioButtonScrollToButtom ->isChecked ())
954
+ if (!ui->checkBoxScrollToButtom ->isChecked ())
937
955
ui->textBrowserLogs ->verticalScrollBar ()->setValue (sliderPosVertical);
938
956
else
939
957
ui->textBrowserLogs ->verticalScrollBar ()->setValue ( ui->textBrowserLogs ->verticalScrollBar ()->maximum ());
@@ -2237,15 +2255,15 @@ void MainWindow::on_toolButtonHideTable_clicked()
2237
2255
2238
2256
void MainWindow::on_comboBoxAddTextMode_currentIndexChanged (int index)
2239
2257
{
2240
- if (index == 1 )
2241
- {
2242
- ui->radioButtonScrollToButtom ->setCheckable (false );
2243
- // ui->radioButtonScrollToButtom->setChecked(false);
2244
- }
2245
- else
2246
- {
2247
- ui->radioButtonScrollToButtom ->setCheckable (true );
2248
- }
2258
+ // if (index == 1)
2259
+ // {
2260
+ // ui->radioButtonScrollToButtom->setCheckable(false);
2261
+ // ui->radioButtonScrollToButtom->setChecked(false);
2262
+ // }
2263
+ // else
2264
+ // {
2265
+ // ui->radioButtonScrollToButtom->setCheckable(true);
2266
+ // }
2249
2267
}
2250
2268
2251
2269
void MainWindow::on_actionHide_parser_data_triggered ()
0 commit comments