feat: status bar added
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@@ -147,6 +149,30 @@ func (m *Manager) Lookup(callsign string) (Match, bool) {
|
||||
return db.Lookup(callsign)
|
||||
}
|
||||
|
||||
// EntityNames returns the sorted, de-duplicated DXCC entity names from the
|
||||
// loaded cty.dat — the canonical list for a "Country" picker. Empty until
|
||||
// cty.dat has loaded.
|
||||
func (m *Manager) EntityNames() []string {
|
||||
m.mu.RLock()
|
||||
db := m.db
|
||||
m.mu.RUnlock()
|
||||
if db == nil {
|
||||
return nil
|
||||
}
|
||||
seen := map[string]bool{}
|
||||
var out []string
|
||||
for _, e := range db.Entities() {
|
||||
n := strings.TrimSpace(e.Name)
|
||||
if n == "" || seen[n] {
|
||||
continue
|
||||
}
|
||||
seen[n] = true
|
||||
out = append(out, n)
|
||||
}
|
||||
sort.Strings(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// Info returns metadata about the currently-loaded cty.dat (or zero value
|
||||
// if nothing loaded).
|
||||
func (m *Manager) Info() ctySource {
|
||||
|
||||
Reference in New Issue
Block a user