MCPcopy Create free account
hub / github.com/ElementsProject/elements / ThreadSafeMessageBox

Function ThreadSafeMessageBox

src/qt/bitcoingui.cpp:1424–1447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1422}
1423
1424static bool ThreadSafeMessageBox(BitcoinGUI* gui, const bilingual_str& message, const std::string& caption, unsigned int style)
1425{
1426 bool modal = (style & CClientUIInterface::MODAL);
1427 // The SECURE flag has no effect in the Qt GUI.
1428 // bool secure = (style & CClientUIInterface::SECURE);
1429 style &= ~CClientUIInterface::SECURE;
1430 bool ret = false;
1431
1432 QString detailed_message; // This is original message, in English, for googling and referencing.
1433 if (message.original != message.translated) {
1434 detailed_message = BitcoinGUI::tr("Original message:") + "\n" + QString::fromStdString(message.original);
1435 }
1436
1437 // In case of modal message, use blocking connection to wait for user to click a button
1438 bool invoked = QMetaObject::invokeMethod(gui, "message",
1439 modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,
1440 Q_ARG(QString, QString::fromStdString(caption)),
1441 Q_ARG(QString, QString::fromStdString(message.translated)),
1442 Q_ARG(unsigned int, style),
1443 Q_ARG(bool*, &ret),
1444 Q_ARG(QString, detailed_message));
1445 assert(invoked);
1446 return ret;
1447}
1448
1449void BitcoinGUI::subscribeToCoreSignals()
1450{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected