aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-01-18 10:36:51 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-01-18 10:36:57 +0100
commit1709cc5cb0e5ba8f07b368e145f5eebcda118f50 (patch)
tree4cd3955d915efc271d172d60e62beef31f519b4a /src/qt
parentb0cb0556737b8022c0536272f2a5b4cb165ac676 (diff)
parentf17b00b66fb88d7d0324a40460fb23aaff818f68 (diff)
downloadbitcoin-1709cc5cb0e5ba8f07b368e145f5eebcda118f50.tar.xz
Merge pull request #7338
f17b00b release-notes: Combine NOP2->CLTV asm change into "RPC: Low-level API changes" section (Luke Dashjr) e20704b Replace some instances of formatWithUnit with formatHtmlWithUnit (fanquake) 6f8346d qt5: Use the fixed font the system recommends (MarcoFalke) 605de4a Rename OP_NOP2 to OP_CHECKLOCKTIMEVERIFY. (mb300sd) 6191a9b [RPC-Tests] add option to run rpc test over QT clients (Jonas Schnelli) 6307beb Note that reviewers should mention the commit hash of the commits they reviewed. (Patrick Strateman) 6092ff2 Set link from http:// to https:// (Suriyaa Kudo)
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/bitcoinunits.cpp7
-rw-r--r--src/qt/bitcoinunits.h1
-rw-r--r--src/qt/coincontroldialog.cpp6
-rw-r--r--src/qt/guiutil.cpp8
-rw-r--r--src/qt/receiverequestdialog.cpp2
5 files changed, 13 insertions, 11 deletions
diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp
index de5799130b..6490057897 100644
--- a/src/qt/bitcoinunits.cpp
+++ b/src/qt/bitcoinunits.cpp
@@ -111,13 +111,6 @@ QString BitcoinUnits::format(int unit, const CAmount& nIn, bool fPlus, Separator
}
-// TODO: Review all remaining calls to BitcoinUnits::formatWithUnit to
-// TODO: determine whether the output is used in a plain text context
-// TODO: or an HTML context (and replace with
-// TODO: BtcoinUnits::formatHtmlWithUnit in the latter case). Hopefully
-// TODO: there aren't instances where the result could be used in
-// TODO: either context.
-
// NOTE: Using formatWithUnit in an HTML context risks wrapping
// quantities at the thousands separator. More subtly, it also results
// in a standard space rather than a thin space, due to a bug in Qt's
diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h
index 252942e47b..fda067b0b8 100644
--- a/src/qt/bitcoinunits.h
+++ b/src/qt/bitcoinunits.h
@@ -88,6 +88,7 @@ public:
static QString format(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
//! Format as string (with unit)
static QString formatWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
+ //! Format as HTML string (with unit)
static QString formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
//! Parse string to coin amount
static bool parse(int unit, const QString &value, CAmount *val_out);
diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp
index 63e9043294..e6738694a8 100644
--- a/src/qt/coincontroldialog.cpp
+++ b/src/qt/coincontroldialog.cpp
@@ -637,14 +637,14 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
// tool tips
QString toolTip1 = tr("This label turns red if the transaction size is greater than 1000 bytes.") + "<br /><br />";
- toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CWallet::GetRequiredFee(1000))) + "<br /><br />";
+ toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, CWallet::GetRequiredFee(1000))) + "<br /><br />";
toolTip1 += tr("Can vary +/- 1 byte per input.");
QString toolTip2 = tr("Transactions with higher priority are more likely to get included into a block.") + "<br /><br />";
toolTip2 += tr("This label turns red if the priority is smaller than \"medium\".") + "<br /><br />";
- toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CWallet::GetRequiredFee(1000)));
+ toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, CWallet::GetRequiredFee(1000)));
- QString toolTip3 = tr("This label turns red if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, ::minRelayTxFee.GetFee(546)));
+ QString toolTip3 = tr("This label turns red if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, ::minRelayTxFee.GetFee(546)));
// how many satoshis the estimated fee can vary per byte we guess wrong
double dFeeVary;
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 6cb4e3bd1b..ee2744f126 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -62,6 +62,10 @@
#include <QUrlQuery>
#endif
+#if QT_VERSION >= 0x50200
+#include <QFontDatabase>
+#endif
+
#if BOOST_FILESYSTEM_VERSION >= 3
static boost::filesystem::detail::utf8_codecvt_facet utf8;
#endif
@@ -90,6 +94,9 @@ QString dateTimeStr(qint64 nTime)
QFont fixedPitchFont()
{
+#if QT_VERSION >= 0x50200
+ return QFontDatabase::systemFont(QFontDatabase::FixedFont);
+#else
QFont font("Monospace");
#if QT_VERSION >= 0x040800
font.setStyleHint(QFont::Monospace);
@@ -97,6 +104,7 @@ QFont fixedPitchFont()
font.setStyleHint(QFont::TypeWriter);
#endif
return font;
+#endif
}
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp
index 0c4a20cf92..75108e0a10 100644
--- a/src/qt/receiverequestdialog.cpp
+++ b/src/qt/receiverequestdialog.cpp
@@ -144,7 +144,7 @@ void ReceiveRequestDialog::update()
html += "<a href=\""+uri+"\">" + GUIUtil::HtmlEscape(uri) + "</a><br>";
html += "<b>"+tr("Address")+"</b>: " + GUIUtil::HtmlEscape(info.address) + "<br>";
if(info.amount)
- html += "<b>"+tr("Amount")+"</b>: " + BitcoinUnits::formatWithUnit(model->getDisplayUnit(), info.amount) + "<br>";
+ html += "<b>"+tr("Amount")+"</b>: " + BitcoinUnits::formatHtmlWithUnit(model->getDisplayUnit(), info.amount) + "<br>";
if(!info.label.isEmpty())
html += "<b>"+tr("Label")+"</b>: " + GUIUtil::HtmlEscape(info.label) + "<br>";
if(!info.message.isEmpty())