Skip to content

Commit b9f26b8

Browse files
author
Mich
committed
Refactoring, added checkBoxTableAutoResize to settings.
1 parent 06442df commit b9f26b8

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

src/config.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77

88
#define INTRO_TEXT "" \
99
"Welcome to QtSerialMonitor, \n" \
10-
"Press F1 to activate \"What's this\" mode. In this mode, clicked widget will display an explanation about its function. \n"
10+
"Press F1 to activate \"What's this\" mode. In this mode, clicked widget \r" \
11+
"will display an explanation about its function. \n"
1112
#endif // CONFIG_H

src/mainwindow.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ void MainWindow::settingsLoadAll()
272272
ui->comboBoxRAMSaveMode->setCurrentIndex(appSettings.value("GUI_Elements/comboBoxRAMSaveMode.currentIndex").value<int>());
273273
ui->comboBoxLoggingMode->setCurrentIndex(appSettings.value("GUI_Elements/comboBoxLoggingMode.currentIndex").value<int>());
274274

275-
276275
ui->checkBoxDTR->setChecked(appSettings.value("GUI_Elements/checkBoxDTR.isChecked").value<bool>());
277276
ui->checkBoxSimplify->setChecked(appSettings.value("GUI_Elements/checkBoxSimplify.isChecked").value<bool>());
278277
ui->checkBoxSendKey->setChecked(appSettings.value("GUI_Elements/checkBoxSendKey.isChecked").value<bool>());
@@ -285,11 +284,12 @@ void MainWindow::settingsLoadAll()
285284
ui->checkBoxAppendDate->setChecked(appSettings.value("GUI_Elements/checkBoxAppendDate.isChecked").value<bool>());
286285
ui->checkBoxSimplifyLog->setChecked(appSettings.value("GUI_Elements/checkBoxSimplifyLog.isChecked").value<bool>());
287286
ui->checkBoxRAMClearChart->setChecked(appSettings.value("GUI_Elements/checkBoxRAMClearChart.isChecked").value<bool>());
288-
ui->checkBoxEnableRAMBuffer->setChecked(appSettings.value("GUI_Elements/checkBoxEnableRAMBuffer.isChecked", true).value<bool>()); // default value set to true !
287+
ui->checkBoxAutoSaveBuffer->setChecked(appSettings.value("GUI_Elements/checkBoxAutoSaveBuffer.isChecked", true).value<bool>());
288+
ui->checkBoxTableAutoResize->setChecked(appSettings.value("GUI_Elements/checkBoxTableAutoResize.isChecked", true).value<bool>()); // default value set to true !
289289

290-
ui->pushButtonEnablePlot->setChecked(appSettings.value("GUI_Elements/pushButtonEnablePlot.isChecked").value<bool>());
290+
ui->pushButtonEnablePlot->setChecked(appSettings.value("GUI_Elements/pushButtonEnablePlot.isChecked", false).value<bool>());
291291

292-
ui->tabWidgetConnectivity->setCurrentIndex(appSettings.value("GUI_Elements/tabWidgetConnectivity.currentIndex").value<int>());
292+
ui->tabWidgetControlSection->setCurrentIndex(appSettings.value("GUI_Elements/tabWidgetControlSection.currentIndex").value<int>());
293293

294294
ui->lineEditCustomParsingRules->setText(appSettings.value("data/lineEditCustomParsingRules.text").value<QString>());
295295
ui->lineEditUDPTargetIP->setText(appSettings.value("data/lineEditUDPTargetIP.text").value<QString>());
@@ -367,11 +367,12 @@ void MainWindow::settingsSaveAll()
367367
appSettings.setValue("GUI_Elements/checkBoxAppendDate.isChecked", ui->checkBoxAppendDate->isChecked());
368368
appSettings.setValue("GUI_Elements/checkBoxSimplifyLog.isChecked", ui->checkBoxSimplifyLog->isChecked());
369369
appSettings.setValue("GUI_Elements/checkBoxRAMClearChart.isChecked", ui->checkBoxRAMClearChart->isChecked());
370-
appSettings.setValue("GUI_Elements/checkBoxEnableRAMBuffer.isChecked", ui->checkBoxEnableRAMBuffer->isChecked());
370+
appSettings.setValue("GUI_Elements/checkBoxAutoSaveBuffer.isChecked", ui->checkBoxAutoSaveBuffer->isChecked());
371+
appSettings.setValue("GUI_Elements/checkBoxTableAutoResize.isChecked", ui->checkBoxTableAutoResize->isChecked());
371372

372373
appSettings.setValue("GUI_Elements/pushButtonEnablePlot.isChecked", ui->pushButtonEnablePlot->isChecked());
373374

374-
appSettings.setValue("GUI_Elements/tabWidgetConnectivity.currentIndex", ui->tabWidgetConnectivity->currentIndex());
375+
appSettings.setValue("GUI_Elements/tabWidgetControlSection.currentIndex", ui->tabWidgetControlSection->currentIndex());
375376

376377
appSettings.setValue("data/lineEditCustomParsingRules.text", ui->lineEditCustomParsingRules->text());
377378
appSettings.setValue("data/lineEditUDPTargetIP.text", ui->lineEditUDPTargetIP->text());
@@ -1108,7 +1109,7 @@ void MainWindow::sendSerial(QString message)
11081109

11091110
void MainWindow::saveToRAM(QStringList newlabelList, QList<double> newDataList, QList<long> newTimeList, bool saveText, QString text)
11101111
{
1111-
if (ui->checkBoxEnableRAMBuffer->isChecked() == false)
1112+
if (ui->checkBoxAutoSaveBuffer->isChecked() == false)
11121113
return;
11131114

11141115
if (text.isEmpty() == false && saveText == true)
@@ -1938,6 +1939,8 @@ void MainWindow::on_updateProgressBar(float *percent)
19381939

19391940
void MainWindow::on_processLoadedFile(QString *text)
19401941
{
1942+
disconnect(&fileReader, SIGNAL(textReady(QString *)), this, SLOT(on_processLoadedFile(QString *)));
1943+
19411944
connect(&parser, SIGNAL(updateProgress(float *)), this, SLOT(on_updateProgressBar(float *)));
19421945
parser.setReportProgress(true);
19431946

@@ -1956,8 +1959,6 @@ void MainWindow::on_processLoadedFile(QString *text)
19561959
this->processChart(labelList, numericDataList, timeStampList);
19571960
this->processTable(labelList, numericDataList);
19581961
this->saveToRAM(labelList, numericDataList, timeStampList);
1959-
1960-
disconnect(&fileReader, SIGNAL(textReady(QString *)), this, SLOT(on_processLoadedFile(QString *)));
19611962
}
19621963

19631964
void MainWindow::on_pushButtonLoadRAMBuffer_clicked()

src/mainwindow.ui

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<number>0</number>
4747
</property>
4848
<item row="2" column="0" colspan="2">
49-
<widget class="QTabWidget" name="tabWidgetConnectivity">
49+
<widget class="QTabWidget" name="tabWidgetControlSection">
5050
<property name="sizePolicy">
5151
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
5252
<horstretch>0</horstretch>
@@ -643,7 +643,7 @@
643643
<number>99999</number>
644644
</property>
645645
<property name="value">
646-
<number>44444</number>
646+
<number>0</number>
647647
</property>
648648
</widget>
649649
</item>
@@ -696,7 +696,7 @@
696696
<number>1</number>
697697
</property>
698698
<property name="value">
699-
<number>55555</number>
699+
<number>0</number>
700700
</property>
701701
<property name="displayIntegerBase">
702702
<number>10</number>
@@ -1321,7 +1321,7 @@
13211321
</spacer>
13221322
</item>
13231323
<item row="2" column="0">
1324-
<widget class="QCheckBox" name="checkBoxEnableRAMBuffer">
1324+
<widget class="QCheckBox" name="checkBoxAutoSaveBuffer">
13251325
<property name="sizePolicy">
13261326
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
13271327
<horstretch>0</horstretch>
@@ -2146,7 +2146,7 @@
21462146
<item>
21472147
<widget class="QPushButton" name="pushButtonSetSelectedToGraph">
21482148
<property name="text">
2149-
<string>Apply selected to plot rules</string>
2149+
<string>Apply selected to plot</string>
21502150
</property>
21512151
</widget>
21522152
</item>
@@ -2556,7 +2556,7 @@
25562556
<tabstop>checkBoxSimplify</tabstop>
25572557
<tabstop>pushButtonScrollToButtom</tabstop>
25582558
<tabstop>pushButtonClear</tabstop>
2559-
<tabstop>tabWidgetConnectivity</tabstop>
2559+
<tabstop>tabWidgetControlSection</tabstop>
25602560
<tabstop>pushButtonSend</tabstop>
25612561
</tabstops>
25622562
<resources/>

src/serial.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ void Serial::readString()
4747

4848
bool Serial::setReadMode(int mode)
4949
{
50-
5150
// ui->comboBoxSerialReadMode->addItem("canReadLine | readLine");
5251
// ui->comboBoxSerialReadMode->addItem("canReadLine | readAll");
5352
// ui->comboBoxSerialReadMode->addItem("bytesAvailable | readLine");

0 commit comments

Comments
 (0)