|
|
@ -2045,18 +2045,28 @@ void MainWindow::setupDebugLogTab() { |
|
|
|
|
|
|
|
ui->debugLog->setPlainText( readDebugLines() ); |
|
|
|
|
|
|
|
// Set up timer
|
|
|
|
QTimer* debugTimer = new QTimer(); |
|
|
|
QObject::connect(debugTimer, &QTimer::timeout, [=]() { |
|
|
|
uint32_t debugLines = ui->debugLines->text().trimmed().toInt(); |
|
|
|
if (debugLines == 0) { debugLines = 50; } |
|
|
|
ui->debugLog->setPlainText( readDebugLines(debugLines) ); |
|
|
|
DEBUG("Refreshed debug data with debugLines=" << debugLines); |
|
|
|
QObject::connect(ui->debugAuto, &QCheckBox::stateChanged, [=](auto checked) { |
|
|
|
if(checked) { |
|
|
|
QTimer* debugTimer = new QTimer(); |
|
|
|
DEBUG("debugAuto checkbox checked"); |
|
|
|
// Set up timer
|
|
|
|
QObject::connect(debugTimer, &QTimer::timeout, [=]() { |
|
|
|
uint32_t debugLines = ui->debugLines->text().trimmed().toInt(); |
|
|
|
if (debugLines == 0) { debugLines = 50; } |
|
|
|
ui->debugLog->setPlainText( readDebugLines(debugLines) ); |
|
|
|
DEBUG("Refreshed debug data with debugLines=" << debugLines); |
|
|
|
}); |
|
|
|
//TODO: allow customizing refresh speed
|
|
|
|
uint32_t debugRefreshSpeed = 30*1000; |
|
|
|
debugTimer->start(debugRefreshSpeed); |
|
|
|
DEBUG("started debug refresh at speed=" << debugRefreshSpeed); //Settings::debugRefreshSpeed;
|
|
|
|
} else { |
|
|
|
DEBUG("debugAuto checkbox unchecked"); |
|
|
|
//TODO: store debugTimer in class so we can access it here and stop it
|
|
|
|
// debugTimer->stop();
|
|
|
|
} |
|
|
|
}); |
|
|
|
//TODO: allow customizing refresh speed
|
|
|
|
uint32_t debugRefreshSpeed = 30*1000; |
|
|
|
debugTimer->start(debugRefreshSpeed); |
|
|
|
DEBUG("started debug refresh at speed=" << debugRefreshSpeed); //Settings::debugRefreshSpeed;
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::setupPeersTab() { |
|
|
|