Repository navigation
feat(kpod): show K-Pod macros in Options and import them from a K4 backup - #10
Closed
tcpreplay-dev wants to merge 1 commit into
Closed
tcpreplay-dev wants to merge 1 commit into
tcpreplay-dev wants to merge 1 commit into
Conversation
tcpreplay-dev
force-pushed
the
feat/kpod-macro-view-and-k4-backup-import
branch
from
September 2, 2026 02:07
18731eb to
99ab468
Compare
Owner
Author
…ckup The K-Pod page listed device descriptors and an enable checkbox, but said nothing about what the eight buttons actually do. The bindings existed — HardwareController emits "K-pod.<n>T" / "K-pod.<n>H" on every tap and hold, and MacroController dispatches whatever RadioSettings holds for those IDs — but the only place to see them was MacroDialog's flat list of every macro slot in the application, K-Pod entries interleaved with PF, Fn and keyboard ones. The page now shows all sixteen slots as a table: tap column left, hold column right, Button / Name / CAT Command. They are read-only. MacroDialog remains the single editor, so there is no second writer on the same QSettings array and no chance of two open views clobbering each other; the page reloads on macrosChanged, so an edit made in Fn > MACROS appears here immediately. The rest of the page was rearranged to fit the dialog's default width — status and enable share a row, and Device Summary is two property/value pairs per row instead of seven full-width rows. Macros can also come from the radio, though not over CAT. No K4 command reads or writes macro text: MS is Mic Setup (MSabcde;), and neither the Programmer's Reference D5 shipped in resources/k4_cat_commands.json nor Elecraft's published rev D4 documents any macro accessor. What the K4 does offer is its backup utility — Fn > hold BACKUP writes K4_SN<serial>/k4macros.json, one of six selectable categories being "PF Key and K-Pod Macros". "Import from K4 Backup..." on the K-Pod page reads that file. It is deliberately a file picker and nothing more: no volume scanning, no startup probing, no inference about where a USB stick might be mounted. The user says where the file is. Before writing anything the import compares every slot against what QK4 already holds and asks for confirmation, naming each macro that would be overwritten, defaulting to No. Slots absent from the file are untouched. The file's slot names are close enough to QK4's MacroIds to be dangerous — "Kpod.1T" against "K-pod.1T", "REM.ANT" against "REM_ANT", while Fn.F1-F8 and PF1-PF4 match exactly. The translation is therefore an explicit table rather than prefix surgery, unknown slots are skipped with a log line, and the tests assert that no raw backup name survives into the store. A mistranslation would write macros into slots nothing dispatches and look entirely successful. RadioSettings gains setMacros() for the bulk path, which writes the file and emits macrosChanged once for the whole import rather than once per macro. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tcpreplay-dev
force-pushed
the
feat/kpod-macro-view-and-k4-backup-import
branch
from
September 2, 2026 03:40
99ab468 to
94d981f
Compare
Owner
Author
|
Closing for now — will rework this branch. Branch retained. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
The K-Pod Options page now shows all sixteen K-Pod button macros, and macros can be imported from a K4 backup file.
K-Pod page
Sixteen slots as a table — tap column left, hold column right,
Button/Name/CAT Command. Read-only:MacroDialog(Fn > MACROS) stays the only editor, so there is no second writer on the sameQSettingsarray and two open views cannot clobber each other. The page reloads onmacrosChanged, so an edit made in Fn > MACROS shows up here immediately.The bindings themselves already worked —
HardwareControlleremitsK-pod.<n>T/K-pod.<n>Hon tap and hold,MacroControllerdispatches whateverRadioSettingsholds — but the only place to see them wasMacroDialog's flat list of every macro slot in the application.Rest of the page was rearranged to fit the dialog's default width: status and enable share a row, Device Summary is two property/value pairs per row instead of seven full-width rows, and the page scrolls.
Import from K4 Backup
No K4 CAT command reads or writes macro text.
MSis Mic Setup (MSabcde;); neither the Programmer's Reference D5 inresources/k4_cat_commands.jsonnor Elecraft's published rev D4 documents any macro accessor.The K4's backup utility does export them — Fn > hold BACKUP writes
K4_SN<serial>/k4macros.json, one of its six selectable categories being "PF Key and K-Pod Macros". The new button reads that file.It is a file picker and nothing more: no volume scanning, no startup probing, no guessing where a stick is mounted. Before writing, the import compares every slot against what QK4 holds and asks for confirmation, naming each macro that would be overwritten, defaulting to No. Slots absent from the file are untouched. It covers every slot the backup carries — 16 K-Pod, PF1-4, Fn.F1-8, REM ANT.
Why the slot map is explicit
The file's names are close enough to
MacroIdsto be dangerous:Kpod.1TagainstK-pod.1T,REM.ANTagainstREM_ANT, whileFn.F1-F8andPF1-PF4match exactly. A mistranslation would write macros into slots nothing dispatches and look entirely successful. Hence a lookup table rather than prefix surgery, unknown slots skipped with a log line, and tests asserting no raw backup name survives into the store.Also
RadioSettings::setMacros()for the bulk path — one file write and onemacrosChangedfor the whole import instead of one of each per macro.Testing
tests/test_k4macrobackup.cpp, 12 cases covering slot translation, empty-command slots, unknown slots, verbatim commands, malformed JSON🤖 Generated with Claude Code