From 27cdd98cb7dd659947e3f887faa87a5016a354a1 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Wed, 5 Jun 2019 14:19:31 -0400 Subject: [PATCH] Updated log window to maintain contents if the call selected does not change --- logqso.cpp | 6 ++++++ logqso.h | 1 + mainwindow.cpp | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/logqso.cpp b/logqso.cpp index f85f581..7d18197 100644 --- a/logqso.cpp +++ b/logqso.cpp @@ -56,6 +56,10 @@ bool LogQSO::acceptText(QString text){ return true; } +QString LogQSO::currentCall(){ + return ui->call->text().trimmed(); +} + void LogQSO::on_start_now_button_pressed(){ ui->start_date_time->setDateTime(DriftingDateTime::currentDateTimeUtc()); } @@ -296,6 +300,8 @@ void LogQSO::accept() } //Clean up and finish logging + ui->call->clear(); + Q_EMIT acceptQSO (m_dateTimeOff, hisCall, hisGrid, m_dialFreq, mode, submode, rptSent, rptRcvd, comments, name,m_dateTimeOn, operator_call, m_myCall, m_myGrid, ADIF, additionalFields); QDialog::accept(); diff --git a/logqso.h b/logqso.h index dd3c762..c256e70 100644 --- a/logqso.h +++ b/logqso.h @@ -38,6 +38,7 @@ public: public slots: void accept(); bool acceptText(QString text); + QString currentCall(); signals: void acceptQSO (QDateTime const& QSO_date_off, QString const& call, QString const& grid diff --git a/mainwindow.cpp b/mainwindow.cpp index 88cd6ca..4c4d4b1 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -6627,6 +6627,12 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button QString comments = ui->textEditRX->textCursor().selectedText(); + // don't reset the log window if the call hasn't changed. + if(!m_logDlg->currentCall().isEmpty() && call.trimmed() == m_logDlg->currentCall()){ + m_logDlg->show(); + return; + } + m_logDlg->initLogQSO (call.trimmed(), grid.trimmed(), m_modeTx == "FT8" ? "JS8" : m_modeTx, m_rptSent, m_rptRcvd, m_dateTimeQSOOn, dateTimeQSOOff, m_freqNominal + ui->TxFreqSpinBox->value(), m_config.my_callsign(), m_config.my_grid(),