Changeset View
Changeset View
Standalone View
Standalone View
src/qt/guiutil.cpp
| // Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-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 "guiutil.h" | #include <qt/guiutil.h> | ||||
| #include "bitcoinaddressvalidator.h" | #include <base58.h> | ||||
| #include "bitcoinunits.h" | #include <cashaddr.h> | ||||
| #include "dstencode.h" | #include <chainparams.h> | ||||
| #include "qvalidatedlineedit.h" | #include <config.h> | ||||
| #include "walletmodel.h" | #include <dstencode.h> | ||||
| #include <fs.h> | |||||
| #include "cashaddr.h" | #include <interfaces/node.h> | ||||
| #include "config.h" | #include <policy/policy.h> | ||||
| #include "dstencode.h" | #include <primitives/transaction.h> | ||||
| #include "fs.h" | #include <protocol.h> | ||||
| #include "init.h" | #include <qt/bitcoinaddressvalidator.h> | ||||
| #include "policy/policy.h" | #include <qt/bitcoinunits.h> | ||||
| #include "primitives/transaction.h" | #include <qt/qvalidatedlineedit.h> | ||||
| #include "protocol.h" | #include <qt/walletmodel.h> | ||||
| #include "script/script.h" | #include <script/script.h> | ||||
| #include "script/standard.h" | #include <script/standard.h> | ||||
| #include "util.h" | #include <util.h> | ||||
| #include "utilstrencodings.h" | #include <utilstrencodings.h> | ||||
| #ifdef WIN32 | #ifdef WIN32 | ||||
| #ifdef _WIN32_WINNT | #ifdef _WIN32_WINNT | ||||
| #undef _WIN32_WINNT | #undef _WIN32_WINNT | ||||
| #endif | #endif | ||||
| #define _WIN32_WINNT 0x0501 | #define _WIN32_WINNT 0x0501 | ||||
| #ifdef _WIN32_IE | #ifdef _WIN32_IE | ||||
| #undef _WIN32_IE | #undef _WIN32_IE | ||||
| #endif | #endif | ||||
| #define _WIN32_IE 0x0501 | #define _WIN32_IE 0x0501 | ||||
| #define WIN32_LEAN_AND_MEAN 1 | #define WIN32_LEAN_AND_MEAN 1 | ||||
| #ifndef NOMINMAX | #ifndef NOMINMAX | ||||
| #define NOMINMAX | #define NOMINMAX | ||||
| #endif | #endif | ||||
| #include "shellapi.h" | #include <shellapi.h> | ||||
| #include "shlobj.h" | #include <shlobj.h> | ||||
| #include "shlwapi.h" | #include <shlwapi.h> | ||||
| #endif | #endif | ||||
| #include <boost/filesystem/detail/utf8_codecvt_facet.hpp> | #include <boost/filesystem/detail/utf8_codecvt_facet.hpp> | ||||
| #include <boost/filesystem/fstream.hpp> | #include <boost/filesystem/fstream.hpp> | ||||
| #include <boost/scoped_array.hpp> | #include <boost/scoped_array.hpp> | ||||
| #include <QAbstractItemView> | #include <QAbstractItemView> | ||||
| #include <QApplication> | #include <QApplication> | ||||
| ▲ Show 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | if (!info.message.isEmpty()) { | ||||
| ret += | ret += | ||||
| QString("%1message=%2").arg(paramCount == 0 ? "?" : "&").arg(msg); | QString("%1message=%2").arg(paramCount == 0 ? "?" : "&").arg(msg); | ||||
| paramCount++; | paramCount++; | ||||
| } | } | ||||
| return ret; | return ret; | ||||
| } | } | ||||
| bool isDust(const QString &address, const Amount amount, | bool isDust(interfaces::Node &node, const QString &address, const Amount amount, | ||||
| const CChainParams &chainParams) { | const CChainParams &chainParams) { | ||||
| CTxDestination dest = DecodeDestination(address.toStdString(), chainParams); | CTxDestination dest = DecodeDestination(address.toStdString(), chainParams); | ||||
| CScript script = GetScriptForDestination(dest); | CScript script = GetScriptForDestination(dest); | ||||
| CTxOut txOut(amount, script); | CTxOut txOut(amount, script); | ||||
| return txOut.IsDust(dustRelayFee); | return txOut.IsDust(node.getDustRelayFee()); | ||||
| } | } | ||||
| QString HtmlEscape(const QString &str, bool fMultiLine) { | QString HtmlEscape(const QString &str, bool fMultiLine) { | ||||
| QString escaped = str.toHtmlEscaped(); | QString escaped = str.toHtmlEscaped(); | ||||
| if (fMultiLine) { | if (fMultiLine) { | ||||
| escaped = escaped.replace("\n", "<br>\n"); | escaped = escaped.replace("\n", "<br>\n"); | ||||
| } | } | ||||
| return escaped; | return escaped; | ||||
| ▲ Show 20 Lines • Show All 724 Lines • Show Last 20 Lines | |||||