Skip to content

Commit

Permalink
Fixed #403 #405 - Added more information from callbook for WSJTX QSOs
Browse files Browse the repository at this point in the history
  • Loading branch information
foldynl committed Aug 23, 2024
1 parent b93218f commit efbceec
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 7 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TBC - 0.38.0
- [NEW] - POTA Fields allow a comma-delimited list of one or more POTA Refs
- [NEW] - WSJTX tunes freq/mode like Rig if rig is disconnected
- [CHANGED] - Alert Widget is a Dock Widget (issue #399)
- [CHANGED] - QLog adds more information from callbook for WSJTX QSOs (issues #403 #405 #420)
- [CHANGED] - File Open dialogs are not a native dialog under Linux (issue #427)
- [CHANGED] - Profiles transferred to DB
- [CHANGED] - LOV last_dates transferred to DB
Expand Down
65 changes: 58 additions & 7 deletions ui/NewContactWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ void NewContactWidget::saveExternalContact(QSqlRecord record)

const DxccEntity &dxcc = Data::instance()->lookupDxcc(savedCallsign);

if ( !dxcc.country.isEmpty() )
if ( dxcc.dxcc != 0 )
{
if ( record.value("country_intl").toString().isEmpty()
&& record.value("country").toString().isEmpty() )
Expand All @@ -1734,12 +1734,63 @@ void NewContactWidget::saveExternalContact(QSqlRecord record)
}

// add information from callbook if it is a known callsign
if ( record.value("name_intl").toString().isEmpty()
&& record.value("name").toString().isEmpty()
&& savedCallsign == ui->callsignEdit->text()
&& !uiDynamic->nameEdit->text().isEmpty() )
{
record.setValue("name_intl", uiDynamic->nameEdit->text());
// based on the poll #420, QLog adds more information from callbook
if ( savedCallsign == ui->callsignEdit->text() )
{
// information independent of QTH
if ( record.value("name_intl").toString().isEmpty()
&& record.value("name").toString().isEmpty()
&& !uiDynamic->nameEdit->text().isEmpty() )
record.setValue("name_intl", uiDynamic->nameEdit->text());

if ( record.value("email").toString().isEmpty()
&& !uiDynamic->emailEdit->text().isEmpty() )
record.setValue("email", uiDynamic->emailEdit->text());

if ( record.value("qsl_via").toString().isEmpty()
&& !ui->qslViaEdit->text().isEmpty() )
record.setValue("qsl_via", ui->qslViaEdit->text());

if ( record.value("web").toString().isEmpty()
&& !uiDynamic->urlEdit->text().isEmpty() )
record.setValue("web", uiDynamic->urlEdit->text());

if ( record.value("darc_dok").toString().isEmpty()
&& !uiDynamic->dokEdit->text().isEmpty() )
record.setValue("darc_dok", uiDynamic->dokEdit->text());

// information depending on QTH (Grid)
const QString &savedGrid = record.value("gridsquare").toString();
if ( savedGrid.startsWith(uiDynamic->gridEdit->text(), Qt::CaseSensitivity::CaseInsensitive)
|| uiDynamic->gridEdit->text().startsWith(savedGrid, Qt::CaseSensitivity::CaseInsensitive ) )
{
if ( uiDynamic->gridEdit->text().size() > savedGrid.size() )
record.setValue("gridsquare", uiDynamic->gridEdit->text());

if ( record.value("qth_intl").toString().isEmpty()
&& record.value("qth").toString().isEmpty()
&& !uiDynamic->qthEdit->text().isEmpty() )
record.setValue("qth_intl", uiDynamic->qthEdit->text());

if ( record.value("iota").toString().isEmpty()
&& !uiDynamic->iotaEdit->text().isEmpty() )
record.setValue("iota", uiDynamic->iotaEdit->text());

if ( record.value("cnty").toString().isEmpty()
&& !uiDynamic->countyEdit->text().isEmpty() )
record.setValue("cnty", uiDynamic->countyEdit->text());

if ( record.value("state").toString().isEmpty()
&& !uiDynamic->stateEdit->text().isEmpty() )
record.setValue("state", uiDynamic->stateEdit->text());

// fix ITUz and CQz from callbook, if necessary
if ( record.value("ituz").toString() != uiDynamic->ituEdit->text() )
record.setValue("ituz", uiDynamic->ituEdit->text());

if ( record.value("cqz").toString() != uiDynamic->cqzEdit->text() )
record.setValue("cqz", uiDynamic->cqzEdit->text());
}
}

const StationProfile &profile = StationProfilesManager::instance()->getCurProfile1();
Expand Down

0 comments on commit efbceec

Please sign in to comment.