refactor: [gui] Document that the title is always empty for node message
This refactor does not change any behavior.
This commit is contained in:
1 file changed
+7
-4
@@ -1587,7 +1587,7 @@ void BitcoinGUI::showModalOverlay()
|
|||||||
modalOverlay->toggleVisibility();
|
modalOverlay->toggleVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ThreadSafeMessageBox(BitcoinGUI* gui, const bilingual_str& message, const std::string& caption, unsigned int style)
|
static bool ThreadSafeMessageBox(BitcoinGUI* gui, const bilingual_str& message, unsigned int style)
|
||||||
{
|
{
|
||||||
bool modal = (style & CClientUIInterface::MODAL);
|
bool modal = (style & CClientUIInterface::MODAL);
|
||||||
// The SECURE flag has no effect in the Qt GUI.
|
// The SECURE flag has no effect in the Qt GUI.
|
||||||
@@ -1599,11 +1599,14 @@ static bool ThreadSafeMessageBox(BitcoinGUI* gui, const bilingual_str& message,
|
|||||||
if (message.original != message.translated) {
|
if (message.original != message.translated) {
|
||||||
detailed_message = BitcoinGUI::tr("Original message:") + "\n" + QString::fromStdString(message.original);
|
detailed_message = BitcoinGUI::tr("Original message:") + "\n" + QString::fromStdString(message.original);
|
||||||
}
|
}
|
||||||
|
// The title is empty for node messages. The fallback title is usually set
|
||||||
|
// by `style`.
|
||||||
|
const QString title{};
|
||||||
|
|
||||||
// In case of modal message, use blocking connection to wait for user to click a button
|
// In case of modal message, use blocking connection to wait for user to click a button
|
||||||
bool invoked = QMetaObject::invokeMethod(gui, "message",
|
bool invoked = QMetaObject::invokeMethod(gui, "message",
|
||||||
modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,
|
modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,
|
||||||
Q_ARG(QString, QString::fromStdString(caption)),
|
Q_ARG(QString, title),
|
||||||
Q_ARG(QString, QString::fromStdString(message.translated)),
|
Q_ARG(QString, QString::fromStdString(message.translated)),
|
||||||
Q_ARG(unsigned int, style),
|
Q_ARG(unsigned int, style),
|
||||||
Q_ARG(bool*, &ret),
|
Q_ARG(bool*, &ret),
|
||||||
@@ -1616,10 +1619,10 @@ void BitcoinGUI::subscribeToCoreSignals()
|
|||||||
{
|
{
|
||||||
// Connect signals to client
|
// Connect signals to client
|
||||||
m_handler_message_box = m_node.handleMessageBox([this](const bilingual_str& message, unsigned int style) {
|
m_handler_message_box = m_node.handleMessageBox([this](const bilingual_str& message, unsigned int style) {
|
||||||
return ThreadSafeMessageBox(this, message, /*caption=*/"", style);
|
return ThreadSafeMessageBox(this, message, style);
|
||||||
});
|
});
|
||||||
m_handler_question = m_node.handleQuestion([this](const bilingual_str& message, const std::string& /*non_interactive_message*/, unsigned int style) {
|
m_handler_question = m_node.handleQuestion([this](const bilingual_str& message, const std::string& /*non_interactive_message*/, unsigned int style) {
|
||||||
return ThreadSafeMessageBox(this, message, /*caption=*/"", style);
|
return ThreadSafeMessageBox(this, message, style);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user