Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 42 files). Show all
Unified · Split
| @@ -135,7 +135,7 @@ ScriptValue WindowScriptingInterface::prompt(const QString& message, const QStri · 134 unmodified lines | |||
| 135 | void WindowScriptingInterface::promptAsync(const QString& message, const QString& defaultText) { | 135 | void WindowScriptingInterface::promptAsync(const QString& message, const QString& defaultText) { |
| 136 | bool ok = false; | 136 | bool ok = false; |
| 137 | ModalDialogListener* dlg = OffscreenUi::getTextAsync(nullptr, "", message, QLineEdit::Normal, defaultText, &ok); | 137 | ModalDialogListener* dlg = OffscreenUi::getTextAsync(nullptr, "", message, QLineEdit::Normal, defaultText, &ok); |
| 138 | connect(dlg, &ModalDialogListener::response, this, [=] (QVariant result) { | 138 | connect(dlg, &ModalDialogListener::response, this, [=, this] (QVariant result) { |
| 139 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); | 139 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); |
| 140 | emit promptTextChanged(result.toString()); | 140 | emit promptTextChanged(result.toString()); |
| 141 | }); | 141 | }); |
| @@ -256,7 +256,7 @@ void WindowScriptingInterface::browseDirAsync(const QString& title, const QStrin · 114 unmodified lines | |||
| 256 | path = fixupPathForMac(directory); | 256 | path = fixupPathForMac(directory); |
| 257 | #endif | 257 | #endif |
| 258 | ModalDialogListener* dlg = OffscreenUi::getExistingDirectoryAsync(nullptr, title, path); | 258 | ModalDialogListener* dlg = OffscreenUi::getExistingDirectoryAsync(nullptr, title, path); |
| 259 | connect(dlg, &ModalDialogListener::response, this, [=] (QVariant response) { | 259 | connect(dlg, &ModalDialogListener::response, this, [=, this] (QVariant response) { |
| 260 | const QString& result = response.toString(); | 260 | const QString& result = response.toString(); |
| 261 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); | 261 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); |
| 262 | if (!result.isEmpty()) { | 262 | if (!result.isEmpty()) { |
| @@ -302,7 +302,7 @@ void WindowScriptingInterface::browseAsync(const QString& title, const QString& · 39 unmodified lines | |||
| 302 | path = fixupPathForMac(directory); | 302 | path = fixupPathForMac(directory); |
| 303 | #endif | 303 | #endif |
| 304 | ModalDialogListener* dlg = OffscreenUi::getOpenFileNameAsync(nullptr, title, path, nameFilter); | 304 | ModalDialogListener* dlg = OffscreenUi::getOpenFileNameAsync(nullptr, title, path, nameFilter); |
| 305 | connect(dlg, &ModalDialogListener::response, this, [=] (QVariant response) { | 305 | connect(dlg, &ModalDialogListener::response, this, [=, this] (QVariant response) { |
| 306 | const QString& result = response.toString(); | 306 | const QString& result = response.toString(); |
| 307 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); | 307 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); |
| 308 | if (!result.isEmpty()) { | 308 | if (!result.isEmpty()) { |
| @@ -350,7 +350,7 @@ void WindowScriptingInterface::saveAsync(const QString& title, const QString& di · 41 unmodified lines | |||
| 350 | path = fixupPathForMac(directory); | 350 | path = fixupPathForMac(directory); |
| 351 | #endif | 351 | #endif |
| 352 | ModalDialogListener* dlg = OffscreenUi::getSaveFileNameAsync(nullptr, title, path, nameFilter); | 352 | ModalDialogListener* dlg = OffscreenUi::getSaveFileNameAsync(nullptr, title, path, nameFilter); |
| 353 | connect(dlg, &ModalDialogListener::response, this, [=] (QVariant response) { | 353 | connect(dlg, &ModalDialogListener::response, this, [=, this] (QVariant response) { |
| 354 | const QString& result = response.toString(); | 354 | const QString& result = response.toString(); |
| 355 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); | 355 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); |
| 356 | if (!result.isEmpty()) { | 356 | if (!result.isEmpty()) { |
| @@ -405,7 +405,7 @@ void WindowScriptingInterface::browseAssetsAsync(const QString& title, const QSt · 48 unmodified lines | |||
| 405 | } | 405 | } |
| 406 | 406 | ||
| 407 | ModalDialogListener* dlg = OffscreenUi::getOpenAssetNameAsync(nullptr, title, path, nameFilter); | 407 | ModalDialogListener* dlg = OffscreenUi::getOpenAssetNameAsync(nullptr, title, path, nameFilter); |
| 408 | connect(dlg, &ModalDialogListener::response, this, [=] (QVariant response) { | 408 | connect(dlg, &ModalDialogListener::response, this, [=, this] (QVariant response) { |
| 409 | const QString& result = response.toString(); | 409 | const QString& result = response.toString(); |
| 410 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); | 410 | disconnect(dlg, &ModalDialogListener::response, this, nullptr); |
| 411 | if (!result.isEmpty()) { | 411 | if (!result.isEmpty()) { |