chatgui: настройка звука уведомления на канал (sound_on_message)
This commit is contained in:
1 parent
fc2262912a
commit
910cfeac20
3 files changed
+10
-1
No files matched your search
@@ -38,6 +38,10 @@ ChannelSettingsDialog::ChannelSettingsDialog(const QString& channelId, DbManager
|
||||
m_autoPlayVoice->setToolTip(QStringLiteral("Voice messages will play automatically when received. Multiple messages queue up and play sequentially without interrupting current playback."));
|
||||
layout->addWidget(m_autoPlayVoice);
|
||||
|
||||
m_soundOnMessage = new QCheckBox(QStringLiteral("Play sound on incoming message"), this);
|
||||
m_soundOnMessage->setToolTip(QStringLiteral("Play a notification sound when a message arrives in this channel."));
|
||||
layout->addWidget(m_soundOnMessage);
|
||||
|
||||
m_pttMode = new QCheckBox(QStringLiteral("Push-To-Talk (PTT) mode"), this);
|
||||
m_pttMode->setToolTip(QStringLiteral("Record voice messages with push-to-talk. (Coming soon)"));
|
||||
m_pttMode->setEnabled(false);
|
||||
@@ -74,6 +78,8 @@ ChannelSettingsDialog::ChannelSettingsDialog(const QString& channelId, DbManager
|
||||
if (m_db && m_db->isOpen()) {
|
||||
QString autoPlayKey = QStringLiteral("ch_%1_auto_play_voice").arg(channelId);
|
||||
m_autoPlayVoice->setChecked(m_db->getUiStateInt(autoPlayKey, 0) != 0);
|
||||
QString soundKey = QStringLiteral("ch_%1_sound_on_message").arg(channelId);
|
||||
m_soundOnMessage->setChecked(m_db->getUiStateInt(soundKey, 1) != 0);
|
||||
QString pttKey = QStringLiteral("ch_%1_ptt_mode").arg(channelId);
|
||||
m_pttMode->setChecked(m_db->getUiStateInt(pttKey, 0) != 0);
|
||||
}
|
||||
@@ -94,6 +100,7 @@ void ChannelSettingsDialog::onSave() {
|
||||
}
|
||||
};
|
||||
saveKey("auto_play_voice", m_autoPlayVoice->isChecked() ? 1 : 0);
|
||||
saveKey("sound_on_message", m_soundOnMessage->isChecked() ? 1 : 0);
|
||||
saveKey("ptt_mode", m_pttMode->isChecked() ? 1 : 0);
|
||||
accept();
|
||||
}
|
||||
Reference in new issue
Block a user