aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/util.h b/src/util.h
index 23b2a787e4..e93489c1ed 100644
--- a/src/util.h
+++ b/src/util.h
@@ -19,8 +19,8 @@
#include <logging.h>
#include <sync.h>
#include <tinyformat.h>
-#include <utiltime.h>
#include <utilmemory.h>
+#include <utiltime.h>
#include <atomic>
#include <exception>
@@ -31,33 +31,24 @@
#include <unordered_set>
#include <vector>
-#include <boost/signals2/signal.hpp>
#include <boost/thread/condition_variable.hpp> // for boost::thread_interrupted
// Application startup time (used for uptime calculation)
int64_t GetStartupTime();
-/** Signals for translation. */
-class CTranslationInterface
-{
-public:
- /** Translate a message to the native language of the user. */
- boost::signals2::signal<std::string (const char* psz)> Translate;
-};
-
-extern CTranslationInterface translationInterface;
-
extern const char * const BITCOIN_CONF_FILENAME;
extern const char * const BITCOIN_PID_FILENAME;
+/** Translate a message to the native language of the user. */
+const extern std::function<std::string(const char*)> G_TRANSLATION_FUN;
+
/**
- * Translation function: Call Translate signal on UI interface, which returns a boost::optional result.
- * If no translation slot is registered, nothing is returned, and simply return the input.
+ * Translation function.
+ * If no translation function is set, simply return the input.
*/
inline std::string _(const char* psz)
{
- boost::optional<std::string> rv = translationInterface.Translate(psz);
- return rv ? (*rv) : psz;
+ return G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz;
}
void SetupEnvironment();