|
|
@ -25,8 +25,17 @@
|
|
|
|
#include <vector>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
|
|
|
|
#include <boost/signals2/signal.hpp>
|
|
|
|
#include <boost/thread/exceptions.hpp>
|
|
|
|
#include <boost/thread/exceptions.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 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 std::map<std::string, std::string> mapArgs;
|
|
|
|
extern std::map<std::string, std::string> mapArgs;
|
|
|
|
extern std::map<std::string, std::vector<std::string> > mapMultiArgs;
|
|
|
|
extern std::map<std::string, std::vector<std::string> > mapMultiArgs;
|
|
|
|
extern bool fDebug;
|
|
|
|
extern bool fDebug;
|
|
|
@ -37,6 +46,17 @@ extern std::string strMiscWarning;
|
|
|
|
extern bool fLogTimestamps;
|
|
|
|
extern bool fLogTimestamps;
|
|
|
|
extern bool fLogIPs;
|
|
|
|
extern bool fLogIPs;
|
|
|
|
extern volatile bool fReopenDebugLog;
|
|
|
|
extern volatile bool fReopenDebugLog;
|
|
|
|
|
|
|
|
extern CTranslationInterface translationInterface;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
inline std::string _(const char* psz)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
boost::optional<std::string> rv = translationInterface.Translate(psz);
|
|
|
|
|
|
|
|
return rv ? (*rv) : psz;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SetupEnvironment();
|
|
|
|
void SetupEnvironment();
|
|
|
|
|
|
|
|
|
|
|
|