Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 170 files). Show all
Unified · Split
| @@ -76,7 +76,7 @@ WindowScriptingInterface::~WindowScriptingInterface() { · 75 unmodified lines | ||
| 76 | 76 | _messageBoxes.clear(); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | −ScriptValuePointer WindowScriptingInterface::hasFocus() { | |
| 79 | +ScriptValue WindowScriptingInterface::hasFocus() { | |
| 80 | 80 | return engine()->newValue(qApp->hasFocus()); |
| 81 | 81 | } |
| 82 | 82 | |
| @@ -96,26 +96,26 @@ void WindowScriptingInterface::raise() { · 13 unmodified lines | ||
| 96 | 96 | |
| 97 | 97 | /// Display an alert box |
| 98 | 98 | /// \param const QString& message message to display |
| 99 | −/// \return ScriptValuePointer::UndefinedValue | |
| 99 | +/// \return ScriptValue::UndefinedValue | |
| 100 | 100 | void WindowScriptingInterface::alert(const QString& message) { |
| 101 | 101 | OffscreenUi::asyncWarning("", message, QMessageBox::Ok, QMessageBox::Ok); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /// Display a confirmation box with the options 'Yes' and 'No' |
| 105 | 105 | /// \param const QString& message message to display |
| 106 | −/// \return ScriptValuePointer `true` if 'Yes' was clicked, `false` otherwise | |
| 107 | −ScriptValuePointer WindowScriptingInterface::confirm(const QString& message) { | |
| 106 | +/// \return ScriptValue `true` if 'Yes' was clicked, `false` otherwise | |
| 107 | +ScriptValue WindowScriptingInterface::confirm(const QString& message) { | |
| 108 | 108 | return engine()->newValue((QMessageBox::Yes == OffscreenUi::question("", message, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes))); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /// Display a prompt with a text box |
| 112 | 112 | /// \param const QString& message message to display |
| 113 | 113 | /// \param const QString& defaultText default text in the text box |
| 114 | −/// \return ScriptValuePointer string text value in text box if the dialog was accepted, `null` otherwise. | |
| 115 | −ScriptValuePointer WindowScriptingInterface::prompt(const QString& message, const QString& defaultText) { | |
| 114 | +/// \return ScriptValue string text value in text box if the dialog was accepted, `null` otherwise. | |
| 115 | +ScriptValue WindowScriptingInterface::prompt(const QString& message, const QString& defaultText) { | |
| 116 | 116 | QString result = OffscreenUi::getText(nullptr, "", message, QLineEdit::Normal, defaultText); |
| 117 | 117 | auto sResult = engine()->newValue(result); |
| 118 | − if (sResult->equals(engine()->newValue(""))) { | |
| 118 | + if (sResult.equals(engine()->newValue(""))) { | |
| 119 | 119 | return engine()->nullValue(); |
| 120 | 120 | } |
| 121 | 121 | return sResult; |
| @@ -218,8 +218,8 @@ void WindowScriptingInterface::ensureReticleVisible() const { · 96 unmodified lines | ||
| 218 | 218 | /// working directory. |
| 219 | 219 | /// \param const QString& title title of the window |
| 220 | 220 | /// \param const QString& directory directory to start the directory browser at |
| 221 | −/// \return ScriptValuePointer file path as a string if one was selected, otherwise `ScriptValuePointer::NullValue` | |
| 222 | −ScriptValuePointer WindowScriptingInterface::browseDir(const QString& title, const QString& directory) { | |
| 221 | +/// \return ScriptValue file path as a string if one was selected, otherwise `ScriptValue::NullValue` | |
| 222 | +ScriptValue WindowScriptingInterface::browseDir(const QString& title, const QString& directory) { | |
| 223 | 223 | ensureReticleVisible(); |
| 224 | 224 | QString path = directory; |
| 225 | 225 | if (path.isEmpty()) { |
| @@ -262,8 +262,8 @@ void WindowScriptingInterface::browseDirAsync(const QString& title, const QStrin · 36 unmodified lines | ||
| 262 | 262 | /// \param const QString& title title of the window |
| 263 | 263 | /// \param const QString& directory directory to start the file browser at |
| 264 | 264 | /// \param const QString& nameFilter filter to filter filenames by - see `QFileDialog` |
| 265 | −/// \return ScriptValuePointer file path as a string if one was selected, otherwise `ScriptValuePointer::NullValue` | |
| 266 | −ScriptValuePointer WindowScriptingInterface::browse(const QString& title, const QString& directory, const QString& nameFilter) { | |
| 265 | +/// \return ScriptValue file path as a string if one was selected, otherwise `ScriptValue::NullValue` | |
| 266 | +ScriptValue WindowScriptingInterface::browse(const QString& title, const QString& directory, const QString& nameFilter) { | |
| 267 | 267 | ensureReticleVisible(); |
| 268 | 268 | QString path = directory; |
| 269 | 269 | if (path.isEmpty()) { |
| @@ -309,8 +309,8 @@ void WindowScriptingInterface::browseAsync(const QString& title, const QString& · 39 unmodified lines | ||
| 309 | 309 | /// \param const QString& title title of the window |
| 310 | 310 | /// \param const QString& directory directory to start the file browser at |
| 311 | 311 | /// \param const QString& nameFilter filter to filter filenames by - see `QFileDialog` |
| 312 | −/// \return ScriptValuePointer file path as a string if one was selected, otherwise `ScriptValuePointer::NullValue` | |
| 313 | −ScriptValuePointer WindowScriptingInterface::save(const QString& title, const QString& directory, const QString& nameFilter) { | |
| 312 | +/// \return ScriptValue file path as a string if one was selected, otherwise `ScriptValue::NullValue` | |
| 313 | +ScriptValue WindowScriptingInterface::save(const QString& title, const QString& directory, const QString& nameFilter) { | |
| 314 | 314 | ensureReticleVisible(); |
| 315 | 315 | QString path = directory; |
| 316 | 316 | if (path.isEmpty()) { |
| @@ -356,8 +356,8 @@ void WindowScriptingInterface::saveAsync(const QString& title, const QString& di · 39 unmodified lines | ||
| 356 | 356 | /// \param const QString& title title of the window |
| 357 | 357 | /// \param const QString& directory directory to start the asset browser at |
| 358 | 358 | /// \param const QString& nameFilter filter to filter asset names by - see `QFileDialog` |
| 359 | −/// \return ScriptValuePointer asset path as a string if one was selected, otherwise `ScriptValuePointer::NullValue` | |
| 360 | −ScriptValuePointer WindowScriptingInterface::browseAssets(const QString& title, const QString& directory, const QString& nameFilter) { | |
| 359 | +/// \return ScriptValue asset path as a string if one was selected, otherwise `ScriptValue::NullValue` | |
| 360 | +ScriptValue WindowScriptingInterface::browseAssets(const QString& title, const QString& directory, const QString& nameFilter) { | |
| 361 | 361 | ensureReticleVisible(); |
| 362 | 362 | QString path = directory; |
| 363 | 363 | if (path.isEmpty()) { |