Enable SpeechRecognizer menu item and JavaScript object for Windows

This commit is contained in:
David Rowe 2014-10-20 13:52:37 -07:00
parent f872902ab9
commit 524c413681
3 changed files with 8 additions and 8 deletions

View file

@ -3773,7 +3773,7 @@ ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUser
scriptEngine->registerGlobalObject("Camera", cameraScriptable);
connect(scriptEngine, SIGNAL(finished(const QString&)), cameraScriptable, SLOT(deleteLater()));
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
scriptEngine->registerGlobalObject("SpeechRecognizer", Menu::getInstance()->getSpeechRecognizer());
#endif

View file

@ -98,7 +98,7 @@ Menu::Menu() :
_lodToolsDialog(NULL),
_newLocationDialog(NULL),
_userLocationsDialog(NULL),
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
_speechRecognizer(),
#endif
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
@ -223,7 +223,7 @@ Menu::Menu() :
addActionToQMenuAndActionHash(toolsMenu, MenuOption::MetavoxelEditor, 0, this, SLOT(showMetavoxelEditor()));
addActionToQMenuAndActionHash(toolsMenu, MenuOption::ScriptEditor, Qt::ALT | Qt::Key_S, this, SLOT(showScriptEditor()));
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::ControlWithSpeech,
Qt::CTRL | Qt::SHIFT | Qt::Key_C, _speechRecognizer.getEnabled(), &_speechRecognizer, SLOT(setEnabled(bool)));
connect(&_speechRecognizer, SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool)));
@ -745,7 +745,7 @@ void Menu::loadSettings(QSettings* settings) {
QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)).toString();
setScriptsLocation(settings->value("scriptsLocation", QString()).toString());
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
_speechRecognizer.setEnabled(settings->value("speechRecognitionEnabled", false).toBool());
#endif
@ -809,7 +809,7 @@ void Menu::saveSettings(QSettings* settings) {
settings->setValue("boundaryLevelAdjust", _boundaryLevelAdjust);
settings->setValue("snapshotsLocation", _snapshotsLocation);
settings->setValue("scriptsLocation", _scriptsLocation);
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
settings->setValue("speechRecognitionEnabled", _speechRecognizer.getEnabled());
#endif
settings->beginGroup("View Frustum Offset Camera");

View file

@ -23,7 +23,7 @@
#include <MenuItemProperties.h>
#include <OctreeConstants.h>
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#include "SpeechRecognizer.h"
#endif
@ -145,7 +145,7 @@ public:
bool shouldRenderMesh(float largestDimension, float distanceToCamera);
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
SpeechRecognizer* getSpeechRecognizer() { return &_speechRecognizer; }
#endif
@ -281,7 +281,7 @@ private:
LodToolsDialog* _lodToolsDialog;
QPointer<DataWebDialog> _newLocationDialog;
QPointer<DataWebDialog> _userLocationsDialog;
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
SpeechRecognizer _speechRecognizer;
#endif
int _maxVoxels;