History

Merge branch 'master' of github.com:highfidelity/hifi into tablet-ui

Seth Alves committed 9 years ago

Commit 0b51b1d2 parents ad96a66 0582aca5 files · +36 −21Browse files

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

Unified · Split

interface/src/scripting/WindowScriptingInterface.cpp+16−0
@@ -255,6 +255,16 @@ int WindowScriptingInterface::createMessageBox(QString title, QString text, int · 254 unmodified lines
255255 void WindowScriptingInterface::updateMessageBox(int id, QString title, QString text, int buttons, int defaultButton) {
256256 auto messageBox = _messageBoxes.value(id);
257257 if (messageBox) {
258+ if (QThread::currentThread() != thread()) {
259+ QMetaObject::invokeMethod(this, "updateMessageBox",
260+ Q_ARG(int, id),
261+ Q_ARG(QString, title),
262+ Q_ARG(QString, text),
263+ Q_ARG(int, buttons),
264+ Q_ARG(int, defaultButton));
265+ return;
266+ }
267+
258268 messageBox->setProperty("title", title);
259269 messageBox->setProperty("text", text);
260270 messageBox->setProperty("buttons", buttons);
@@ -265,6 +275,12 @@ void WindowScriptingInterface::updateMessageBox(int id, QString title, QString t · 4 unmodified lines
265275 void WindowScriptingInterface::closeMessageBox(int id) {
266276 auto messageBox = _messageBoxes.value(id);
267277 if (messageBox) {
278+ if (QThread::currentThread() != thread()) {
279+ QMetaObject::invokeMethod(this, "closeMessageBox",
280+ Q_ARG(int, id));
281+ return;
282+ }
283+
268284 disconnect(messageBox);
269285 messageBox->setVisible(false);
270286 messageBox->deleteLater();