diff --git a/data/StationProfile.cpp b/data/StationProfile.cpp index 0b72e3e4..0d30bf62 100644 --- a/data/StationProfile.cpp +++ b/data/StationProfile.cpp @@ -11,9 +11,9 @@ MODULE_IDENTIFICATION("qlog.data.stationprofile"); QDataStream& operator<<(QDataStream& out, const StationProfile& v) { out << v.profileName << v.callsign << v.locator - << v.operatorName << v.qthName << v.iota + << v.operatorName << v.operatorCallsign << v.qthName << v.iota << v.sota << v.sig << v.sigInfo << v.vucc - << v.wwff << v.pota << v.ituz << v.cqz << v.dxcc << v.country; + << v.wwff << v.pota << v.ituz << v.cqz << v.dxcc << v.country << v.county; return out; } @@ -23,6 +23,7 @@ QDataStream& operator>>(QDataStream& in, StationProfile& v) in >> v.callsign; in >> v.locator; in >> v.operatorName; + in >> v.operatorCallsign; in >> v.qthName; in >> v.iota; in >> v.sota; @@ -35,6 +36,7 @@ QDataStream& operator>>(QDataStream& in, StationProfile& v) in >> v.cqz; in >> v.dxcc; in >> v.country; + in >> v.county; return in; } @@ -50,7 +52,7 @@ StationProfilesManager::StationProfilesManager() : if ( ! profileQuery.prepare("SELECT profile_name, callsign, locator, " "operator_name, qth_name, iota, sota, sig, sig_info, vucc, pota, " - "ituz, cqz, dxcc, country " + "ituz, cqz, dxcc, country, county, operator_callsign " "FROM station_profiles") ) { qWarning()<< "Cannot prepare select"; @@ -76,6 +78,8 @@ StationProfilesManager::StationProfilesManager() : profileDB.cqz = profileQuery.value(12).toInt(); profileDB.dxcc = profileQuery.value(13).toInt(); profileDB.country = profileQuery.value(14).toString(); + profileDB.county = profileQuery.value(15).toString(); + profileDB.operatorCallsign = profileQuery.value(16).toString(); addProfile(profileDB.profileName, profileDB); } @@ -100,8 +104,8 @@ void StationProfilesManager::save() return; } - if ( ! insertQuery.prepare("INSERT INTO station_profiles(profile_name, callsign, locator, operator_name, qth_name, iota, sota, sig, sig_info, vucc, wwff, pota, ituz, cqz, dxcc, country) " - "VALUES (:profile_name, :callsign, :locator, :operator_name, :qth_name, :iota, :sota, :sig, :sig_info, :vucc, :wwff, :pota, :ituz, :cqz, :dxcc, :country)") ) + if ( ! insertQuery.prepare("INSERT INTO station_profiles(profile_name, callsign, locator, operator_name, qth_name, iota, sota, sig, sig_info, vucc, wwff, pota, ituz, cqz, dxcc, country, county, operator_callsign) " + "VALUES (:profile_name, :callsign, :locator, :operator_name, :qth_name, :iota, :sota, :sig, :sig_info, :vucc, :wwff, :pota, :ituz, :cqz, :dxcc, :country, :county, :operator_callsign)") ) { qWarning() << "cannot prepare Insert statement"; return; @@ -130,6 +134,8 @@ void StationProfilesManager::save() insertQuery.bindValue(":cqz", stationProfile.cqz); insertQuery.bindValue(":dxcc", stationProfile.dxcc); insertQuery.bindValue(":country", stationProfile.country); + insertQuery.bindValue(":county", stationProfile.county); + insertQuery.bindValue(":operator_callsign", stationProfile.operatorCallsign); if ( ! insertQuery.exec() ) { @@ -162,7 +168,10 @@ bool StationProfile::operator==(const StationProfile &profile) && profile.ituz == this->ituz && profile.cqz == this->cqz && profile.dxcc == this->dxcc - && profile.country == this->country); + && profile.country == this->country + && profile.country == this->county + && profile.operatorCallsign == this->operatorCallsign + ); } bool StationProfile::operator!=(const StationProfile &profile) @@ -174,8 +183,11 @@ QString StationProfile::toHTMLString() const { QString ret = "" + QObject::tr("Logging Station Callsign") + ": " + callsign + "
" + ((!locator.isEmpty()) ? "" + QObject::tr("My Gridsquare") + ": " + locator + "
" : "") + - ((!operatorName.isEmpty()) ? "" + QObject::tr("My Name") + ": " + operatorName + "
" : "") + + ((!operatorName.isEmpty()) ? "" + QObject::tr("Operator Name") + ": " + operatorName + "
" : "") + + ((!operatorCallsign.isEmpty()) ? "" + QObject::tr("Operator Callsign") + ": " + operatorCallsign + "
" : "") + ((!qthName.isEmpty()) ? "" + QObject::tr("My City") + ": " + qthName + "
" : "") + + ((!country.isEmpty()) ? "" + QObject::tr("My Country") + ": " + country + "
" : "") + + ((!county.isEmpty()) ? "" + QObject::tr("My County") + ": " + county + "
" : "") + ((!iota.isEmpty()) ? "" + QObject::tr("My IOTA") + ": " + iota + "
" : "") + ((!sota.isEmpty()) ? "" + QObject::tr("My SOTA") + ": " + sota + "
" : "" ) + ((!sig.isEmpty()) ? "" + QObject::tr("My Special Interest Activity") + ": " + sig + "
" : "" )+ diff --git a/data/StationProfile.h b/data/StationProfile.h index 3d543396..cc933ef6 100644 --- a/data/StationProfile.h +++ b/data/StationProfile.h @@ -20,6 +20,7 @@ class StationProfile QString callsign; QString locator; QString operatorName; + QString operatorCallsign; QString qthName; QString iota; QString pota; @@ -32,6 +33,7 @@ class StationProfile int cqz; int dxcc; QString country; + QString county; bool operator== (const StationProfile &profile); bool operator!= (const StationProfile &profile); diff --git a/logformat/LogFormat.cpp b/logformat/LogFormat.cpp index 54895e72..4bdc9c2b 100644 --- a/logformat/LogFormat.cpp +++ b/logformat/LogFormat.cpp @@ -287,6 +287,7 @@ unsigned long LogFormat::runImport(QTextStream& importLogStream, setIfEmpty(LogbookModel::COLUMN_STATION_CALLSIGN, defaultStationProfile->callsign); setIfEmpty(LogbookModel::COLUMN_MY_GRIDSQUARE, defaultStationProfile->locator); setIfEmpty(LogbookModel::COLUMN_MY_NAME, defaultStationProfile->operatorName); + setIfEmpty(LogbookModel::COLUMN_OPERATOR, defaultStationProfile->operatorCallsign); setIfEmpty(LogbookModel::COLUMN_MY_CITY_INTL, defaultStationProfile->qthName); setIfEmpty(LogbookModel::COLUMN_MY_CITY, Data::removeAccents(defaultStationProfile->qthName)); setIfEmpty(LogbookModel::COLUMN_MY_IOTA, defaultStationProfile->iota); @@ -301,6 +302,7 @@ unsigned long LogFormat::runImport(QTextStream& importLogStream, setIfEmpty(LogbookModel::COLUMN_MY_CQ_ZONE, QString::number(defaultStationProfile->cqz)); setIfEmpty(LogbookModel::COLUMN_MY_COUNTRY_INTL, defaultStationProfile->country); setIfEmpty(LogbookModel::COLUMN_MY_COUNTRY, Data::removeAccents(defaultStationProfile->country)); + setIfEmpty(LogbookModel::COLUMN_MY_CNTY, Data::removeAccents(defaultStationProfile->county)); }; auto setMyEntity = [&](const DxccEntity &myEntity) diff --git a/res/sql/migration_030.sql b/res/sql/migration_030.sql index fa0aa1bc..f599101a 100644 --- a/res/sql/migration_030.sql +++ b/res/sql/migration_030.sql @@ -22,3 +22,6 @@ ALTER TABLE alert_rules ADD COLUMN ituz INTEGER; ALTER TABLE alert_rules ADD COLUMN cqz INTEGER; ALTER TABLE main_layout_profiles ADD tabsexpanded INTEGER DEFAULT 1; + +ALTER TABLE station_profiles ADD county TEXT; +ALTER TABLE station_profiles ADD operator_callsign TEXT; diff --git a/ui/ColumnSettingDialog.cpp b/ui/ColumnSettingDialog.cpp index 474f3008..592a63df 100644 --- a/ui/ColumnSettingDialog.cpp +++ b/ui/ColumnSettingDialog.cpp @@ -184,6 +184,7 @@ void ColumnSettingDialog::setupDialog() case LogbookModel::COLUMN_LON: case LogbookModel::COLUMN_OWNER_CALLSIGN: case LogbookModel::COLUMN_CONTACTED_OP: + case LogbookModel::COLUMN_OPERATOR: case LogbookModel::COLUMN_STATION_CALLSIGN: case LogbookModel::COLUMN_COMMENT: case LogbookModel::COLUMN_COUNTRY: diff --git a/ui/MainWindow.cpp b/ui/MainWindow.cpp index e81e5bb1..8108eb63 100644 --- a/ui/MainWindow.cpp +++ b/ui/MainWindow.cpp @@ -106,7 +106,7 @@ MainWindow::MainWindow(QWidget* parent) : conditionsLabel->setToolTip(QString("").arg(PropConditions::solarSummaryFile())); profileLabel = new QLabel("" + profile.profileName + ":", ui->statusBar); profileLabel->setIndent(10); - callsignLabel = new QLabel(profile.callsign.toLower() , ui->statusBar); + callsignLabel = new QLabel(stationCallsignStatus(profile), ui->statusBar); locatorLabel = new QLabel(profile.locator.toLower(), ui->statusBar); contestLabel = new QLabel(ui->statusBar); contestLabel->setIndent(20); @@ -543,10 +543,17 @@ void MainWindow::stationProfileChanged() qCDebug(runtime) << profile.callsign << " " << profile.locator << " " << profile.operatorName; profileLabel->setText("" + profile.profileName + ":"); - callsignLabel->setText(profile.callsign.toLower()); + callsignLabel->setText(stationCallsignStatus(profile)); locatorLabel->setText(profile.locator.toLower()); } +QString MainWindow::stationCallsignStatus(const StationProfile &profile) { + if (profile.operatorCallsign.isEmpty() || profile.callsign == profile.operatorCallsign) { + return profile.callsign.toLower(); + } + return profile.callsign.toLower() + " [op:" + profile.operatorCallsign.toLower() + "]"; +} + void MainWindow::darkModeToggle(int mode) { FCT_IDENTIFICATION; diff --git a/ui/MainWindow.h b/ui/MainWindow.h index e99c007b..57c2bd62 100644 --- a/ui/MainWindow.h +++ b/ui/MainWindow.h @@ -126,6 +126,8 @@ private slots: void restoreContestMenuSeqnoType(); void restoreContestMenuDupeType(); void restoreContestMenuLinkExchange(); + + QString stationCallsignStatus(const StationProfile &profile); }; #endif // QLOG_UI_MAINWINDOW_H diff --git a/ui/NewContactWidget.cpp b/ui/NewContactWidget.cpp index 18a81e66..96b10bf0 100644 --- a/ui/NewContactWidget.cpp +++ b/ui/NewContactWidget.cpp @@ -1216,6 +1216,21 @@ void NewContactWidget::addAddlFields(QSqlRecord &record, const StationProfile &p record.setValue("my_country_intl", profile.country); } + if ( record.value("my_cnty").toString().isEmpty() + && !profile.county.isEmpty() ) + { + record.setValue("my_cnty", profile.county); + } + + if ( record.value("operator").toString().isEmpty() + && !profile.operatorCallsign.isEmpty() ) + { + record.setValue("operator", profile.operatorCallsign.toUpper()); + } else if ( record.value("operator").toString().isEmpty() + && !profile.callsign.isEmpty() ) { + record.setValue("operator", profile.callsign.toUpper()); + } + if ( record.value("my_itu_zone").toString().isEmpty() && profile.ituz != 0 ) { diff --git a/ui/QSODetailDialog.cpp b/ui/QSODetailDialog.cpp index 48ce31ec..081b4a61 100644 --- a/ui/QSODetailDialog.cpp +++ b/ui/QSODetailDialog.cpp @@ -358,6 +358,8 @@ QSODetailDialog::QSODetailDialog(const QSqlRecord &qso, mapper->addMapping(ui->myVUCCEdit, LogbookModel::COLUMN_MY_VUCC_GRIDS); mapper->addMapping(ui->myWWFFEdit, LogbookModel::COLUMN_MY_WWFF_REF); mapper->addMapping(ui->powerEdit, LogbookModel::COLUMN_TX_POWER); + mapper->addMapping(ui->myCountyEdit, LogbookModel::COLUMN_MY_CNTY); + mapper->addMapping(ui->myOperatorCallsignEdit, LogbookModel::COLUMN_OPERATOR); /* Notes */ mapper->addMapping(ui->noteEdit, LogbookModel::COLUMN_NOTES_INTL); @@ -2160,6 +2162,7 @@ bool QSODetailDialog::LogbookModelPrivate::setData(const QModelIndex &index, con case COLUMN_MY_WWFF_REF: case COLUMN_WWFF_REF: case COLUMN_STATION_CALLSIGN: + case COLUMN_OPERATOR: main_update_result = QSqlTableModel::setData(index, ( !value.toString().isEmpty() ) ? value.toString().toUpper() // clazy:exclude=skipped-base-method : QVariant(), role); break; diff --git a/ui/QSODetailDialog.ui b/ui/QSODetailDialog.ui index 0e63a9ca..e74ca500 100644 --- a/ui/QSODetailDialog.ui +++ b/ui/QSODetailDialog.ui @@ -1292,92 +1292,17 @@ - - - - Gridsquare - - - - - - - - - - QTH - - - - - - - - - - Rig - - - - - - - - - - Antenna - - - - - - - - - - Power - - - - - - - - 0 - 0 - - - - Qt::StrongFocus - - - Blank - - - W - - - 3 - - - 1000000.000000000000000 - - - 0.000000000000000 - - - - + Country - + - + 8 @@ -1443,6 +1368,46 @@ + + + + Gridsquare + + + + + + + + + + QTH + + + + + + + + + + County + + + + + + + + + + Operator Callsign + + + + + + @@ -1526,17 +1491,66 @@ - - - Qt::Horizontal - - - - 40 - 20 - + + + 4 - + + + + Rig + + + + + + + + + + Antenna + + + + + + + + + + Power + + + + + + + + 0 + 0 + + + + Qt::FocusPolicy::StrongFocus + + + Blank + + + W + + + 3 + + + 1000000.000000000000000 + + + 0.000000000000000 + + + + @@ -2224,11 +2238,13 @@ dxccTableWidget myCallsignEdit myOperatorNameEdit + myOperatorCallsignEdit + myCountryCombo + myITUEdit + myCQEdit myGridEdit myQTHEdit - myRigEdit - myAntEdit - powerEdit + myCountyEdit myIOTAEdit myPOTAEdit mySOTAEdit @@ -2236,6 +2252,9 @@ mySIGEdit mySIGInfoEdit myVUCCEdit + myRigEdit + myAntEdit + powerEdit qslPaperReceiveDateEdit qslPaperReceiveStatusBox qslPaperSentDateEdit diff --git a/ui/SettingsDialog.cpp b/ui/SettingsDialog.cpp index 884a9cdd..48684a57 100644 --- a/ui/SettingsDialog.cpp +++ b/ui/SettingsDialog.cpp @@ -1555,6 +1555,7 @@ void SettingsDialog::addStationProfile() profile.callsign = ui->stationCallsignEdit->text().toUpper(); profile.locator = ui->stationLocatorEdit->text().toUpper(); profile.operatorName = ui->stationOperatorEdit->text(); + profile.operatorCallsign = ui->stationOperatorCallsignEdit->text(); profile.qthName = ui->stationQTHEdit->text(); profile.iota = ui->stationIOTAEdit->text().toUpper(); profile.sota = ui->stationSOTAEdit->text().toUpper(); @@ -1565,6 +1566,7 @@ void SettingsDialog::addStationProfile() profile.wwff = ui->stationWWFFEdit->text().toUpper(); profile.cqz = ui->stationCQZEdit->text().toInt(); profile.ituz = ui->stationITUEdit->text().toInt(); + profile.county = ui->stationCountyEdit->text(); int row = ui->stationCountryCombo->currentIndex(); const QModelIndex &idxDXCC = ui->stationCountryCombo->model()->index(row,0); @@ -1610,6 +1612,7 @@ void SettingsDialog::doubleClickStationProfile(QModelIndex i) ui->stationCallsignEdit->blockSignals(false); ui->stationLocatorEdit->setText(profile.locator); ui->stationOperatorEdit->setText(profile.operatorName); + ui->stationOperatorCallsignEdit->setText(profile.operatorCallsign); ui->stationQTHEdit->setText(profile.qthName); ui->stationIOTAEdit->setText(profile.iota); ui->stationSOTAEdit->blockSignals(true); @@ -1626,6 +1629,7 @@ void SettingsDialog::doubleClickStationProfile(QModelIndex i) ui->stationWWFFEdit->blockSignals(false); ui->stationCQZEdit->setText(QString::number(profile.cqz)); ui->stationITUEdit->setText(QString::number(profile.ituz)); + ui->stationCountyEdit->setText(profile.county); const QModelIndexList &countryIndex = ui->stationCountryCombo->model()->match(ui->stationCountryCombo->model()->index(0,0), Qt::DisplayRole, profile.dxcc, 1, Qt::MatchExactly); @@ -1646,6 +1650,7 @@ void SettingsDialog::clearStationProfileForm() ui->stationLocatorEdit->clear(); ui->stationLocatorEdit->setPlaceholderText(QString()); ui->stationOperatorEdit->clear(); + ui->stationOperatorCallsignEdit->clear(); ui->stationQTHEdit->clear(); ui->stationSOTAEdit->clear(); ui->stationPOTAEdit->clear(); @@ -1657,6 +1662,7 @@ void SettingsDialog::clearStationProfileForm() ui->stationCQZEdit->clear(); ui->stationITUEdit->clear(); ui->stationCountryCombo->setCurrentIndex(0); + ui->stationCountyEdit->clear(); ui->stationAddProfileButton->setText(tr("Add")); } diff --git a/ui/SettingsDialog.ui b/ui/SettingsDialog.ui index 58c7a4d2..c866379f 100644 --- a/ui/SettingsDialog.ui +++ b/ui/SettingsDialog.ui @@ -76,114 +76,17 @@ 3 - - - - Gridsquare - - - - - - - SOTA (Optional parameter) - - - - - - - - - - - + SOTA - - - - - - - - Add - - - - - - - Delete - - - - - - - - - Operator Name - - - - - - - + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - - - WWFF - - - - - - - SIG (Optional parameter). - - - - - - - - - - SIG Information (Optional parameter) - - - - - - - - - - QTH - - - - - - - Callsign (Mandatory parameter) - - - - - - 25 - - - - + Qt::NoFocus @@ -195,11 +98,21 @@ List of all available Station Profiles - QAbstractItemView::NoEditTriggers + QAbstractItemView::EditTrigger::NoEditTriggers + + + + + + + SIG Info + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - + 6 @@ -268,38 +181,120 @@ - - - - World Wide Flora & Fauna (Optional parameter) + + + + IOTA + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - + - + Operator Callsign + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + - VUCC + Operator Name + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - + + + + + + + POTA + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + QTH + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + SIG + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + Country + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + - - + + + + Station Callsign + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + - + + + + + + + + + + + + + + Profile Name + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + VUCC + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + VUCC Grids (Optional parameter). Ex. EN98,FM08,EM97,FM07 @@ -309,14 +304,14 @@ - - + + - IOTA (Optional parameter) + QTH Name (Optional parameter) - + Station Gridsquare (Mandatory parameter) @@ -329,52 +324,113 @@ - - + + - QTH Name (Optional parameter) + SIG Information (Optional parameter) + + + - - - - IOTA + + + + World Wide Flora & Fauna (Optional parameter) - - + + + + + + Add + + + + + + + Delete + + + + + + + - Callsign + WWFF + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + - SIG + - - + + + + Callsign (Mandatory parameter) + - POTA + + + + 25 - - - - Profile Name + + + + SIG (Optional parameter). - - + + + + IOTA (Optional parameter) + + + + + + + Operator name (Optional parameter) + + + + + + + Callsign of operator (Optional parameter, if different from station callsign) + + + + + - SIG Info + Gridsquare + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + SOTA (Optional parameter) @@ -385,10 +441,27 @@ - - + + + + + + + + + + + County + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + - Operator name (Optional parameter) + Station County Location (Optional parameter) @@ -4094,7 +4167,9 @@ stationProfileNameEdit stationCallsignEdit stationOperatorEdit + stationOperatorCallsignEdit stationCountryCombo + stationCountyEdit stationITUEdit stationCQZEdit stationLocatorEdit