Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show All 27 Lines | |||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
#include <qt/walletcontroller.h> | #include <qt/walletcontroller.h> | ||||
#include <qt/walletframe.h> | #include <qt/walletframe.h> | ||||
#include <qt/walletmodel.h> | #include <qt/walletmodel.h> | ||||
#include <qt/walletview.h> | #include <qt/walletview.h> | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/translation.h> | |||||
#include <QAction> | #include <QAction> | ||||
#include <QApplication> | #include <QApplication> | ||||
#include <QComboBox> | #include <QComboBox> | ||||
#include <QDateTime> | #include <QDateTime> | ||||
#include <QDragEnterEvent> | #include <QDragEnterEvent> | ||||
#include <QListWidget> | #include <QListWidget> | ||||
#include <QMenuBar> | #include <QMenuBar> | ||||
▲ Show 20 Lines • Show All 1,458 Lines • ▼ Show 20 Lines | |||||
void BitcoinGUI::showModalOverlay() { | void BitcoinGUI::showModalOverlay() { | ||||
if (modalOverlay && | if (modalOverlay && | ||||
(progressBar->isVisible() || modalOverlay->isLayerVisible())) { | (progressBar->isVisible() || modalOverlay->isLayerVisible())) { | ||||
modalOverlay->toggleVisibility(); | modalOverlay->toggleVisibility(); | ||||
} | } | ||||
} | } | ||||
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string &message, | static bool ThreadSafeMessageBox(BitcoinGUI *gui, const bilingual_str &message, | ||||
const std::string &caption, | const std::string &caption, | ||||
unsigned int style) { | 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. | ||||
// bool secure = (style & CClientUIInterface::SECURE); | // bool secure = (style & CClientUIInterface::SECURE); | ||||
style &= ~CClientUIInterface::SECURE; | style &= ~CClientUIInterface::SECURE; | ||||
bool ret = false; | bool ret = false; | ||||
// This is original message, in English, for googling and referencing. | |||||
QString detailed_message; | |||||
if (message.original != message.translated) { | |||||
detailed_message = BitcoinGUI::tr("Original message:") + "\n" + | |||||
QString::fromStdString(message.original); | |||||
} | |||||
// In case of modal message, use blocking connection to wait for user to | // In case of modal message, use blocking connection to wait for user to | ||||
// click a button | // click a button | ||||
bool invoked = QMetaObject::invokeMethod( | bool invoked = QMetaObject::invokeMethod( | ||||
gui, "message", | gui, "message", | ||||
modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection, | modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection, | ||||
Q_ARG(QString, QString::fromStdString(caption)), | Q_ARG(QString, QString::fromStdString(caption)), | ||||
Q_ARG(QString, QString::fromStdString(message)), | Q_ARG(QString, QString::fromStdString(message.translated)), | ||||
Q_ARG(unsigned int, style), Q_ARG(bool *, &ret)); | Q_ARG(unsigned int, style), Q_ARG(bool *, &ret), | ||||
Q_ARG(QString, detailed_message)); | |||||
assert(invoked); | assert(invoked); | ||||
return ret; | return ret; | ||||
} | } | ||||
void BitcoinGUI::subscribeToCoreSignals() { | void BitcoinGUI::subscribeToCoreSignals() { | ||||
// Connect signals to client | // Connect signals to client | ||||
m_handler_message_box = m_node.handleMessageBox( | m_handler_message_box = m_node.handleMessageBox( | ||||
std::bind(ThreadSafeMessageBox, this, std::placeholders::_1, | std::bind(ThreadSafeMessageBox, this, std::placeholders::_1, | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |