Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 25 files). Show all
Unified · Split
| @@ -32,20 +32,6 @@ static const QString LAST_BROWSE_LOCATION_SETTING = "LastBrowseLocation"; · 31 unmodified lines | |||
| 32 | static const QString LAST_BROWSE_ASSETS_LOCATION_SETTING = "LastBrowseAssetsLocation"; | 32 | static const QString LAST_BROWSE_ASSETS_LOCATION_SETTING = "LastBrowseAssetsLocation"; |
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | QScriptValue CustomPromptResultToScriptValue(QScriptEngine* engine, const CustomPromptResult& result) { | ||
| 36 | if (!result.value.isValid()) { | ||
| 37 | return QScriptValue::UndefinedValue; | ||
| 38 | } | ||
| 39 | |||
| 40 | Q_ASSERT(result.value.userType() == qMetaTypeId<QVariantMap>()); | ||
| 41 | return engine->toScriptValue(result.value.toMap()); | ||
| 42 | } | ||
| 43 | |||
| 44 | void CustomPromptResultFromScriptValue(const QScriptValue& object, CustomPromptResult& result) { | ||
| 45 | result.value = object.toVariant(); | ||
| 46 | } | ||
| 47 | |||
| 48 | |||
| 49 | WindowScriptingInterface::WindowScriptingInterface() { | 35 | WindowScriptingInterface::WindowScriptingInterface() { |
| 50 | const DomainHandler& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler(); | 36 | const DomainHandler& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler(); |
| 51 | connect(&domainHandler, &DomainHandler::connectedToDomain, this, &WindowScriptingInterface::domainChanged); | 37 | connect(&domainHandler, &DomainHandler::connectedToDomain, this, &WindowScriptingInterface::domainChanged); |
| @@ -143,14 +129,6 @@ void WindowScriptingInterface::disconnectedFromDomain() { · 91 unmodified lines | |||
| 143 | emit domainChanged("", QUrl()); | 129 | emit domainChanged("", QUrl()); |
| 144 | } | 130 | } |
| 145 | 131 | ||
| 146 | CustomPromptResult WindowScriptingInterface::customPrompt(const QVariant& config) { | ||
| 147 | CustomPromptResult result; | ||
| 148 | bool ok = false; | ||
| 149 | auto configMap = config.toMap(); | ||
| 150 | result.value = OffscreenUi::getCustomInfo(OffscreenUi::ICON_NONE, "", configMap, &ok); | ||
| 151 | return ok ? result : CustomPromptResult(); | ||
| 152 | } | ||
| 153 | |||
| 154 | QString fixupPathForMac(const QString& directory) { | 132 | QString fixupPathForMac(const QString& directory) { |
| 155 | // On OS X `directory` does not work as expected unless a file is included in the path, so we append a bogus | 133 | // On OS X `directory` does not work as expected unless a file is included in the path, so we append a bogus |
| 156 | // filename if the directory is valid. | 134 | // filename if the directory is valid. |