diff --git a/loggingwindow.cpp b/loggingwindow.cpp index 342e0b7..1e0a1ae 100644 --- a/loggingwindow.cpp +++ b/loggingwindow.cpp @@ -27,6 +27,8 @@ loggingWindow::loggingWindow(QWidget *parent) : connect(socket, SIGNAL(disconnected()), this, SLOT(disconnectedFromHost())); connect(socket, SIGNAL(readyRead()), this, SLOT(handleDataFromLoggingHost())); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(handleLoggingHostError(QAbstractSocket::SocketError))); + + ui->debugBtn->setHidden(true); // this button doesn't work yet. } loggingWindow::~loggingWindow() @@ -169,3 +171,8 @@ void loggingWindow::on_copyPathBtn_clicked() { clipboard->setText(logFilename); } + +void loggingWindow::on_debugBtn_clicked(bool checked) +{ + emit setDebugMode(checked); +} diff --git a/loggingwindow.h b/loggingwindow.h index ca57585..c331700 100644 --- a/loggingwindow.h +++ b/loggingwindow.h @@ -45,6 +45,8 @@ private slots: void on_copyPathBtn_clicked(); + void on_debugBtn_clicked(bool checked); + signals: void setDebugMode(bool debugOn); diff --git a/loggingwindow.ui b/loggingwindow.ui index 19587d1..87b2751 100644 --- a/loggingwindow.ui +++ b/loggingwindow.ui @@ -106,6 +106,16 @@ 0 + + + + Enable or disable debug logging + + + Debug + + + diff --git a/wfmain.cpp b/wfmain.cpp index 4feb158..efd8384 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -39,6 +39,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s setWindowTitle(QString("wfview")); + logWindow = new loggingWindow(); initLogging(); qInfo(logSystem()) << version; @@ -51,7 +52,6 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s trxadj = new transceiverAdjustments(); abtBox = new aboutbox(); selRad = new selectRadio(); - logWindow = new loggingWindow(); qRegisterMetaType(); // Needs to be registered early. qRegisterMetaType(); @@ -6975,6 +6975,8 @@ void wfmain::initLogging() // Set handler qInstallMessageHandler(messageHandler); + connect(logWindow, SIGNAL(setDebugMode(bool)), this, SLOT(setDebugLogging(bool))); + // Interval timer for log window updates: logCheckingTimer.setInterval(100); connect(&logCheckingTimer, SIGNAL(timeout()), this, SLOT(logCheck())); @@ -7000,6 +7002,11 @@ void wfmain::handleLogText(QString text) logWindow->acceptLogText(text); } +void wfmain::setDebugLogging(bool debugModeOn) +{ + this->debugMode = debugModeOn; +} + void wfmain::messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg) { // Open stream file writes diff --git a/wfmain.h b/wfmain.h index 2d2563d..337f3b1 100644 --- a/wfmain.h +++ b/wfmain.h @@ -296,6 +296,7 @@ private slots: void setRadioTimeDateSend(); void logCheck(); + void setDebugLogging(bool debugModeOn); // void on_getFreqBtn_clicked();