Added it in the DM
Showing the changes to interface/src/Menu.cpp (1 of 7 files). Show all
Unified · Split
| @@ -192,9 +192,13 @@ Menu::Menu() { · 191 unmodified lines | ||
| 192 | 192 | dialogsManager.data(), SLOT(showScriptEditor())); |
| 193 | 193 | |
| 194 | 194 | #if defined(Q_OS_MAC) || defined(Q_OS_WIN) |
| 195 | + auto speechRecognizer = DependencyManager::get<SpeechRecognizer>(); | |
| 195 | 196 | QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::ControlWithSpeech, |
| 196 | − Qt::CTRL | Qt::SHIFT | Qt::Key_C, _speechRecognizer.getEnabled(), &_speechRecognizer, SLOT(setEnabled(bool))); | |
| 197 | − connect(&_speechRecognizer, SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool))); | |
| 197 | + Qt::CTRL | Qt::SHIFT | Qt::Key_C, | |
| 198 | + speechRecognizer->getEnabled(), | |
| 199 | + speechRecognizer.data(), | |
| 200 | + SLOT(setEnabled(bool))); | |
| 201 | + connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool))); | |
| 198 | 202 | #endif |
| 199 | 203 | |
| 200 | 204 | #ifdef HAVE_QXMPP |
| @@ -590,12 +594,6 @@ void Menu::loadSettings(QSettings* settings) { · 389 unmodified lines | ||
| 590 | 594 | audio->setOutputStarveDetectionPeriod(settings->value("audioOutputStarveDetectionPeriod", DEFAULT_AUDIO_OUTPUT_STARVE_DETECTION_PERIOD).toInt()); |
| 591 | 595 | int bufferSize = settings->value("audioOutputBufferSize", DEFAULT_AUDIO_OUTPUT_BUFFER_SIZE_FRAMES).toInt(); |
| 592 | 596 | QMetaObject::invokeMethod(audio.data(), "setOutputBufferSize", Q_ARG(int, bufferSize)); |
| 593 | − | |
| 594 | − setScriptsLocation(settings->value("scriptsLocation", QString()).toString()); | |
| 595 | − | |
| 596 | −#if defined(Q_OS_MAC) || defined(Q_OS_WIN) | |
| 597 | − _speechRecognizer.setEnabled(settings->value("speechRecognitionEnabled", false).toBool()); | |
| 598 | −#endif | |
| 599 | 597 | |
| 600 | 598 | scanMenuBar(&loadAction, settings); |
| 601 | 599 | Application::getInstance()->getAvatar()->loadData(settings); |
| @@ -630,11 +628,6 @@ void Menu::saveSettings(QSettings* settings) { · 28 unmodified lines | ||
| 630 | 628 | settings->setValue("audioOutputStarveDetectionPeriod", audio->getOutputStarveDetectionPeriod()); |
| 631 | 629 | settings->setValue("audioOutputBufferSize", audio->getOutputBufferSize()); |
| 632 | 630 | |
| 633 | − settings->setValue("scriptsLocation", _scriptsLocation); | |
| 634 | −#if defined(Q_OS_MAC) || defined(Q_OS_WIN) | |
| 635 | − settings->setValue("speechRecognitionEnabled", _speechRecognizer.getEnabled()); | |
| 636 | −#endif | |
| 637 | − | |
| 638 | 631 | scanMenuBar(&saveAction, settings); |
| 639 | 632 | Application::getInstance()->getAvatar()->saveData(settings); |
| 640 | 633 | |
| @@ -1100,9 +1093,3 @@ void Menu::runTests() { · 459 unmodified lines | ||
| 1100 | 1093 | runTimingTests(); |
| 1101 | 1094 | } |
| 1102 | 1095 | |
| 1103 | −void Menu::setScriptsLocation(const QString& scriptsLocation) { | |
| 1104 | − _scriptsLocation = scriptsLocation; | |
| 1105 | − bumpSettings(); | |
| 1106 | − emit scriptLocationChanged(scriptsLocation); | |
| 1107 | −} | |
| 1108 | − | |