Load radio settings after core startup and apply from dialog

This commit is contained in:
evgeny committed 2026-10-03 13:12:17 +03:00
1 parent 9f41415dc7
commit afbce0efeb
3 files changed
+9 -1

No files matched your search

+1
View File
@@ -392,6 +392,7 @@ void MainWindow::setupBridgeCallbacks() {
gui_bridge_set_db_ready_cb([]() {
if (!s_mainWindow || !s_mainWindow->m_db) return;
s_mainWindow->m_db->setDb(chat_core_get_db(gui_bridge_get_inst()));
RadioAudioEngine::instance()->loadSettings(s_mainWindow->m_cfgPath);
s_mainWindow->m_channelList->loadChannels();
s_mainWindow->restoreWindowGeometry();
PttHotkeyManager::instance()->init(s_mainWindow->m_db); /* глобальные PTT-хоткеи */
+1
View File
@@ -15,6 +15,7 @@
#include <QPainter>
#include <QPixmap>
#include <QStyle>
#include <QSignalBlocker>
#include <QDateTime>
#include <QJsonDocument>
#include <QJsonObject>
+7 -1
View File
@@ -26,6 +26,7 @@ extern "C" {
#include <QComboBox>
#include <QFile>
#include <QTextStream>
#include <QMessageBox>
SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, UtunNode* node,
AudioRecorder* recorder, QWidget* parent)
@@ -221,6 +222,7 @@ void SettingsDialog::onCategoryChanged(int row) {
if (row == 6) m_nodesPage->refreshNodes();
if (row == 7) m_soundPage->loadFromDb();
if (row == 8) m_audioDevicePage->loadFromDb();
if (row == 9) m_radioPage->loadFromDb();
}
void SettingsDialog::onSave() {
@@ -295,7 +297,11 @@ void SettingsDialog::onSave() {
m_soundPage->applyAndSave();
m_audioDevicePage->applyAndSave();
m_storagePage->applyAndSave();
m_radioPage->apply();
if (!m_radioPage->apply()) {
QMessageBox::warning(this, QStringLiteral("Настройки рации"), QStringLiteral("Не удалось применить настройки рации. "
"Проверьте доступность ядра и файла конфигурации; подробности в логе radio."));
return;
}
/* Физические сочетания сохраняем в БД; Wayland-хоткеями владеет системный портал. */
if (!PttHotkeyManager::usesPortal()) {