| 108 | } |
| 109 | |
| 110 | void MultiFlexDialog::refresh() |
| 111 | { |
| 112 | if (m_refreshing) return; |
| 113 | m_refreshing = true; |
| 114 | |
| 115 | // Enable button style |
| 116 | bool enabled = m_model->multiFlexEnabled(); |
| 117 | m_enableBtn->setText(enabled ? "Enabled" : "Disabled"); |
| 118 | m_enableBtn->setStyleSheet(enabled |
| 119 | ? "QPushButton { background: #1a6030; color: #40ff80; border: 1px solid #20a040; " |
| 120 | "border-radius: 3px; padding: 6px 20px; font-weight: bold; font-size: 13px; }" |
| 121 | "QPushButton:hover { background: #207040; }" |
| 122 | : "QPushButton { background: #601a1a; color: #ff6060; border: 1px solid #a02020; " |
| 123 | "border-radius: 3px; padding: 6px 20px; font-weight: bold; font-size: 13px; }" |
| 124 | "QPushButton:hover { background: #702020; }"); |
| 125 | |
| 126 | const auto& infoMap = m_model->clientInfoMap(); |
| 127 | const quint32 ourHandle = m_model->ourClientHandle(); |
| 128 | |
| 129 | // Drop pending-disconnect entries whose handle has actually left the |
| 130 | // client list — the radio has confirmed the eviction, so a fresh |
| 131 | // future appearance (impossible today but defensive) gets a normal |
| 132 | // button again. |
| 133 | for (auto it = m_pendingDisconnects.begin(); it != m_pendingDisconnects.end(); ) { |
| 134 | if (!infoMap.contains(*it)) |
| 135 | it = m_pendingDisconnects.erase(it); |
| 136 | else |
| 137 | ++it; |
| 138 | } |
| 139 | |
| 140 | // Build local TX info override from our own slices (ClientInfo may not |
| 141 | // have TX data if slice status arrived before client connected status) |
| 142 | QString ourTxAnt; |
| 143 | double ourTxFreq = 0; |
| 144 | for (auto* s : m_model->slices()) { |
| 145 | if (s->isTxSlice()) { |
| 146 | ourTxAnt = s->txAntenna(); |
| 147 | ourTxFreq = s->frequency(); |
| 148 | break; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | // Remember selected handle across repopulation |
| 153 | quint32 selectedHandle = 0; |
| 154 | { |
| 155 | const auto sel = m_table->selectedItems(); |
| 156 | if (!sel.isEmpty()) |
| 157 | selectedHandle = sel.first()->data(Qt::UserRole).toUInt(); |
| 158 | } |
| 159 | |
| 160 | // Populate table |
| 161 | m_table->clearContents(); |
| 162 | m_table->setRowCount(infoMap.size()); |
| 163 | |
| 164 | bool weHavePtt = false; |
| 165 | QString ourStation; |
| 166 | int restoreRow = -1; |
| 167 | int row = 0; |
nothing calls this directly
no test coverage detected