From d8a14257157e97a41fbcf42f6873384f4672ba11 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sat, 14 Aug 2021 12:59:00 -0400 Subject: [PATCH] Change trace logger Log Last text to be a label instead of a checkbox. Logging will always go to screen even if also going to a file. The same buffer is used for both. --- src/drivers/Qt/TraceLogger.cpp | 20 +++++++------------- src/drivers/Qt/TraceLogger.h | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/drivers/Qt/TraceLogger.cpp b/src/drivers/Qt/TraceLogger.cpp index aabb6b66..8491aaaf 100644 --- a/src/drivers/Qt/TraceLogger.cpp +++ b/src/drivers/Qt/TraceLogger.cpp @@ -216,10 +216,9 @@ TraceLoggerDialog_t::TraceLoggerDialog_t(QWidget *parent) mainLayout->addLayout(grid, 1); lbl = new QLabel(tr("Lines")); - logLastCbox = new QCheckBox(tr("Log Last")); + logLastLbl = new QLabel(tr("Log Last")); logMaxLinesComboBox = new QComboBox(); - logLastCbox->setChecked(true); logMaxLinesComboBox->addItem(tr("3,000,000"), 3000000); logMaxLinesComboBox->addItem(tr("1,000,000"), 1000000); logMaxLinesComboBox->addItem(tr("300,000"), 300000); @@ -270,7 +269,7 @@ TraceLoggerDialog_t::TraceLoggerDialog_t(QWidget *parent) connect( clearButton, SIGNAL(clicked(void)), this, SLOT(clearLog(void))); hbox = new QHBoxLayout(); - hbox->addWidget(logLastCbox); + hbox->addWidget(logLastLbl); hbox->addWidget(logMaxLinesComboBox); hbox->addWidget(lbl); @@ -425,20 +424,13 @@ void TraceLoggerDialog_t::updatePeriodic(void) { char traceViewDrawEnable; - if (logLastCbox->isChecked()) + if (FCEUI_EmulationPaused()) { - if (FCEUI_EmulationPaused()) - { - traceViewDrawEnable = 1; - } - else - { - traceViewDrawEnable = autoUpdateCbox->isChecked(); - } + traceViewDrawEnable = 1; } else { - traceViewDrawEnable = 0; + traceViewDrawEnable = autoUpdateCbox->isChecked(); } if ( !logging || !logFileCbox->isChecked()) @@ -515,6 +507,8 @@ void TraceLoggerDialog_t::toggleLoggingOnOff(void) diskThread->requestInterruption(); diskThread->quit(); diskThread->wait(1000); + + traceView->update(); } else { diff --git a/src/drivers/Qt/TraceLogger.h b/src/drivers/Qt/TraceLogger.h index 8e0454e3..a3623732 100644 --- a/src/drivers/Qt/TraceLogger.h +++ b/src/drivers/Qt/TraceLogger.h @@ -161,7 +161,7 @@ public: void showBufferWarning(void); protected: QTimer *updateTimer; - QCheckBox *logLastCbox; + QLabel *logLastLbl; QCheckBox *logFileCbox; QComboBox *logMaxLinesComboBox;