From 4daa9435109ae00ab39f17ed345c1a73179e8a5c Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 4 Dec 2018 17:17:58 -0800 Subject: [PATCH] fixing scripts param/reverting some qml --- interface/resources/qml/LoginDialog.qml | 5 ++--- interface/resources/qml/LoginDialog/SignUpBody.qml | 2 +- interface/resources/qml/controlsUit/Keyboard.qml | 1 - interface/src/Application.cpp | 3 +++ interface/src/Application.h | 2 ++ interface/src/main.cpp | 11 +++++++++++ 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/LoginDialog.qml b/interface/resources/qml/LoginDialog.qml index b0f3b0f1f1..70815192cc 100644 --- a/interface/resources/qml/LoginDialog.qml +++ b/interface/resources/qml/LoginDialog.qml @@ -1,9 +1,8 @@ // // LoginDialog.qml // -// Created by Wayne Chen -// Copyright 2018 High Fidelity, Inc. -// +// Created by David Rowe on 3 Jun 2015 +// Copyright 2015 High Fidelity, Inc. // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/interface/resources/qml/LoginDialog/SignUpBody.qml b/interface/resources/qml/LoginDialog/SignUpBody.qml index fc5d30224d..e4e0f5a88c 100644 --- a/interface/resources/qml/LoginDialog/SignUpBody.qml +++ b/interface/resources/qml/LoginDialog/SignUpBody.qml @@ -1,5 +1,5 @@ // -// signUpBody.qml +// SignUpBody.qml // // Created by Stephen Birarda on 7 Dec 2016 // Copyright 2016 High Fidelity, Inc. diff --git a/interface/resources/qml/controlsUit/Keyboard.qml b/interface/resources/qml/controlsUit/Keyboard.qml index c39f7a219c..a55523f34a 100644 --- a/interface/resources/qml/controlsUit/Keyboard.qml +++ b/interface/resources/qml/controlsUit/Keyboard.qml @@ -56,7 +56,6 @@ Rectangle { keyboardBase.height = raised ? raisedHeight : 0; keyboardBase.visible = raised; } else { - console.log("raising 3d keyboard to " + raised); KeyboardScriptingInterface.raised = raised; KeyboardScriptingInterface.password = raised ? password : false; } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 359910e957..790a93ad5a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1765,6 +1765,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo userInputMapper->registerDevice(_touchscreenVirtualPadDevice->getInputDevice()); } + QString scriptsSwitch = QString("--").append(SCRIPTS_SWITCH); + _defaultScriptsLocation = getCmdOption(argc, constArgv, scriptsSwitch.toStdString().c_str()); + // Make sure we don't time out during slow operations at startup updateHeartbeat(); diff --git a/interface/src/Application.h b/interface/src/Application.h index 4b55d90222..8196915248 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -98,6 +98,7 @@ static const UINT UWM_SHOW_APPLICATION = #endif static const QString RUNNING_MARKER_FILENAME = "Interface.running"; +static const QString SCRIPTS_SWITCH = "scripts"; class Application; #if defined(qApp) @@ -664,6 +665,7 @@ private: ControllerScriptingInterface* _controllerScriptingInterface{ nullptr }; QPointer _logDialog; QPointer _entityScriptServerLogDialog; + QDir _defaultScriptsLocation; FileLogger* _logger; diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 0b02649c6e..5af0a9371d 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -72,6 +72,7 @@ int main(int argc, const char* argv[]) { QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath"); QCommandLineOption allowMultipleInstancesOption("allowMultipleInstances", "Allow multiple instances to run"); QCommandLineOption overrideAppLocalDataPathOption("cache", "set test cache ", "dir"); + QCommandLineOption overrideScriptsPathOption(SCRIPTS_SWITCH, "set scripts ", "path"); parser.addOption(urlOption); parser.addOption(noUpdaterOption); @@ -79,6 +80,7 @@ int main(int argc, const char* argv[]) { parser.addOption(runServerOption); parser.addOption(serverContentPathOption); parser.addOption(overrideAppLocalDataPathOption); + parser.addOption(overrideScriptsPathOption); parser.addOption(allowMultipleInstancesOption); if (!parser.parse(arguments)) { @@ -165,6 +167,15 @@ int main(int argc, const char* argv[]) { if (allowMultipleInstances) { instanceMightBeRunning = false; } + // this needs to be done here in main, as the mechanism for setting the + // scripts directory appears not to work. See the bug report + // https://highfidelity.fogbugz.com/f/cases/5759/Issues-changing-scripts-directory-in-ScriptsEngine + if (parser.isSet(overrideScriptsPathOption)) { + QDir scriptsPath(parser.value(overrideScriptsPathOption)); + if (scriptsPath.exists()) { + PathUtils::defaultScriptsLocation(scriptsPath.path()); + } + } if (instanceMightBeRunning) { // Try to connect and send message to existing interface instance