chatgui: per-event sound settings with DB persistence
- Sound files loaded from filesystem (sound_dir in INI config, absolute or relative) - Per-event enable/disable + volume stored in DB (ui_state table) - SoundManager: setEvent(), effective volume = master * per-event - SoundSettingsPage UI: 4 event rows (checkbox + slider) - chat_core_save_ui_state() for async DB writes via uasync thread - DbManager::getUiStateInt() for reading settings from GUI thread - Default sounds copied to sounds/ dir next to DB, config entries written
This commit is contained in:
1 parent
1593079da8
commit
98bfb9dcd2
12 files changed
+267
-114
No files matched your search
@@ -86,7 +86,7 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, QWidget
|
||||
m_nodesPage = new NodesPage(db, m_pages);
|
||||
m_pages->addWidget(m_nodesPage);
|
||||
|
||||
m_soundPage = new SoundSettingsPage(m_pages);
|
||||
m_soundPage = new SoundSettingsPage(db, m_pages);
|
||||
m_pages->addWidget(m_soundPage);
|
||||
rightLayout->addWidget(m_pages, 1);
|
||||
|
||||
@@ -124,7 +124,7 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, QWidget
|
||||
// Load current values
|
||||
loadProfileFromConfig(m_configPath);
|
||||
m_networkPage->loadFromConfig(m_configPath);
|
||||
m_soundPage->loadFromConfig(m_configPath);
|
||||
m_soundPage->loadFromDb();
|
||||
m_categoryList->setCurrentRow(0);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void SettingsDialog::onCategoryChanged(int row) {
|
||||
if (row == 2) m_databasePage->refreshStatus();
|
||||
if (row == 3) m_statusPage->refreshStatus();
|
||||
if (row == 4) m_nodesPage->refreshNodes();
|
||||
if (row == 5) m_soundPage->loadFromConfig(m_configPath);
|
||||
if (row == 5) m_soundPage->loadFromDb();
|
||||
}
|
||||
|
||||
void SettingsDialog::onSave() {
|
||||
@@ -188,6 +188,6 @@ void SettingsDialog::onSave() {
|
||||
f.close();
|
||||
|
||||
m_networkPage->saveToConfig(m_configPath);
|
||||
m_soundPage->saveToConfig(m_configPath);
|
||||
m_soundPage->applyAndSave();
|
||||
accept();
|
||||
}
|
||||
Reference in new issue
Block a user