Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 39 files). Show all
Unified · Split
| @@ -472,20 +472,24 @@ void ScriptEngine::scriptErrorMessage(const QString& message) { · 471 unmodified lines | |||
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | void ScriptEngine::scriptWarningMessage(const QString& message) { | 474 | void ScriptEngine::scriptWarningMessage(const QString& message) { |
| 475 | qCWarning(scriptengine) << message; | 475 | qCWarning(scriptengine) << qPrintable(message); |
| 476 | emit warningMessage(message, getFilename()); | 476 | emit warningMessage(message, getFilename()); |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | void ScriptEngine::scriptInfoMessage(const QString& message) { | 479 | void ScriptEngine::scriptInfoMessage(const QString& message) { |
| 480 | qCInfo(scriptengine) << message; | 480 | qCInfo(scriptengine) << qPrintable(message); |
| 481 | emit infoMessage(message, getFilename()); | 481 | emit infoMessage(message, getFilename()); |
| 482 | } | 482 | } |
| 483 | 483 | ||
| 484 | void ScriptEngine::scriptPrintedMessage(const QString& message) { | 484 | void ScriptEngine::scriptPrintedMessage(const QString& message) { |
| 485 | qCDebug(scriptengine) << message; | 485 | qCDebug(scriptengine) << qPrintable(message); |
| 486 | emit printedMessage(message, getFilename()); | 486 | emit printedMessage(message, getFilename()); |
| 487 | } | 487 | } |
| 488 | 488 | ||
| 489 | void ScriptEngine::clearDebugLogWindow() { | ||
| 490 | emit clearDebugWindow(); | ||
| 491 | } | ||
| 492 | |||
| 489 | // Even though we never pass AnimVariantMap directly to and from javascript, the queued invokeMethod of | 493 | // Even though we never pass AnimVariantMap directly to and from javascript, the queued invokeMethod of |
| 490 | // callAnimationStateHandler requires that the type be registered. | 494 | // callAnimationStateHandler requires that the type be registered. |
| 491 | // These two are meaningful, if we ever do want to use them... | 495 | // These two are meaningful, if we ever do want to use them... |
| @@ -668,8 +672,18 @@ void ScriptEngine::init() { · 176 unmodified lines | |||
| 668 | registerGlobalObject("Mat4", &_mat4Library); | 672 | registerGlobalObject("Mat4", &_mat4Library); |
| 669 | registerGlobalObject("Uuid", &_uuidLibrary); | 673 | registerGlobalObject("Uuid", &_uuidLibrary); |
| 670 | registerGlobalObject("Messages", DependencyManager::get<MessagesClient>().data()); | 674 | registerGlobalObject("Messages", DependencyManager::get<MessagesClient>().data()); |
| 671 | |||
| 672 | registerGlobalObject("File", new FileScriptingInterface(this)); | 675 | registerGlobalObject("File", new FileScriptingInterface(this)); |
| 676 | registerGlobalObject("console", &_consoleScriptingInterface); | ||
| 677 | registerFunction("console", "info", ConsoleScriptingInterface::info, currentContext()->argumentCount()); | ||
| 678 | registerFunction("console", "log", ConsoleScriptingInterface::log, currentContext()->argumentCount()); | ||
| 679 | registerFunction("console", "debug", ConsoleScriptingInterface::debug, currentContext()->argumentCount()); | ||
| 680 | registerFunction("console", "warn", ConsoleScriptingInterface::warn, currentContext()->argumentCount()); | ||
| 681 | registerFunction("console", "error", ConsoleScriptingInterface::error, currentContext()->argumentCount()); | ||
| 682 | registerFunction("console", "exception", ConsoleScriptingInterface::exception, currentContext()->argumentCount()); | ||
| 683 | registerFunction("console", "assert", ConsoleScriptingInterface::assertion, currentContext()->argumentCount()); | ||
| 684 | registerFunction("console", "group", ConsoleScriptingInterface::group, 1); | ||
| 685 | registerFunction("console", "groupCollapsed", ConsoleScriptingInterface::groupCollapsed, 1); | ||
| 686 | registerFunction("console", "groupEnd", ConsoleScriptingInterface::groupEnd, 0); | ||
| 673 | 687 | ||
| 674 | qScriptRegisterMetaType(this, animVarMapToScriptValue, animVarMapFromScriptValue); | 688 | qScriptRegisterMetaType(this, animVarMapToScriptValue, animVarMapFromScriptValue); |
| 675 | qScriptRegisterMetaType(this, resultHandlerToScriptValue, resultHandlerFromScriptValue); | 689 | qScriptRegisterMetaType(this, resultHandlerToScriptValue, resultHandlerFromScriptValue); |