| 199 | } |
| 200 | |
| 201 | void LeftPanel::setStreamingSources(const QStringList& names) { |
| 202 | const QString previous = ui_->comboStreaming->currentText(); |
| 203 | { |
| 204 | QSignalBlocker block(ui_->comboStreaming); |
| 205 | ui_->comboStreaming->clear(); |
| 206 | ui_->comboStreaming->addItems(names); |
| 207 | const int idx = ui_->comboStreaming->findText(previous); |
| 208 | if (idx >= 0) { |
| 209 | ui_->comboStreaming->setCurrentIndex(idx); |
| 210 | } |
| 211 | } |
| 212 | // QComboBox auto-selects index 0 on the first addItems(), but the blocker |
| 213 | // above swallows the corresponding currentTextChanged; emit once so the |
| 214 | // visible selection matches what listeners (StreamingSourceManager) hold. |
| 215 | const QString current = ui_->comboStreaming->currentText(); |
| 216 | if (current != previous) { |
| 217 | emit streamingSourceChanged(current); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | void LeftPanel::applyPauseButtonState(QString theme) { |
| 222 | const bool paused = ui_->buttonStreamingPause->isChecked(); |
no test coverage detected