Changeset View
Changeset View
Standalone View
Standalone View
src/ui_interface.cpp
// Copyright (c) 2010-2016 The Bitcoin Core developers | // Copyright (c) 2010-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util/translation.h> | |||||
#include <boost/signals2/last_value.hpp> | #include <boost/signals2/last_value.hpp> | ||||
#include <boost/signals2/signal.hpp> | #include <boost/signals2/signal.hpp> | ||||
CClientUIInterface uiInterface; | CClientUIInterface uiInterface; | ||||
struct UISignals { | struct UISignals { | ||||
boost::signals2::signal<CClientUIInterface::ThreadSafeMessageBoxSig, | boost::signals2::signal<CClientUIInterface::ThreadSafeMessageBoxSig, | ||||
boost::signals2::last_value<bool>> | boost::signals2::last_value<bool>> | ||||
Show All 30 Lines | |||||
ADD_SIGNALS_IMPL_WRAPPER(NotifyNumConnectionsChanged); | ADD_SIGNALS_IMPL_WRAPPER(NotifyNumConnectionsChanged); | ||||
ADD_SIGNALS_IMPL_WRAPPER(NotifyNetworkActiveChanged); | ADD_SIGNALS_IMPL_WRAPPER(NotifyNetworkActiveChanged); | ||||
ADD_SIGNALS_IMPL_WRAPPER(NotifyAlertChanged); | ADD_SIGNALS_IMPL_WRAPPER(NotifyAlertChanged); | ||||
ADD_SIGNALS_IMPL_WRAPPER(ShowProgress); | ADD_SIGNALS_IMPL_WRAPPER(ShowProgress); | ||||
ADD_SIGNALS_IMPL_WRAPPER(NotifyBlockTip); | ADD_SIGNALS_IMPL_WRAPPER(NotifyBlockTip); | ||||
ADD_SIGNALS_IMPL_WRAPPER(NotifyHeaderTip); | ADD_SIGNALS_IMPL_WRAPPER(NotifyHeaderTip); | ||||
ADD_SIGNALS_IMPL_WRAPPER(BannedListChanged); | ADD_SIGNALS_IMPL_WRAPPER(BannedListChanged); | ||||
bool CClientUIInterface::ThreadSafeMessageBox(const std::string &message, | bool CClientUIInterface::ThreadSafeMessageBox(const bilingual_str &message, | ||||
const std::string &caption, | const std::string &caption, | ||||
unsigned int style) { | unsigned int style) { | ||||
return g_ui_signals.ThreadSafeMessageBox(message, caption, style); | return g_ui_signals.ThreadSafeMessageBox(message, caption, style); | ||||
} | } | ||||
bool CClientUIInterface::ThreadSafeQuestion( | bool CClientUIInterface::ThreadSafeQuestion( | ||||
const std::string &message, const std::string &non_interactive_message, | const bilingual_str &message, const std::string &non_interactive_message, | ||||
const std::string &caption, unsigned int style) { | const std::string &caption, unsigned int style) { | ||||
return g_ui_signals.ThreadSafeQuestion(message, non_interactive_message, | return g_ui_signals.ThreadSafeQuestion(message, non_interactive_message, | ||||
caption, style); | caption, style); | ||||
} | } | ||||
void CClientUIInterface::InitMessage(const std::string &message) { | void CClientUIInterface::InitMessage(const std::string &message) { | ||||
return g_ui_signals.InitMessage(message); | return g_ui_signals.InitMessage(message); | ||||
} | } | ||||
void CClientUIInterface::NotifyNumConnectionsChanged(int newNumConnections) { | void CClientUIInterface::NotifyNumConnectionsChanged(int newNumConnections) { | ||||
Show All 15 Lines | |||||
void CClientUIInterface::NotifyHeaderTip(bool b, const CBlockIndex *i) { | void CClientUIInterface::NotifyHeaderTip(bool b, const CBlockIndex *i) { | ||||
return g_ui_signals.NotifyHeaderTip(b, i); | return g_ui_signals.NotifyHeaderTip(b, i); | ||||
} | } | ||||
void CClientUIInterface::BannedListChanged() { | void CClientUIInterface::BannedListChanged() { | ||||
return g_ui_signals.BannedListChanged(); | return g_ui_signals.BannedListChanged(); | ||||
} | } | ||||
bool InitError(const std::string &str) { | bool InitError(const std::string &str) { | ||||
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR); | uiInterface.ThreadSafeMessageBox(Untranslated(str), "", | ||||
CClientUIInterface::MSG_ERROR); | |||||
return false; | return false; | ||||
} | } | ||||
void InitWarning(const std::string &str) { | void InitWarning(const std::string &str) { | ||||
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING); | uiInterface.ThreadSafeMessageBox(Untranslated(str), "", | ||||
CClientUIInterface::MSG_WARNING); | |||||
} | } |