Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -253,6 +253,16 @@ int WindowScriptingInterface::createMessageBox(QString title, QString text, int · 252 unmodified lines | |||
| 253 | void WindowScriptingInterface::updateMessageBox(int id, QString title, QString text, int buttons, int defaultButton) { | 253 | void WindowScriptingInterface::updateMessageBox(int id, QString title, QString text, int buttons, int defaultButton) { |
| 254 | auto messageBox = _messageBoxes.value(id); | 254 | auto messageBox = _messageBoxes.value(id); |
| 255 | if (messageBox) { | 255 | if (messageBox) { |
| 256 | if (QThread::currentThread() != thread()) { | ||
| 257 | QMetaObject::invokeMethod(this, "updateMessageBox", | ||
| 258 | Q_ARG(int, id), | ||
| 259 | Q_ARG(QString, title), | ||
| 260 | Q_ARG(QString, text), | ||
| 261 | Q_ARG(int, buttons), | ||
| 262 | Q_ARG(int, defaultButton)); | ||
| 263 | return; | ||
| 264 | } | ||
| 265 | |||
| 256 | messageBox->setProperty("title", title); | 266 | messageBox->setProperty("title", title); |
| 257 | messageBox->setProperty("text", text); | 267 | messageBox->setProperty("text", text); |
| 258 | messageBox->setProperty("buttons", buttons); | 268 | messageBox->setProperty("buttons", buttons); |
| @@ -263,6 +273,12 @@ void WindowScriptingInterface::updateMessageBox(int id, QString title, QString t · 4 unmodified lines | |||
| 263 | void WindowScriptingInterface::closeMessageBox(int id) { | 273 | void WindowScriptingInterface::closeMessageBox(int id) { |
| 264 | auto messageBox = _messageBoxes.value(id); | 274 | auto messageBox = _messageBoxes.value(id); |
| 265 | if (messageBox) { | 275 | if (messageBox) { |
| 276 | if (QThread::currentThread() != thread()) { | ||
| 277 | QMetaObject::invokeMethod(this, "closeMessageBox", | ||
| 278 | Q_ARG(int, id)); | ||
| 279 | return; | ||
| 280 | } | ||
| 281 | |||
| 266 | disconnect(messageBox); | 282 | disconnect(messageBox); |
| 267 | messageBox->setVisible(false); | 283 | messageBox->setVisible(false); |
| 268 | messageBox->deleteLater(); | 284 | messageBox->deleteLater(); |