History

Remove Window.customPrompt() from JavaScript API

David Rowe committed 8 years ago

Commit d842e531 parent c8bb26a5 files · +0 −62Browse files

Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 5 files). Show all

Unified · Split

interface/src/scripting/WindowScriptingInterface.cpp+0−22
@@ -32,20 +32,6 @@ static const QString LAST_BROWSE_LOCATION_SETTING = "LastBrowseLocation"; · 31 unmodified lines
32static const QString LAST_BROWSE_ASSETS_LOCATION_SETTING = "LastBrowseAssetsLocation";32static const QString LAST_BROWSE_ASSETS_LOCATION_SETTING = "LastBrowseAssetsLocation";
33 33
34 34
35QScriptValue 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
44void CustomPromptResultFromScriptValue(const QScriptValue& object, CustomPromptResult& result) {
45 result.value = object.toVariant();
46}
47
48
49WindowScriptingInterface::WindowScriptingInterface() {35WindowScriptingInterface::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);
@@ -140,14 +126,6 @@ void WindowScriptingInterface::disconnectedFromDomain() { · 88 unmodified lines
140 emit domainChanged("");126 emit domainChanged("");
141}127}
142 128
143CustomPromptResult WindowScriptingInterface::customPrompt(const QVariant& config) {
144 CustomPromptResult result;
145 bool ok = false;
146 auto configMap = config.toMap();
147 result.value = OffscreenUi::getCustomInfo(OffscreenUi::ICON_NONE, "", configMap, &ok);
148 return ok ? result : CustomPromptResult();
149}
150
151QString fixupPathForMac(const QString& directory) {129QString fixupPathForMac(const QString& directory) {
152 // On OS X `directory` does not work as expected unless a file is included in the path, so we append a bogus130 // On OS X `directory` does not work as expected unless a file is included in the path, so we append a bogus
153 // filename if the directory is valid.131 // filename if the directory is valid.