From 91357ebf90aab9e8f8724f9cafe1dc52e035e5e6 Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 16 Oct 2026 16:49:09 +0200 Subject: [PATCH] Show microphone timeout errors in call and radio controls --- tools/chatgui/src/callwindow.cpp | 9 ++++++++- tools/chatgui/src/radiopanel.cpp | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/chatgui/src/callwindow.cpp b/tools/chatgui/src/callwindow.cpp index d5c1533b..a5791391 100644 --- a/tools/chatgui/src/callwindow.cpp +++ b/tools/chatgui/src/callwindow.cpp @@ -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(); diff --git a/tools/chatgui/src/radiopanel.cpp b/tools/chatgui/src/radiopanel.cpp index 85c46702..143c867b 100644 --- a/tools/chatgui/src/radiopanel.cpp +++ b/tools/chatgui/src/radiopanel.cpp @@ -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");