Line data Source code
1 : // Copyright (c) 2020-2021 The PIVX Core developers 2 : // Distributed under the MIT/X11 software license, see the accompanying 3 : // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 : 5 : #ifndef PIVX_GUIINTERFACEUTIL_H 6 : #define PIVX_GUIINTERFACEUTIL_H 7 : 8 : #include "guiinterface.h" 9 : #include "tinyformat.h" 10 : #include "util/system.h" 11 : 12 29 : inline static bool UIError(const std::string &str) 13 : { 14 29 : uiInterface.ThreadSafeMessageBox(str, "Error", CClientUIInterface::MSG_ERROR); 15 29 : return false; 16 : } 17 : 18 0 : inline static bool UIWarning(const std::string &str) 19 : { 20 0 : uiInterface.ThreadSafeMessageBox(str, "Warning", CClientUIInterface::MSG_WARNING); 21 0 : return true; 22 : } 23 : 24 0 : inline static std::string AmountErrMsg(const char * const optname, const std::string& strValue) 25 : { 26 0 : return strprintf(_("Invalid amount for -%s=<amount>: '%s'"), optname, strValue); 27 : } 28 : 29 : #endif // PIVX_GUIINTERFACEUTIL_H