diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /models | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'models')
| -rw-r--r-- | models/DecodeHighlightingModel.cpp | 17 | ||||
| -rw-r--r-- | models/FrequencyList.cpp | 36 | ||||
| -rw-r--r-- | models/Modes.cpp | 3 | ||||
| -rw-r--r-- | models/Modes.hpp | 1 | ||||
| -rw-r--r-- | models/StationList.cpp | 5 | ||||
| -rw-r--r-- | models/models.pri | 20 |
6 files changed, 45 insertions, 37 deletions
diff --git a/models/DecodeHighlightingModel.cpp b/models/DecodeHighlightingModel.cpp index 7c884b18..ab504268 100644 --- a/models/DecodeHighlightingModel.cpp +++ b/models/DecodeHighlightingModel.cpp @@ -166,10 +166,21 @@ auto DecodeHighlightingModel::items () const -> HighlightItems const& void DecodeHighlightingModel::items (HighlightItems const& items) { + if (items.size () != m_->data_.size ()) + { + beginResetModel (); + m_->data_ = items; + endResetModel (); + return; + } + m_->data_ = items; - QVector<int> roles; - roles << Qt::CheckStateRole << Qt::ForegroundRole << Qt::BackgroundRole; - Q_EMIT dataChanged (index (0, 0), index (rowCount () - 1, 0), roles); + if (!m_->data_.isEmpty ()) + { + QVector<int> roles; + roles << Qt::DisplayRole << Qt::CheckStateRole << Qt::ForegroundRole << Qt::BackgroundRole << TypeRole; + Q_EMIT dataChanged (index (0, 0), index (rowCount () - 1, 0), roles); + } } void DecodeHighlightingModel::set_font (QFont const& font) diff --git a/models/FrequencyList.cpp b/models/FrequencyList.cpp index a0d22942..cc6ed129 100644 --- a/models/FrequencyList.cpp +++ b/models/FrequencyList.cpp @@ -71,6 +71,7 @@ namespace {1839000, Modes::JT9, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {1839000, Modes::FST4, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {1840000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, + {1838000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY frequency // Band plans (all USB dial unless stated otherwise) // @@ -107,6 +108,7 @@ namespace {3568600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // needs guard marker and lock out {3575000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional {3568000, Modes::FT4, IARURegions::R3, "","", QDateTime(), QDateTime(), false}, // provisional + {3575000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // stays under R3's narrow DM segment (documented above as ending at 3575-3580) even with the 1500 Hz audio offset added {5357000, Modes::JT65, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // provisional {5357000, Modes::JT9, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // provisional @@ -153,6 +155,7 @@ namespace {7047500, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional - moved // up 500Hz to clear // W1AW code practice QRG + {7090000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY freq + 10 kHz // Band plans (all USB dial unless stated otherwise) // @@ -187,6 +190,7 @@ namespace {10138700, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {10140000, Modes::JT9, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {10140000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional + {10140000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY frequency; band's upper edge (10150) leaves no room for the usual +10 kHz nudge // Band plans (all USB dial unless stated otherwise) // @@ -215,7 +219,7 @@ namespace // 14105.5 OLIVIA 1000 // 14106.5 OLIVIA 1000 (main QRG) // - // R3: 14070 - 14112 DM NB(<2000Hz) with ±500Hz IBP guard band at 14100 + // R3: 14070 - 14112 DM NB(<2000Hz) with +/-500 Hz IBP guard band at 14100 // // 14070 PSK31 // 14074.4 OLIVIA, Contestia, etc. @@ -232,6 +236,7 @@ namespace {14076000, Modes::JT65, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {14078000, Modes::JT9, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {14080000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional + {14090000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY freq + 10 kHz // Band plans (all USB dial unless stated otherwise) @@ -254,7 +259,7 @@ namespace // 18105 - 18110 Packet // 18110 NCDXF beacons // - // R3: 18095 - 18120 DM NB(<2000Hz) with ±500Hz IBP guard band at 18110 + // R3: 18095 - 18120 DM NB(<2000Hz) with +/-500 Hz IBP guard band at 18110 // // 18100 PSK31 // 18103.4 OLIVIA, Contestia, etc. (main QRG) @@ -268,6 +273,7 @@ namespace {18104000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional {18104600, Modes::WSPR, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {18104600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, + {18100000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY frequency; +10 kHz would put the 1500 Hz-offset signal past the US data segment's 18110 kHz edge (and onto the NCDXF beacon frequency) {21074000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, {21091000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // DXpedition @@ -276,6 +282,7 @@ namespace {21094600, Modes::WSPR, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {21094600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {21140000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, + {21090000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY freq + 10 kHz {24911000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // DXpedition {24915000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, @@ -284,6 +291,7 @@ namespace {24919000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional {24924600, Modes::WSPR, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {24924600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, + {24920000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY frequency; the US narrow data segment (24920-24925) leaves no room for the usual +10 kHz nudge once the 1500 Hz audio offset is added {28074000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, {28091000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // DXpedition @@ -292,6 +300,7 @@ namespace {28124600, Modes::WSPR, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {28124600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {28180000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, + {28090000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY freq + 10 kHz {50200000, Modes::Echo, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {50211000, Modes::Q65, IARURegions::ALL, "EME","", QDateTime(), QDateTime(), false}, @@ -1040,15 +1049,21 @@ void FrequencyList_v2_101::impl::unprefer_all_but(Item &item, int const item_row bool FrequencyList_v2_101::impl::setData (QModelIndex const& model_index, QVariant const& value, int role) { bool changed {false}; - auto const& row = model_index.row (); + auto const row = model_index.row (); + + if (!model_index.isValid () + || row < 0 + || row >= frequency_list_.size ()) + { + return false; + } + auto& item = frequency_list_[row]; QVector<int> roles; roles << role; - if (model_index.isValid () - && Qt::CheckStateRole == role - && row < frequency_list_.size () + if (Qt::CheckStateRole == role && model_index.column () == preferred_column) { bool b_val = ((Qt::CheckState)value.toInt() == Qt::Checked); @@ -1064,9 +1079,7 @@ bool FrequencyList_v2_101::impl::setData (QModelIndex const& model_index, QVaria } } - if (model_index.isValid () - && Qt::EditRole == role - && row < frequency_list_.size ()) + if (Qt::EditRole == role) { switch (model_index.column()) { @@ -1096,9 +1109,10 @@ bool FrequencyList_v2_101::impl::setData (QModelIndex const& model_index, QVaria case frequency_column: { - if (value.canConvert<Frequency>()) + bool ok; + Radio::Frequency frequency{value.toULongLong (&ok)}; + if (ok && frequency) { - Radio::Frequency frequency{qvariant_cast<Radio::Frequency>(value)}; if (frequency != item.frequency_) { item.frequency_ = frequency; diff --git a/models/Modes.cpp b/models/Modes.cpp index 966665bb..da6e6dbd 100644 --- a/models/Modes.cpp +++ b/models/Modes.cpp @@ -25,7 +25,8 @@ namespace "FT4", "FST4", "FST4W", - "Q65" + "Q65", + "JTTY" }; std::size_t constexpr mode_names_size = sizeof (mode_names) / sizeof (mode_names[0]); } diff --git a/models/Modes.hpp b/models/Modes.hpp index 675f097e..31ea163b 100644 --- a/models/Modes.hpp +++ b/models/Modes.hpp @@ -51,6 +51,7 @@ public: FST4, FST4W, Q65, + JTTY, MODES_END_SENTINAL_AND_COUNT // this must be last }; Q_ENUM (Mode) diff --git a/models/StationList.cpp b/models/StationList.cpp index 2b501259..308acf4e 100644 --- a/models/StationList.cpp +++ b/models/StationList.cpp @@ -412,9 +412,10 @@ bool StationList::impl::setData (QModelIndex const& model_index, QVariant const& case offset_column: { - if (value.canConvert<FrequencyDelta> ()) + bool ok; + FrequencyDelta offset {value.toLongLong (&ok)}; + if (ok) { - FrequencyDelta offset {qvariant_cast<Radio::FrequencyDelta> (value)}; if (offset != stations_[row].offset_) { stations_[row].offset_ = offset; diff --git a/models/models.pri b/models/models.pri deleted file mode 100644 index 5b3d038b..00000000 --- a/models/models.pri +++ /dev/null @@ -1,20 +0,0 @@ -SOURCES += \ - models/Bands.cpp \ - models/FrequencyList.cpp \ - models/StationList.cpp \ - models/Modes.cpp \ - models/IARURegions.cpp \ - models/FoxLog.cpp \ - models/CabrilloLog.cpp \ - models/DecodeHighlightingModel.cpp - -HEADERS += \ - models/Bands.hpp \ - models/FrequencyList.hpp \ - models/StationList.hpp \ - models/Modes.hpp \ - models/IARURegions.hpp \ - models/FoxLog.hpp \ - models/CabrilloLog.hpp \ - models/FontOverrideModel.hpp \ - models/DecodeHighlightingModel.hpp |
