fix(cat): the chip says what YOU called the radio
It showed what the radio calls itself over CAT — 'Kenwood (911)' for a K3, a bare 'CAT' for a Flex that reports nothing useful. That is the answer to a question nobody asks once the rig has a name in the list, and it made the two radios look alike in the one place they have to be told apart. The name the operator typed comes first now, on the chip and in the menu, and falls back to the radio's own identity when they typed none. The model identity is still in the tooltip, where it answers 'what is actually connected' without taking the place of 'which of my rigs is this'.
This commit is contained in:
+8
-1
@@ -118,9 +118,16 @@ func (a *App) ActiveRadioID() string {
|
||||
}
|
||||
|
||||
// RadioListEntry is what the status-bar menu needs: enough to draw a row.
|
||||
//
|
||||
// Name is what the OPERATOR typed, empty when they typed nothing; Label is what
|
||||
// to draw when there is no better idea. The two are separate because the caller
|
||||
// has a better idea than we do: the status bar knows what the radio calls
|
||||
// itself over CAT, and "FTDX10" beats "Radio 2" — but only where the operator
|
||||
// has not given it a name of their own, which beats both.
|
||||
type RadioListEntry struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Label string `json:"label"`
|
||||
Backend string `json:"backend"`
|
||||
Active bool `json:"active"`
|
||||
}
|
||||
@@ -135,7 +142,7 @@ func (a *App) ListRadios() []RadioListEntry {
|
||||
out := make([]RadioListEntry, 0, len(list))
|
||||
for i, r := range list {
|
||||
out = append(out, RadioListEntry{
|
||||
ID: r.ID, Name: radioLabel(r, i),
|
||||
ID: r.ID, Name: strings.TrimSpace(r.Name), Label: radioLabel(r, i),
|
||||
Backend: r.Settings.Backend, Active: r.ID == active,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user