Skip to content

Fix satellite QSO data handling and UI initialization order - #1118

Merged
ea4k merged 4 commits into
masterfrom
claude/github-issue-1117-mtl6dy
Aug 19, 2026
Merged

Fix satellite QSO data handling and UI initialization order#1118
ea4k merged 4 commits into
masterfrom
claude/github-issue-1117-mtl6dy

Conversation

@ea4k

@ea4k ea4k commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

This PR fixes several issues related to satellite QSO handling and UI initialization:

  1. UI Initialization Order: Move createUI() and populateSatComboBox() calls to after palette and flag initialization to prevent crashes when the combo box change handler fires synchronously.

  2. Satellite Name Field Management: Improve the "Other" satellite name field behavior to always reflect the current selection state, allowing users to edit the satellite name even while modifying existing QSOs.

  3. Database Consistency: Ensure satellite mode and name are always bound to prepared queries, preventing stale data from persisting when a QSO changes from SAT to non-SAT propagation mode.

  4. Data Validation: Add validation to prevent SAT propagation mode from being set without a satellite name, and clear the propagation mode when a satellite name is removed.

Key Changes

  • mainwindowsattab.cpp:

    • Moved createUI() and populateSatComboBox() calls after palette initialization with explanatory comment
    • Refactored slotSatNameComboBoxChanged() to handle "Other" satellite field state upfront, before early returns
    • Added visual feedback (red "Unknown" text) when "Other" satellite is selected
    • Updated slotSatNameTextChanged() to clear the red highlight when user types
    • Changed getSatName() to return "Unknown" instead of empty string when "Other" is selected but no name entered
  • dataproxy_sqlite.cpp:

    • Modified bindQSOValues() to always bind sat_mode and sat_name parameters, even when not SAT propagation mode, preventing stale database values from previous QSOs
  • qso.cpp:

    • Added validation in setPropMode() to reject SAT mode when satellite name is empty
    • Added logic in setSatName() to clear propagation mode when satellite name is cleared

Notable Implementation Details

  • The satellite name field now provides immediate visual feedback (red "Unknown" placeholder) to guide users when selecting "Other"
  • Prepared SQL queries are properly managed to prevent data leakage between QSOs
  • Validation ensures data consistency between propagation mode and satellite name fields

https://claude.ai/code/session_0168ZBpozDiJyhPUtW5YvQzb

claude and others added 4 commits August 19, 2026 14:06
QSO::setSatName() cleared satName but never touched propMode, so
editing a SAT QSO and removing its satellite left propMode == "SAT"
with an empty satName. QSO::setPropMode() now also rejects "SAT" when
no satellite name is set, so the invariant holds regardless of call
order (UI, ADIF import, etc).

In the Satellite tab, selecting "Other" now enables the satellite name
field even while editing an existing QSO (previously blocked by the
"modifying" guard), and leaving it blank saves the satellite name as
the translatable "Unknown" instead of clearing propMode.

Closes #1117
Selecting "Other" in the Satellite tab now immediately fills the name
field with a translatable "Unknown" shown in red, so the user notices
it needs editing, instead of only substituting it silently at save
time. Picking a real satellite or "No-SAT" clears and disables the
field again. The red highlight clears as soon as the user types over
it.

Moved the widget's flag/palette initialization before createUI()/
populateSatComboBox() in the constructor, since populating the combo
box can synchronously trigger the same slot that now depends on them.
DataProxy_SQLite::bindQSOValues() only bound :sat_mode/:sat_name when
the QSO's propagation mode was SAT. m_insertQuery and m_updateQuery
are prepared once and reused for every save, so a placeholder left
unbound keeps whatever value was bound the last time that query
object executed. Editing a SAT QSO down to "No-SAT" (or "Other" then
back) produced a QSO object with an empty satName/satMode, but the
save silently skipped rebinding those placeholders, so the previous
value (from this QSO, or potentially a different one saved earlier in
the session) stayed in the row. Bind both fields unconditionally.
@ea4k
ea4k merged commit ff0bab7 into master Aug 19, 2026
3 of 8 checks passed
@ea4k
ea4k deleted the claude/github-issue-1117-mtl6dy branch August 19, 2026 14:57
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants