@@ -145,10 +145,6 @@ void MainWindow::setupGUI()
145
145
ui->comboBoxExternalTimeFormat ->addItem (" [ms]" );
146
146
ui->comboBoxExternalTimeFormat ->setCurrentIndex (0 );
147
147
148
- ui->comboBoxLoggingMode ->addItem (" Log Text" );
149
- ui->comboBoxLoggingMode ->addItem (" Log Parsed Data" );
150
- ui->comboBoxLoggingMode ->setCurrentIndex (0 );
151
-
152
148
ui->comboBoxRAMSaveMode ->addItem (" Save Data Only" );
153
149
ui->comboBoxRAMSaveMode ->addItem (" Save Data & Text" );
154
150
ui->comboBoxRAMSaveMode ->setCurrentIndex (0 );
@@ -1497,30 +1493,6 @@ void MainWindow::on_pushButtonClearHistory_clicked()
1497
1493
ui->comboBoxSend ->clear ();
1498
1494
}
1499
1495
1500
- void MainWindow::on_comboBoxGraphDisplayMode_currentIndexChanged (const QString &arg1)
1501
- {
1502
- clearGraphs (true );
1503
- loadFromRAM (0 );
1504
-
1505
- QPalette *paletteRed = new QPalette ();
1506
- QPalette *paletteBlack = new QPalette ();
1507
- paletteRed->setColor (QPalette::Text, Qt::GlobalColor::red);
1508
- paletteBlack->setColor (QPalette::Text, Qt::GlobalColor::black);
1509
-
1510
- if (arg1.contains (" Auto" , Qt::CaseSensitivity::CaseInsensitive))
1511
- {
1512
- ui->lineEditCustomParsingRules ->setEnabled (false );
1513
- ui->labelParsingRules ->setEnabled (false );
1514
- ui->comboBoxGraphDisplayMode ->setPalette (*paletteBlack);
1515
- }
1516
- else if (arg1.contains (" Custom" , Qt::CaseSensitivity::CaseInsensitive))
1517
- {
1518
- ui->lineEditCustomParsingRules ->setEnabled (true );
1519
- ui->labelParsingRules ->setEnabled (true );
1520
- ui->comboBoxGraphDisplayMode ->setPalette (*paletteRed);
1521
- }
1522
- }
1523
-
1524
1496
void MainWindow::on_pushButtonClearGraphs_clicked ()
1525
1497
{
1526
1498
clearGraphData (true );
@@ -1537,14 +1509,12 @@ void MainWindow::on_lineEditCustomParsingRules_editingFinished()
1537
1509
void MainWindow::on_spinBoxMaxGraphs_valueChanged (int arg1)
1538
1510
{
1539
1511
QPalette *paletteRed = new QPalette ();
1540
- QPalette *paletteBlack = new QPalette ();
1541
1512
paletteRed->setColor (QPalette::Text, Qt::GlobalColor::red);
1542
- paletteBlack->setColor (QPalette::Text, Qt::GlobalColor::black);
1543
1513
1544
1514
if (arg1 > 10 )
1545
1515
ui->spinBoxMaxGraphs ->setPalette (*paletteRed);
1546
1516
else
1547
- ui->spinBoxMaxGraphs ->setPalette (*paletteBlack );
1517
+ ui->spinBoxMaxGraphs ->setPalette (QPalette () );
1548
1518
1549
1519
this ->clearGraphs (false );
1550
1520
this ->loadFromRAM (false );
@@ -1573,22 +1543,18 @@ void MainWindow::on_checkBoxAutoTrack_toggled(bool checked)
1573
1543
1574
1544
void MainWindow::on_spinBoxProcessingDelay_valueChanged (int arg1)
1575
1545
{
1576
- int newInterval = arg1;
1577
- if (newInterval < 1 )
1578
- newInterval = 1 ; // Never 0 ! Couses CPU run like crazy !
1546
+ int newInterval = qMax (1 , arg1); // Never 0 ! Couses CPU run like crazy !
1579
1547
1580
- serialStringProcessingTimer->setInterval (arg1 );
1581
- udpStringProcessingTimer->setInterval (arg1 );
1548
+ serialStringProcessingTimer->setInterval (newInterval );
1549
+ udpStringProcessingTimer->setInterval (newInterval );
1582
1550
1583
1551
QPalette *paletteRed = new QPalette ();
1584
- QPalette *paletteBlack = new QPalette ();
1585
1552
paletteRed->setColor (QPalette::Text, Qt::GlobalColor::red);
1586
- paletteBlack->setColor (QPalette::Text, Qt::GlobalColor::black);
1587
1553
1588
- if (arg1 > ui->spinBoxProcessingDelay ->minimum ())
1554
+ if (newInterval > ui->spinBoxProcessingDelay ->minimum ())
1589
1555
ui->spinBoxProcessingDelay ->setPalette (*paletteRed);
1590
1556
else
1591
- ui->spinBoxProcessingDelay ->setPalette (*paletteBlack );
1557
+ ui->spinBoxProcessingDelay ->setPalette (QPalette () );
1592
1558
}
1593
1559
1594
1560
void MainWindow::on_comboBoxTracerStyle_currentIndexChanged (const QString &arg1)
@@ -2315,3 +2281,25 @@ void MainWindow::on_comboBoxLogFormat_currentIndexChanged(int index)
2315
2281
else if (ui->comboBoxLogFormat ->currentText ().contains (" csv" ))
2316
2282
ui->lineEditSaveFileName ->setText (ui->lineEditSaveFileName ->text ().replace (" txt" , " csv" ));
2317
2283
}
2284
+
2285
+ void MainWindow::on_comboBoxGraphDisplayMode_currentIndexChanged (int index)
2286
+ {
2287
+ clearGraphs (true );
2288
+ loadFromRAM (0 );
2289
+
2290
+ QPalette *paletteRed = new QPalette ();
2291
+ paletteRed->setColor (QPalette::Text, Qt::GlobalColor::red);
2292
+
2293
+ if (index == 0 )
2294
+ {
2295
+ ui->lineEditCustomParsingRules ->setEnabled (false );
2296
+ ui->labelParsingRules ->setEnabled (false );
2297
+ ui->comboBoxGraphDisplayMode ->setPalette (QPalette ()); // Empty = default (OS specific !)
2298
+ }
2299
+ else
2300
+ {
2301
+ ui->lineEditCustomParsingRules ->setEnabled (true );
2302
+ ui->labelParsingRules ->setEnabled (true );
2303
+ ui->comboBoxGraphDisplayMode ->setPalette (*paletteRed);
2304
+ }
2305
+ }
0 commit comments