Still missing the warning and diabling of dynamic checkbox when the static mesh is selected.
Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 7 files). Show all
Unified · Split
| @@ -29,6 +29,20 @@ static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStanda · 28 unmodified lines | ||
| 29 | 29 | static const QString LAST_BROWSE_LOCATION_SETTING = "LastBrowseLocation"; |
| 30 | 30 | |
| 31 | 31 | |
| 32 | +QScriptValue CustomPromptResultToScriptValue(QScriptEngine* engine, const CustomPromptResult& result) { | |
| 33 | + if (!result.value.isValid()) { | |
| 34 | + return QScriptValue::UndefinedValue; | |
| 35 | + } | |
| 36 | + | |
| 37 | + Q_ASSERT(result.value.userType() == qMetaTypeId<QVariantMap>()); | |
| 38 | + return engine->toScriptValue(result.value.toMap()); | |
| 39 | +} | |
| 40 | + | |
| 41 | +void CustomPromptResultFromScriptValue(const QScriptValue& object, CustomPromptResult& result) { | |
| 42 | + result.value = object.toVariant(); | |
| 43 | +} | |
| 44 | + | |
| 45 | + | |
| 32 | 46 | WindowScriptingInterface::WindowScriptingInterface() { |
| 33 | 47 | const DomainHandler& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler(); |
| 34 | 48 | connect(&domainHandler, &DomainHandler::connectedToDomain, this, &WindowScriptingInterface::domainChanged); |
| @@ -95,6 +109,14 @@ QScriptValue WindowScriptingInterface::prompt(const QString& message, const QStr · 60 unmodified lines | ||
| 95 | 109 | return ok ? QScriptValue(result) : QScriptValue::NullValue; |
| 96 | 110 | } |
| 97 | 111 | |
| 112 | +CustomPromptResult WindowScriptingInterface::customPrompt(const QVariant& config) { | |
| 113 | + CustomPromptResult result; | |
| 114 | + bool ok = false; | |
| 115 | + auto configMap = config.toMap(); | |
| 116 | + result.value = OffscreenUi::getCustomInfo(OffscreenUi::ICON_NONE, "", configMap, &ok); | |
| 117 | + return ok ? result : CustomPromptResult(); | |
| 118 | +} | |
| 119 | + | |
| 98 | 120 | QString fixupPathForMac(const QString& directory) { |
| 99 | 121 | // On OS X `directory` does not work as expected unless a file is included in the path, so we append a bogus |
| 100 | 122 | // filename if the directory is valid. |