From 11f821b7293932df38df7df683ca4527cbc8a13a Mon Sep 17 00:00:00 2001 From: Ladislav Foldyna Date: Tue, 28 Feb 2023 15:39:25 +0100 Subject: [PATCH] Fixing #176 - Fixed misunderstanding _SENT Status Values --- logformat/AdiFormat.cpp | 29 ++--- ui/ClublogDialog.cpp | 2 +- ui/Eqsldialog.cpp | 2 +- ui/LotwDialog.cpp | 2 +- ui/NewContactWidget.cpp | 69 +++++++++-- ui/NewContactWidget.h | 2 + ui/NewContactWidget.ui | 264 ++++++++++++++++++++++++++++++---------- ui/QSODetailDialog.ui | 6 + ui/QrzDialog.cpp | 2 +- 9 files changed, 286 insertions(+), 92 deletions(-) diff --git a/logformat/AdiFormat.cpp b/logformat/AdiFormat.cpp index dfefbc22..7ea314cf 100644 --- a/logformat/AdiFormat.cpp +++ b/logformat/AdiFormat.cpp @@ -650,8 +650,10 @@ QString AdiFormat::parseQslRcvd(const QString &value) { qCDebug(function_parameters)<qslSentBox->addItem(tr("Queued"), QVariant("Q")); ui->qslSentBox->addItem(tr("Ignored"), QVariant("I")); + /**************************/ + /* QSL Send LoTW Combo Content */ + /**************************/ + /* do no use DEFINE_CONTACT_FIELDS_ENUMS for it because + * DEFINE_CONTACT_FIELDS_ENUMS has a different ordering. + * Ordering below is optimized for a new Contact Widget only + */ + ui->eQSLSentBox->addItem(tr("No"), QVariant("N")); + ui->eQSLSentBox->addItem(tr("Yes"), QVariant("Y")); + ui->eQSLSentBox->addItem(tr("Requested"), QVariant("R")); + ui->eQSLSentBox->addItem(tr("Queued"), QVariant("Q")); + ui->eQSLSentBox->addItem(tr("Ignored"), QVariant("I")); + + /**************************/ + /* QSL Send eQSL Combo Content */ + /**************************/ + /* do no use DEFINE_CONTACT_FIELDS_ENUMS for it because + * DEFINE_CONTACT_FIELDS_ENUMS has a different ordering. + * Ordering below is optimized for a new Contact Widget only + */ + ui->lotwQslSentBox->addItem(tr("No"), QVariant("N")); + ui->lotwQslSentBox->addItem(tr("Yes"), QVariant("Y")); + ui->lotwQslSentBox->addItem(tr("Requested"), QVariant("R")); + ui->lotwQslSentBox->addItem(tr("Queued"), QVariant("Q")); + ui->lotwQslSentBox->addItem(tr("Ignored"), QVariant("I")); + /*****************************/ /* QSL SendVia Combo Content */ /*****************************/ @@ -274,6 +300,17 @@ NewContactWidget::NewContactWidget(QWidget *parent) : connectFieldChanged(); } +void NewContactWidget::setComboBaseData(QComboBox *combo, const QString &data) +{ + FCT_IDENTIFICATION; + + int index = combo->findData(data); + if ( index != -1 ) + { + combo->setCurrentIndex(index); + } +} + void NewContactWidget::readWidgetSettings() { FCT_IDENTIFICATION; @@ -284,11 +321,17 @@ void NewContactWidget::readWidgetSettings() realRigFreq = settings.value("newcontact/frequency", 3.5).toDouble(); double power = settings.value("newcontact/power", 100).toDouble(); int tabIndex = settings.value("newcontact/tabindex", 0).toInt(); + QString qslSent = settings.value("newcontact/qslsent", "Q").toString(); + QString eqslQslSent = settings.value("newcontact/eqslqslsent", "Q").toString(); + QString lotwQslSent = settings.value("newcontact/lotwqslsent", "Q").toString(); ui->modeEdit->setCurrentText(mode); ui->submodeEdit->setCurrentText(submode); ui->powerEdit->setValue(power); ui->tabWidget_2->setCurrentIndex(tabIndex); + setComboBaseData(ui->qslSentBox, qslSent); + setComboBaseData(ui->lotwQslSentBox, lotwQslSent); + setComboBaseData(ui->eQSLSentBox, eqslQslSent); } void NewContactWidget::writeWidgetSetting() @@ -301,6 +344,9 @@ void NewContactWidget::writeWidgetSetting() settings.setValue("newcontact/frequency", realRigFreq); settings.setValue("newcontact/power", ui->powerEdit->value()); settings.setValue("newcontact/tabindex", ui->tabWidget_2->currentIndex()); + settings.setValue("newcontact/qslsent", ui->qslSentBox->itemData(ui->qslSentBox->currentIndex())); + settings.setValue("newcontact/eqslqslsent", ui->eQSLSentBox->itemData(ui->eQSLSentBox->currentIndex())); + settings.setValue("newcontact/eqslqslsent", ui->lotwQslSentBox->itemData(ui->lotwQslSentBox->currentIndex())); } /* function read global setting, called when starting or when Setting is reloaded */ @@ -879,7 +925,6 @@ void NewContactWidget::resetContact() ui->distanceInfo->clear(); ui->bearingInfo->clear(); ui->partnerLocTimeInfo->clear(); - ui->qslSentBox->setCurrentIndex(0); ui->qslSentViaBox->setCurrentIndex(0); ui->cqEdit->clear(); ui->ituEdit->clear(); @@ -926,14 +971,19 @@ void NewContactWidget::addAddlFields(QSqlRecord &record, const StationProfile &p record.setValue("qsl_sent", ui->qslSentBox->itemData(ui->qslSentBox->currentIndex())); } + if ( record.value("lotw_qsl_sent").toString().isEmpty() ) + { + record.setValue("lotw_qsl_sent", ui->lotwQslSentBox->itemData(ui->lotwQslSentBox->currentIndex())); + } + + if ( record.value("eqsl_qsl_sent").toString().isEmpty() ) + { + record.setValue("eqsl_qsl_sent", ui->eQSLSentBox->itemData(ui->eQSLSentBox->currentIndex())); + } + record.setValue("qsl_rcvd", "N"); - record.setValue("lotw_qsl_sent", "N"); record.setValue("lotw_qsl_rcvd", "N"); record.setValue("eqsl_qsl_rcvd", "N"); - record.setValue("eqsl_qsl_sent", "N"); - record.setValue("hrdlog_qso_upload_status", "N"); - record.setValue("qrzcom_qsoupload_status", "N"); - record.setValue("clublog_qso_upload_status", "N"); /* isNull is not necessary to use because NULL Text fields are empty */ if ( record.value("my_gridsquare").toString().isEmpty() @@ -1304,6 +1354,12 @@ void NewContactWidget::connectFieldChanged() connect(ui->qslSentBox, &QComboBox::currentTextChanged, this, &NewContactWidget::formFieldChangedString); + connect(ui->lotwQslSentBox, &QComboBox::currentTextChanged, + this, &NewContactWidget::formFieldChangedString); + + connect(ui->eQSLSentBox, &QComboBox::currentTextChanged, + this, &NewContactWidget::formFieldChangedString); + connect(ui->qslSentViaBox, &QComboBox::currentTextChanged, this, &NewContactWidget::formFieldChangedString); @@ -1443,7 +1499,6 @@ void NewContactWidget::saveContact() record.setValue("sig_info_intl", ui->sigInfoEdit->text()); } - record.setValue("qsl_sent", ui->qslSentBox->itemData(ui->qslSentBox->currentIndex())); if ( ! ui->qslSentViaBox->currentText().isEmpty() ) { diff --git a/ui/NewContactWidget.h b/ui/NewContactWidget.h index f68f77f7..83f75554 100644 --- a/ui/NewContactWidget.h +++ b/ui/NewContactWidget.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "data/Data.h" #include "core/Gridsquare.h" #include "data/DxSpot.h" @@ -135,6 +136,7 @@ private slots: void changeCallsignManually(const QString &, double); void __changeFrequency(VFOID, double vfoFreq, double ritFreq, double xitFreq); void showRXTXFreqs(bool); + void setComboBaseData(QComboBox *, const QString &); private: Rig* rig; diff --git a/ui/NewContactWidget.ui b/ui/NewContactWidget.ui index 61e803ca..594a8109 100644 --- a/ui/NewContactWidget.ui +++ b/ui/NewContactWidget.ui @@ -1572,54 +1572,187 @@ - QSL Sent + QSL Send Status - - - - 0 - 0 - - - - - 50 - 0 - - - - Qt::ClickFocus - - + + + + + + 0 + 0 + + + + Paper + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Qt::ClickFocus + + + <b>Yes</b> - an outgoing QSL card has been sent; the QSO has been uploaded to, and accepted by, the online service<br/><b>No</b> - do not send an outgoing QSL card; do not upload the QSO to the online service<br/><b>Requested</b> - the contacted station has requested a QSL card; the contacted station has requested the QSO be uploaded to the online service<br/><b>Queued</b> - an outgoing QSL card has been selected to be sent; a QSO has been selected to be uploaded to the online service<br/> + + + + + + + + 0 + 0 + + + + LoTW + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Qt::ClickFocus + + + <b>Yes</b> - an outgoing QSL card has been sent; the QSO has been uploaded to, and accepted by, the online service<br/><b>No</b> - do not send an outgoing QSL card; do not upload the QSO to the online service<br/><b>Requested</b> - the contacted station has requested a QSL card; the contacted station has requested the QSO be uploaded to the online service<br/><b>Queued</b> - an outgoing QSL card has been selected to be sent; a QSO has been selected to be uploaded to the online service<br/> + + + + + + + + 0 + 0 + + + + eQSL + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Qt::ClickFocus + + + <b>Yes</b> - an outgoing QSL card has been sent; the QSO has been uploaded to, and accepted by, the online service<br/><b>No</b> - do not send an outgoing QSL card; do not upload the QSO to the online service<br/><b>Requested</b> - the contacted station has requested a QSL card; the contacted station has requested the QSO be uploaded to the online service<br/><b>Queued</b> - an outgoing QSL card has been selected to be sent; a QSO has been selected to be uploaded to the online service<br/> + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - QSLSent via + QSL Send via - - - - 0 - 0 - - - - - 50 - 0 - - - - Qt::ClickFocus - - + + + + + + 0 + 0 + + + + Paper + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Qt::ClickFocus + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -2220,6 +2353,7 @@ commentEdit dateEdit timeOnEdit + timeOffEdit saveButton resetButton noteEdit @@ -2252,7 +2386,7 @@ 540 - 152 + 138 407 @@ -2267,8 +2401,8 @@ stopContactTimer() - 395 - 210 + 377 + 182 516 @@ -2299,8 +2433,8 @@ modeChanged() - 440 - 72 + 431 + 74 516 @@ -2315,8 +2449,8 @@ resetContact() - 613 - 210 + 595 + 182 352 @@ -2331,8 +2465,8 @@ saveContact() - 527 - 210 + 509 + 182 352 @@ -2363,8 +2497,8 @@ startContactTimer() - 235 - 210 + 243 + 182 352 @@ -2379,8 +2513,8 @@ qrz() - 735 - 210 + 726 + 182 445 @@ -2395,8 +2529,8 @@ subModeChanged() - 532 - 72 + 523 + 74 453 @@ -2428,7 +2562,7 @@ 859 - 457 + 433 562 @@ -2443,8 +2577,8 @@ stationProfileComboChanged(QString) - 191 - 295 + 208 + 272 669 @@ -2460,7 +2594,7 @@ 418 - 332 + 365 669 @@ -2491,8 +2625,8 @@ rigProfileComboChanged(QString) - 191 - 326 + 208 + 303 736 @@ -2507,8 +2641,8 @@ antProfileComboChanged(QString) - 191 - 357 + 208 + 334 736 @@ -2523,8 +2657,8 @@ sotaEditFinished() - 347 - 293 + 418 + 365 489 @@ -2539,8 +2673,8 @@ wwffEditFinished() - 347 - 448 + 418 + 396 489 @@ -2555,8 +2689,8 @@ wwffChanged(QString) - 347 - 448 + 418 + 396 489 diff --git a/ui/QSODetailDialog.ui b/ui/QSODetailDialog.ui index 1d4a9ff4..b68a3941 100644 --- a/ui/QSODetailDialog.ui +++ b/ui/QSODetailDialog.ui @@ -1744,6 +1744,9 @@ Qt::WheelFocus + + <b>Yes</b> - an outgoing QSL card has been sent; the QSO has been uploaded to, and accepted by, the online service<br/><b>No</b> - do not send an outgoing QSL card; do not upload the QSO to the online service<br/><b>Requested</b> - the contacted station has requested a QSL card; the contacted station has requested the QSO be uploaded to the online service<br/><b>Queued</b> - an outgoing QSL card has been selected to be sent; a QSO has been selected to be uploaded to the online service<br/> + @@ -1794,6 +1797,9 @@ 0 + + <b>Yes</b> - an incoming QSL card has been received; the QSO has been confirmed by the online service<br/><b>No</b> - an incoming QSL card has not been received; the QSO has not been confirmed by the online service<br/><b>Requested</b> - the logging station has requested a QSL card; the logging station has requested the QSO be uploaded to the online service<br/> + diff --git a/ui/QrzDialog.cpp b/ui/QrzDialog.cpp index 2e0cbe4f..ab46c7c7 100644 --- a/ui/QrzDialog.cpp +++ b/ui/QrzDialog.cpp @@ -51,7 +51,7 @@ void QRZDialog::upload() /* ??? QRZ Support all ADIF Fields ??? */ QString query_string = "SELECT * "; QString query_from = "FROM contacts "; - QString query_where = "WHERE (qrzcom_qso_upload_status <> 'Y' OR qrzcom_qso_upload_status is NULL) "; + QString query_where = "WHERE (qrzcom_qso_upload_status = 'M' OR qrzcom_qso_upload_status is NULL) "; QString query_order = " ORDER BY start_time "; saveDialogState();