Show microphone timeout errors in call and radio controls

This commit is contained in:
evgeny committed 2026-10-16 16:49:09 +02:00
1 parent 43e7829ec0
commit c73fba2ad3
2 files changed
+11 -2

No files matched your search

+8 -1
View File
@@ -205,6 +205,12 @@ CallWindow::CallWindow(QWidget* parent)
m_statusLabel = new QLabel(this);
m_statusLabel->setAlignment(Qt::AlignCenter);
m_statusLabel->setStyleSheet("color: gray; font-size: 13px;");
m_statusLabel->setWordWrap(true);
connect(CallAudioEngine::instance(), &CallAudioEngine::captureErrorChanged, this, [this] {
auto* audio = CallAudioEngine::instance();
if (m_state == Active && audio->callId() == m_callId)
m_statusLabel->setText(audio->captureError().isEmpty() ? callText("In call") : audio->captureError());
});
m_durationLabel = new QLabel(QStringLiteral("00:00"), this);
m_durationLabel->setAlignment(Qt::AlignCenter);
@@ -393,7 +399,8 @@ void CallWindow::setState(State s) {
m_durationLabel->hide();
break;
case Active:
m_statusLabel->setText(QCoreApplication::translate("ChatGui", "In call"));
m_statusLabel->setText(CallAudioEngine::instance()->captureError().isEmpty()
? callText("In call") : CallAudioEngine::instance()->captureError());
m_durationLabel->setText(QStringLiteral("00:00"));
m_durationLabel->show();
m_startMs = QDateTime::currentMSecsSinceEpoch();
+3 -1
View File
@@ -67,6 +67,7 @@ RadioPanel::RadioPanel(QWidget* parent) : QWidget(parent) {
m_status = new QLabel(this);
m_status->setObjectName(QStringLiteral("radioStatus"));
m_status->setMinimumWidth(0);
m_status->setWordWrap(true);
m_status->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
row->addWidget(m_status, 1);
m_auto = new RadioAutoButton(this);
@@ -220,7 +221,8 @@ void RadioPanel::updateState() {
m_ptt->update();
}
QString state;
if (!engine->settingsError().isEmpty()) state = QCoreApplication::translate("ChatGui", "Settings error");
if (!engine->captureError().isEmpty()) state = engine->captureError();
else if (!engine->settingsError().isEmpty()) state = QCoreApplication::translate("ChatGui", "Settings error");
else if (engine->settingsBusy()) state = QCoreApplication::translate("ChatGui", "Applying settings…");
else if (!engine->captureAvailable()) state = QCoreApplication::translate("ChatGui", "Microphone unavailable");
else if (engine->autoEnabled() && !engine->autoAvailable()) state = QCoreApplication::translate("ChatGui", "Automatic transmission unavailable");