From 5350ea4171be69d16a94e6f40c5e7fa41e00ac13 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 5 Nov 2012 08:04:21 +0100 Subject: update CClientUIInterface and remove orphan Wx stuff - fix ThreadSafeMessageBox always displays error icon - allow to specify MSG_ERROR / MSG_WARNING or MSG_INFORMATION without a custom caption / title - allow to specify CClientUIInterface::ICON_ERROR / ICON_WARNING and ICON_INFORMATION (which is default) as message box icon - remove CClientUIInterface::OK from ThreadSafeMessageBox-calls, as the OK button will be set as default, if none is specified - prepend "Bitcoin - " to used captions - rename BitcoinGUI::error() -> BitcoinGUI::message() and add function documentation - change all style parameters and enum flags to unsigned - update code to use that new API - update Client- and WalletModel to use new BitcoinGUI::message() and rename the classes error() method into message() - include the possibility to supply the wanted icon for messages from Client- and WalletModel via "style" parameter --- src/qt/bitcoin.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/qt/bitcoin.cpp') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index cd1764a53f..d64114e131 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -7,7 +7,6 @@ #include "optionsmodel.h" #include "guiutil.h" #include "guiconstants.h" - #include "init.h" #include "ui_interface.h" #include "qtipcserver.h" @@ -35,18 +34,19 @@ Q_IMPORT_PLUGIN(qtaccessiblewidgets) static BitcoinGUI *guiref; static QSplashScreen *splashref; -static void ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style) +static void ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) { // Message from network thread if(guiref) { bool modal = (style & CClientUIInterface::MODAL); - // in case of modal message, use blocking connection to wait for user to click OK - QMetaObject::invokeMethod(guiref, "error", + // In case of modal message, use blocking connection to wait for user to click a button + QMetaObject::invokeMethod(guiref, "message", modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(caption)), Q_ARG(QString, QString::fromStdString(message)), - Q_ARG(bool, modal)); + Q_ARG(bool, modal), + Q_ARG(unsigned int, style)); } else { -- cgit v1.2.3