From e9df7f87574b32d70aec2dad5f8d84a68c618dee Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sat, 24 May 2014 11:12:47 -0400 Subject: Qt: Fix monospace font in osx 10.9 The "Monospace" hint was added in Qt 4.8, and it works as intended as opposed to "TypeWriter" which fails to load a font. --- src/qt/guiutil.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 7b264d27c..49c086745 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -76,7 +76,11 @@ QString dateTimeStr(qint64 nTime) QFont bitcoinAddressFont() { QFont font("Monospace"); +#if QT_VERSION >= 0x040800 + font.setStyleHint(QFont::Monospace); +#else font.setStyleHint(QFont::TypeWriter); +#endif return font; } -- cgit v1.2.3 From 066d9a53c79db63b019e38be7995440f9fcfe7ff Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Thu, 29 May 2014 05:21:58 +0200 Subject: [Qt] Fix Start bitcoin on system login --- src/qt/guiutil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 49c086745..183fcac4a 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -574,7 +574,7 @@ bool SetStartOnSystemStartup(bool fAutoStart) return true; } -#elif defined(LINUX) +#elif defined(Q_OS_LINUX) // Follow the Desktop Application Autostart Spec: // http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html -- cgit v1.2.3 From 65f78a111ff52c2212cc0a423662e7a41d1206dd Mon Sep 17 00:00:00 2001 From: Ashley Holman Date: Fri, 23 May 2014 12:09:59 -0500 Subject: Qt: Add GUI view of peer information. #4133 --- src/qt/guiutil.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 7b264d27c..851c0130e 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -11,6 +11,7 @@ #include "core.h" #include "init.h" +#include "protocol.h" #include "util.h" #ifdef WIN32 @@ -750,4 +751,51 @@ QString boostPathToQString(const boost::filesystem::path &path) } #endif +QString formatDurationStr(int secs) +{ + QStringList strList; + int days = secs / 86400; + int hours = (secs % 86400) / 3600; + int mins = (secs % 3600) / 60; + int seconds = secs % 60; + + if (days) + strList.append(QString(QObject::tr("%1 d")).arg(days)); + if (hours) + strList.append(QString(QObject::tr("%1 h")).arg(hours)); + if (mins) + strList.append(QString(QObject::tr("%1 m")).arg(mins)); + if (seconds || (!days && !hours && !mins)) + strList.append(QString(QObject::tr("%1 s")).arg(seconds)); + + return strList.join(" "); +} + +QString formatServicesStr(uint64_t mask) +{ + QStringList strList; + + // Just scan the last 8 bits for now. + for (int i=0; i < 8; i++) { + uint64_t check = 1 << i; + if (mask & check) + { + switch (check) + { + case NODE_NETWORK: + strList.append(QObject::tr("NETWORK")); + break; + default: + strList.append(QString("%1[%2]").arg(QObject::tr("UNKNOWN")).arg(check)); + } + } + } + + if (strList.size()) + return strList.join(" & "); + else + return QObject::tr("None"); + +} + } // namespace GUIUtil -- cgit v1.2.3 From bbe1925ce3e627fd405d83e3c947e1f430a1d720 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 3 Jun 2014 14:42:20 +0200 Subject: [Qt] style police and small addition in rpcconsole - fix spaces, indentation and coding style glitches --- src/qt/guiutil.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 62db0487f..1922d228c 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -780,7 +780,7 @@ QString formatServicesStr(uint64_t mask) QStringList strList; // Just scan the last 8 bits for now. - for (int i=0; i < 8; i++) { + for (int i = 0; i < 8; i++) { uint64_t check = 1 << i; if (mask & check) { @@ -799,7 +799,6 @@ QString formatServicesStr(uint64_t mask) return strList.join(" & "); else return QObject::tr("None"); - } } // namespace GUIUtil -- cgit v1.2.3 From c6cb21d17ab8097b6a425d37e48c955fbb0e9f0c Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 10 Apr 2014 14:14:18 -0400 Subject: Type-safe CFeeRate class Use CFeeRate instead of an int64_t for quantities that are fee-per-size. Helps prevent unit-conversion mismatches between the wallet, relaying, and mining code. --- src/qt/guiutil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 1922d228c..4fe98251d 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -210,7 +210,7 @@ bool isDust(const QString& address, qint64 amount) CTxDestination dest = CBitcoinAddress(address.toStdString()).Get(); CScript script; script.SetDestination(dest); CTxOut txOut(amount, script); - return txOut.IsDust(CTransaction::nMinRelayTxFee); + return txOut.IsDust(CTransaction::minRelayTxFee); } QString HtmlEscape(const QString& str, bool fMultiLine) -- cgit v1.2.3 From 6a5c124b849ac1e9e5cfb99e72ae483eeb3e8cad Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 21 May 2014 15:22:42 +0200 Subject: [Qt] don't allow translation of our example btc address --- src/qt/guiutil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 4fe98251d..81b905425 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -91,7 +91,9 @@ void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) widget->setFont(bitcoinAddressFont()); #if QT_VERSION >= 0x040700 - widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)")); + // We don't want translators to use own addresses in translations + // and this is the only place, where this address is supplied. + widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. %1)").arg("1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L")); #endif widget->setValidator(new BitcoinAddressEntryValidator(parent)); widget->setCheckValidator(new BitcoinAddressCheckValidator(parent)); -- cgit v1.2.3 From 13fc83c77bb9108c00dd7709ce17719edb763273 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 3 Jul 2014 14:25:32 -0400 Subject: Move fee policy out of core --- src/qt/guiutil.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 81b905425..60a131df7 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -11,6 +11,7 @@ #include "core.h" #include "init.h" +#include "main.h" #include "protocol.h" #include "util.h" @@ -212,7 +213,7 @@ bool isDust(const QString& address, qint64 amount) CTxDestination dest = CBitcoinAddress(address.toStdString()).Get(); CScript script; script.SetDestination(dest); CTxOut txOut(amount, script); - return txOut.IsDust(CTransaction::minRelayTxFee); + return txOut.IsDust(::minRelayTxFee); } QString HtmlEscape(const QString& str, bool fMultiLine) -- cgit v1.2.3