Repair regression in Log QSO power and comments retention

This commit is contained in:
Bill Somerville 2018-12-10 18:44:57 +00:00
parent 5e585e8027
commit b2cb2e1d2e
2 changed files with 32 additions and 22 deletions

View File

@ -61,13 +61,25 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString
CabrilloLog * cabrillo_log) CabrilloLog * cabrillo_log)
{ {
if(!isHidden()) return; if(!isHidden()) return;
ui->call->setText(hisCall); ui->call->setText (hisCall);
ui->grid->setText(hisGrid); ui->grid->setText (hisGrid);
ui->name->setText(""); ui->name->clear ();
ui->txPower->setText(""); if (ui->cbTxPower->isChecked ())
ui->comments->setText(""); {
if (ui->cbTxPower->isChecked ()) ui->txPower->setText(m_txPower); ui->txPower->setText (m_txPower);
if (ui->cbComments->isChecked ()) ui->comments->setText(m_comments); }
else
{
ui->txPower->clear ();
}
if (ui->cbComments->isChecked ())
{
ui->comments->setText (m_comments);
}
else
{
ui->comments->clear ();
}
if (m_config->report_in_comments()) { if (m_config->report_in_comments()) {
auto t=mode; auto t=mode;
if(rptSent!="") t+=" Sent: " + rptSent; if(rptSent!="") t+=" Sent: " + rptSent;
@ -112,12 +124,12 @@ void LogQSO::accept()
auto mode = ui->mode->text (); auto mode = ui->mode->text ();
auto rptSent = ui->sent->text (); auto rptSent = ui->sent->text ();
auto rptRcvd = ui->rcvd->text (); auto rptRcvd = ui->rcvd->text ();
auto m_dateTimeOn = ui->start_date_time->dateTime (); auto dateTimeOn = ui->start_date_time->dateTime ();
auto m_dateTimeOff = ui->end_date_time->dateTime (); auto dateTimeOff = ui->end_date_time->dateTime ();
auto band = ui->band->text (); auto band = ui->band->text ();
auto name = ui->name->text (); auto name = ui->name->text ();
auto m_txPower = ui->txPower->text (); m_txPower = ui->txPower->text ();
auto m_comments = ui->comments->text (); m_comments = ui->comments->text ();
auto strDialFreq = QString::number (m_dialFreq / 1.e6,'f',6); auto strDialFreq = QString::number (m_dialFreq / 1.e6,'f',6);
auto operator_call = ui->loggedOperator->text (); auto operator_call = ui->loggedOperator->text ();
auto xsent = ui->exchSent->text (); auto xsent = ui->exchSent->text ();
@ -136,7 +148,7 @@ void LogQSO::accept()
return; // without accepting return; // without accepting
} }
if (!m_cabrilloLog->add_QSO (m_dialFreq, m_dateTimeOff, hisCall, xsent, xrcvd)) if (!m_cabrilloLog->add_QSO (m_dialFreq, dateTimeOff, hisCall, xsent, xrcvd))
{ {
show (); show ();
MessageBox::warning_message (this, tr ("Invalid QSO Data"), MessageBox::warning_message (this, tr ("Invalid QSO Data"),
@ -152,10 +164,10 @@ void LogQSO::accept()
tr ("Cannot open \"%1\" for append").arg (f.fileName ()), tr ("Cannot open \"%1\" for append").arg (f.fileName ()),
tr ("Error: %1").arg (f.errorString ())); tr ("Error: %1").arg (f.errorString ()));
} else { } else {
QString logEntry=m_dateTimeOn.date().toString("yyyy-MM-dd,") + QString logEntry=dateTimeOn.date().toString("yyyy-MM-dd,") +
m_dateTimeOn.time().toString("hh:mm:ss,") + dateTimeOn.time().toString("hh:mm:ss,") +
m_dateTimeOff.date().toString("yyyy-MM-dd,") + dateTimeOff.date().toString("yyyy-MM-dd,") +
m_dateTimeOff.time().toString("hh:mm:ss,") + hisCall + "," + dateTimeOff.time().toString("hh:mm:ss,") + hisCall + "," +
hisGrid + "," + strDialFreq + "," + mode + hisGrid + "," + strDialFreq + "," + mode +
"," + rptSent + "," + rptRcvd + "," + m_txPower + "," + rptSent + "," + rptRcvd + "," + m_txPower +
"," + m_comments + "," + name; "," + m_comments + "," + name;
@ -165,7 +177,7 @@ void LogQSO::accept()
} }
//Clean up and finish logging //Clean up and finish logging
Q_EMIT acceptQSO (m_dateTimeOff Q_EMIT acceptQSO (dateTimeOff
, hisCall , hisCall
, hisGrid , hisGrid
, m_dialFreq , m_dialFreq
@ -175,7 +187,7 @@ void LogQSO::accept()
, m_txPower , m_txPower
, m_comments , m_comments
, name , name
, m_dateTimeOn , dateTimeOn
, operator_call , operator_call
, m_myCall , m_myCall
, m_myGrid , m_myGrid
@ -186,8 +198,8 @@ void LogQSO::accept()
, mode , mode
, rptSent , rptSent
, rptRcvd , rptRcvd
, m_dateTimeOn , dateTimeOn
, m_dateTimeOff , dateTimeOff
, band , band
, m_comments , m_comments
, name , name

View File

@ -59,8 +59,6 @@ private:
Radio::Frequency m_dialFreq; Radio::Frequency m_dialFreq;
QString m_myCall; QString m_myCall;
QString m_myGrid; QString m_myGrid;
QDateTime m_dateTimeOn;
QDateTime m_dateTimeOff;
CabrilloLog * m_cabrilloLog; CabrilloLog * m_cabrilloLog;
}; };