From cd0de275cc0b9f80bc67ec0317aaa5a2bca30435 Mon Sep 17 00:00:00 2001 From: BombJovi Date: Thu, 10 Feb 2022 23:16:43 -0600 Subject: [PATCH] FEAT(client): Add option to toggle TTS in settings menu Previously TTS could only be toggled from the Configure dropdown menu, but not from within the settings. This was confusing, especially since other TTS related settings were editable from within the settings UI. This commit introduces a new checkbox into the settings UI that allows users to toggle TTS right then and there, which should take care of the created confusion. Fixes #5561 --- src/mumble/Log.cpp | 2 + src/mumble/Log.ui | 105 +++++++++++++++++++++----------------- src/mumble/MainWindow.cpp | 1 + 3 files changed, 62 insertions(+), 46 deletions(-) diff --git a/src/mumble/Log.cpp b/src/mumble/Log.cpp index 3afaad99e..f948df543 100644 --- a/src/mumble/Log.cpp +++ b/src/mumble/Log.cpp @@ -238,6 +238,7 @@ void LogConfig::load(const Settings &r) { qcbReadBackOwn->setChecked(r.bTTSMessageReadBack); qcbNoScope->setChecked(r.bTTSNoScope); qcbNoAuthor->setChecked(r.bTTSNoAuthor); + qcbEnableTTS->setChecked(r.bTTS); #endif qcbWhisperFriends->setChecked(r.bWhisperFriends); @@ -281,6 +282,7 @@ void LogConfig::save() const { s.bTTSMessageReadBack = qcbReadBackOwn->isChecked(); s.bTTSNoScope = qcbNoScope->isChecked(); s.bTTSNoAuthor = qcbNoAuthor->isChecked(); + s.bTTS = qcbEnableTTS->isChecked(); #endif s.bWhisperFriends = qcbWhisperFriends->isChecked(); s.iMessageLimitUserThreshold = qsbMessageLimitUsers->value(); diff --git a/src/mumble/Log.ui b/src/mumble/Log.ui index 736284fb5..d3462b0bd 100644 --- a/src/mumble/Log.ui +++ b/src/mumble/Log.ui @@ -6,8 +6,8 @@ 0 0 - 580 - 496 + 650 + 500 @@ -79,17 +79,62 @@ Text To Speech - - - - Volume + + + + If enabled text messages you send will be read back to you with TTS - - qsVolume + + Read back own messages - + + + + Length threshold + + + qsbThreshold + + + + + + + true + + + Click to enable Text-to-Speech + + + Enable Text-to-Speech + + + + + + + Message length threshold for Text-To-Speech Engine + + + <b>This is the length threshold used for the Text-To-Speech Engine.</b><br />Messages longer than this limit will not be read aloud in their full length. + + + QAbstractSpinBox::PlusMinus + + + Characters + + + 5000 + + + 10 + + + + Volume of Text-To-Speech Engine @@ -118,48 +163,16 @@ - + - Length threshold + Volume - qsbThreshold + qsVolume - - - - Message length threshold for Text-To-Speech Engine - - - <b>This is the length threshold used for the Text-To-Speech Engine.</b><br />Messages longer than this limit will not be read aloud in their full length. - - - QAbstractSpinBox::PlusMinus - - - Characters - - - 5000 - - - 10 - - - - - - - If enabled text messages you send will be read back to you with TTS - - - Read back own messages - - - - + If enabled, TTS will not dictate the message scope. @@ -169,7 +182,7 @@ - + If enabled, TTS will not dictate the message author. diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp index be4e34949..95884ae08 100644 --- a/src/mumble/MainWindow.cpp +++ b/src/mumble/MainWindow.cpp @@ -2130,6 +2130,7 @@ void MainWindow::on_qmConfig_aboutToShow() { qmConfig->addAction(qaAudioWizard); qmConfig->addAction(qaConfigCert); qmConfig->addSeparator(); + qaAudioTTS->setChecked(Global::get().s.bTTS); qmConfig->addAction(qaAudioTTS); qmConfig->addSeparator(); qmConfig->addAction(qaConfigMinimal);