From a99004912e61cbd3d499677251fbef4a8cf4559d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 9 Dec 2015 10:47:56 +0100 Subject: [PATCH 01/11] Merge pull request #7154 a3c3ddb [Qt] add InMempool() info to transaction details (Jonas Schnelli) --- src/qt/transactiondesc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 55e05d4ad7080..b8d21851e57a6 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -44,6 +44,8 @@ QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) if (fOffline) { strTxStatus = tr("%1/offline").arg(nDepth); + } else if (nDepth == 0) { + strTxStatus = tr("0/unconfirmed, %1").arg((wtx.InMempool() ? tr("in memory pool") : tr("not in memory pool"))); } else if (nDepth < 6) { strTxStatus = tr("%1/unconfirmed").arg(nDepth); } else { From 2a4beff0a8d03e88ba5b4dbae1ca0975cf8f4f39 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Tue, 22 Dec 2015 14:05:20 +0100 Subject: [PATCH 02/11] Merge pull request #7218 fa5769e [qt] Fix misleading translation (MarcoFalke) fa8c8d7 torcontrol debug: Change to a blanket message that covers both cases (MarcoFalke) --- src/qt/locale/dash_en.ts | 4 ++-- src/qt/utilitydialog.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qt/locale/dash_en.ts b/src/qt/locale/dash_en.ts index 2f124839aa24f..69b160770e105 100644 --- a/src/qt/locale/dash_en.ts +++ b/src/qt/locale/dash_en.ts @@ -1371,8 +1371,8 @@ - Reset all settings changes made over the GUI - Reset all settings changes made over the GUI + Reset all settings changed in the GUI + Reset all settings changed in the GUI diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index a93f4c6382600..4e4bf7c533b74 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -86,7 +86,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, HelpMode helpMode) : strUsage += HelpMessageOpt("-min", tr("Start minimized").toStdString()); strUsage += HelpMessageOpt("-rootcertificates=", tr("Set SSL root certificates for payment request (default: -system-)").toStdString()); strUsage += HelpMessageOpt("-splash", strprintf(tr("Show splash screen on startup (default: %u)").toStdString(), DEFAULT_SPLASHSCREEN)); - strUsage += HelpMessageOpt("-resetguisettings", tr("Reset all settings changes made over the GUI").toStdString()); + strUsage += HelpMessageOpt("-resetguisettings", tr("Reset all settings changed in the GUI").toStdString()); if (showDebug) { strUsage += HelpMessageOpt("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM)); } From 6c0cc6f53063f6949dd8574a2333de6beeb1c9f9 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Mon, 4 Jan 2016 09:23:03 +0100 Subject: [PATCH 03/11] Merge pull request #7255 6fd0a07 Remove hardcoded fee from CoinControl ToolTip (fanquake) 5fdf32d Replace some instances of formatWithUnit with formatHtmlWithUnit (fanquake) --- src/qt/coincontroldialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index cf6307024767b..1f7262ef74c9f 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -141,7 +141,7 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget ui->treeWidget->setColumnWidth(COLUMN_DATE, 80); ui->treeWidget->setColumnWidth(COLUMN_CONFIRMATIONS, 100); ui->treeWidget->setColumnWidth(COLUMN_PRIORITY, 100); - ui->treeWidget->setColumnHidden(COLUMN_TXHASH, true); // store transacton hash in this column, but don't show it + ui->treeWidget->setColumnHidden(COLUMN_TXHASH, true); // store transaction hash in this column, but don't show it ui->treeWidget->setColumnHidden(COLUMN_VOUT_INDEX, true); // store vout index in this column, but don't show it ui->treeWidget->setColumnHidden(COLUMN_AMOUNT_INT64, true); // store amount int64 in this column, but don't show it ui->treeWidget->setColumnHidden(COLUMN_PRIORITY_INT64, true); // store priority int64 in this column, but don't show it @@ -712,7 +712,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) toolTip2 += tr("This label turns red if the priority is smaller than \"medium\".") + "

"; 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::formatHtmlWithUnit(nDisplayUnit, ::minRelayTxFee.GetFee(546))); + QString toolTip3 = tr("This label turns red if any recipient receives an amount smaller than the current dust threshold."); // how many satoshis the estimated fee can vary per byte we guess wrong double dFeeVary; From 4021edc14c7ab5613e0fac79aa019931f4a3d193 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 4 Jan 2016 10:10:41 +0100 Subject: [PATCH 04/11] Merge pull request #7263 a5a0831 Double semicolon cleanup. (21E14) --- src/net.cpp | 2 +- src/qt/bantablemodel.cpp | 4 ++-- src/qt/guiutil.cpp | 2 +- src/qt/peertablemodel.cpp | 2 +- src/test/rpc_tests.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 5a3677f8d82e7..4bc3bfa1b4c32 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1447,7 +1447,7 @@ void ThreadMapPort() LogPrintf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", port, port, lanaddr, r, strupnperror(r)); else - LogPrintf("UPnP Port Mapping successful.\n");; + LogPrintf("UPnP Port Mapping successful.\n"); MilliSleep(20*60*1000); // Refresh every 20 minutes } diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index 06bb23ba28bfa..6e11e23904733 100644 --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -104,7 +104,7 @@ int BanTableModel::rowCount(const QModelIndex &parent) const int BanTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); - return columns.length();; + return columns.length(); } QVariant BanTableModel::data(const QModelIndex &index, int role) const @@ -179,4 +179,4 @@ bool BanTableModel::shouldShow() if (priv->size() > 0) return true; return false; -} \ No newline at end of file +} diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index afc0c5da230a4..f8d67fe6a2c62 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -235,7 +235,7 @@ QString formatBitcoinURI(const SendCoinsRecipient &info) if (!info.message.isEmpty()) { - QString msg(QUrl::toPercentEncoding(info.message));; + QString msg(QUrl::toPercentEncoding(info.message)); ret += QString("%1message=%2").arg(paramCount == 0 ? "?" : "&").arg(msg); paramCount++; } diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 90899347fd8a2..d1a8e384d9891 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -147,7 +147,7 @@ int PeerTableModel::rowCount(const QModelIndex &parent) const int PeerTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); - return columns.length();; + return columns.length(); } QVariant PeerTableModel::data(const QModelIndex &index, int role) const diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index 56ce1d3c7a3e5..fb407fb458dd9 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -236,7 +236,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban) UniValue o1 = ar[0].get_obj(); UniValue adr = find_value(o1, "address"); BOOST_CHECK_EQUAL(adr.get_str(), "127.0.0.0/32"); - BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0 remove")));; + BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0 remove"))); BOOST_CHECK_NO_THROW(r = CallRPC(string("listbanned"))); ar = r.get_array(); BOOST_CHECK_EQUAL(ar.size(), 0); @@ -266,7 +266,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban) // must throw an exception because 127.0.0.1 is in already banned suubnet range BOOST_CHECK_THROW(r = CallRPC(string("setban 127.0.0.1 add")), runtime_error); - BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0/24 remove")));; + BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0/24 remove"))); BOOST_CHECK_NO_THROW(r = CallRPC(string("listbanned"))); ar = r.get_array(); BOOST_CHECK_EQUAL(ar.size(), 0); From 1f7b032d964fcdd9f3bafcbeeefa0074725bc559 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 14 Jan 2016 13:56:55 +0100 Subject: [PATCH 05/11] Merge pull request #7334 fa989fb [qt] coincontrol workaround is still needed in qt5.4 (fixed in qt5.5) (MarcoFalke) --- src/qt/coincontroldialog.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 1f7262ef74c9f..adb4522d032fa 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -464,10 +464,8 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column) CoinControlDialog::updateLabels(model, this); } - // todo: this is a temporary qt5 fix: when clicking a parent node in tree mode, the parent node - // including all children are partially selected. But the parent node should be fully selected - // as well as the children. Children should never be partially selected in the first place. - // Please remove this ugly fix, once the bug is solved upstream. + // TODO: Remove this temporary qt5 fix after Qt5.3 and Qt5.4 are no longer used. + // Fixed in Qt5.5 and above: https://bugreports.qt.io/browse/QTBUG-43473 #if QT_VERSION >= 0x050000 else if (column == COLUMN_CHECKBOX && item->childCount() > 0) { From 0709ada82471a89ede43f22e10216d075e6ec58c Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 18 Jan 2016 10:41:27 +0100 Subject: [PATCH 06/11] Merge pull request #7329 9d263bd Typo fixes in comments (Chris Wheeler) --- qa/rpc-tests/merkle_blocks.py | 2 +- src/net.cpp | 2 +- src/netbase.cpp | 2 +- src/policy/fees.cpp | 2 +- src/policy/fees.h | 6 +++--- src/qt/clientmodel.cpp | 2 +- src/qt/sendcoinsdialog.cpp | 2 +- src/test/merkle_tests.cpp | 2 +- src/torcontrol.cpp | 2 +- src/wallet/rpcwallet.cpp | 2 +- src/wallet/wallet_ismine.h | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/qa/rpc-tests/merkle_blocks.py b/qa/rpc-tests/merkle_blocks.py index a52e50675acd6..a11608777d64d 100755 --- a/qa/rpc-tests/merkle_blocks.py +++ b/qa/rpc-tests/merkle_blocks.py @@ -70,7 +70,7 @@ def run_test(self): txid_spent = txin_spent["txid"] txid_unspent = txid1 if txin_spent["txid"] != txid1 else txid2 - # We cant find the block from a fully-spent tx + # We can't find the block from a fully-spent tx # Doesn't apply to Dash Core - we have txindex always on # assert_raises(JSONRPCException, self.nodes[2].gettxoutproof, [txid_spent]) # ...but we can if we specify the block diff --git a/src/net.cpp b/src/net.cpp index 4bc3bfa1b4c32..90e794b69f21a 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2572,7 +2572,7 @@ bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit) if (historicalBlockServingLimit) { - // keep a large enought buffer to at least relay each block once + // keep a large enough buffer to at least relay each block once uint64_t timeLeftInCycle = GetMaxOutboundTimeLeftInCycle(); uint64_t buffer = timeLeftInCycle / 600 * MAX_BLOCK_SIZE; if (buffer >= nMaxOutboundLimit || nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit - buffer) diff --git a/src/netbase.cpp b/src/netbase.cpp index cfd93eb2b3ebc..3cec7857b8aa6 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -133,7 +133,7 @@ bool static LookupIntern(const char *pszName, std::vector& vIP, unsign return false; do { - // Should set the timeout limit to a resonable value to avoid + // Should set the timeout limit to a reasonable value to avoid // generating unnecessary checking call during the polling loop, // while it can still response to stop request quick enough. // 2 seconds looks fine in our situation. diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 98782d41e2bc6..332a4ac5b9b02 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -87,7 +87,7 @@ double TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal, int maxbucketindex = buckets.size() - 1; // requireGreater means we are looking for the lowest fee/priority such that all higher - // values pass, so we start at maxbucketindex (highest fee) and look at succesively + // values pass, so we start at maxbucketindex (highest fee) and look at successively // smaller buckets until we reach failure. Otherwise, we are looking for the highest // fee/priority such that all lower values fail, and we go in the opposite direction. unsigned int startbucket = requireGreater ? maxbucketindex : 0; diff --git a/src/policy/fees.h b/src/policy/fees.h index f4a241575de21..db1887a7856bf 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -29,7 +29,7 @@ class CTxMemPool; * included in blocks before transactions of lower fee/priority. So for * example if you wanted to know what fee you should put on a transaction to * be included in a block within the next 5 blocks, you would start by looking - * at the bucket with with the highest fee transactions and verifying that a + * at the bucket with the highest fee transactions and verifying that a * sufficiently high percentage of them were confirmed within 5 blocks and * then you would look at the next highest fee bucket, and so on, stopping at * the last bucket to pass the test. The average fee of transactions in this @@ -87,13 +87,13 @@ class TxConfirmStats // Count the total # of txs in each bucket // Track the historical moving average of this total over blocks std::vector txCtAvg; - // and calcuate the total for the current block to update the moving average + // and calculate the total for the current block to update the moving average std::vector curBlockTxCt; // Count the total # of txs confirmed within Y blocks in each bucket // Track the historical moving average of theses totals over blocks std::vector > confAvg; // confAvg[Y][X] - // and calcuate the totals for the current block to update the moving averages + // and calculate the totals for the current block to update the moving averages std::vector > curBlockConf; // curBlockConf[Y][X] // Sum the total priority/fee of all tx's in each bucket diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index ded52e2d0bd7a..22e19bf499389 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -143,7 +143,7 @@ double ClientModel::getVerificationProgress(const CBlockIndex *tipIn) const void ClientModel::updateTimer() { // no locking required at this point - // the following calls will aquire the required lock + // the following calls will acquire the required lock Q_EMIT mempoolSizeChanged(getMempoolSize(), getMempoolDynamicUsage()); Q_EMIT bytesChanged(getTotalBytesRecv(), getTotalBytesSent()); } diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index bf6db8b5616f4..847fdb1cdef56 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -904,7 +904,7 @@ void SendCoinsDialog::coinControlUpdateLabels() if (model->getOptionsModel()->getCoinControlFeatures()) { - // enable minium absolute fee UI controls + // enable minimum absolute fee UI controls ui->radioCustomAtLeast->setVisible(true); // only enable the feature if inputs are selected diff --git a/src/test/merkle_tests.cpp b/src/test/merkle_tests.cpp index 51e762093a675..e352dd7a913ef 100644 --- a/src/test/merkle_tests.cpp +++ b/src/test/merkle_tests.cpp @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(merkle_test) int duplicate2 = mutate >= 2 ? 1 << ctz(ntx1) : 0; // Likewise for the second mutation. if (duplicate2 >= ntx1) break; int ntx2 = ntx1 + duplicate2; - int duplicate3 = mutate >= 3 ? 1 << ctz(ntx2) : 0; // And for the the third mutation. + int duplicate3 = mutate >= 3 ? 1 << ctz(ntx2) : 0; // And for the third mutation. if (duplicate3 >= ntx2) break; int ntx3 = ntx2 + duplicate3; // Build a block with ntx different transactions. diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp index 01035c7bdded5..d10b3e00a1e49 100644 --- a/src/torcontrol.cpp +++ b/src/torcontrol.cpp @@ -304,7 +304,7 @@ static std::map ParseTorReplyMapping(const std::string /** Read full contents of a file and return them in a std::string. * Returns a pair . - * If an error occured, status will be false, otherwise status will be true and the data will be returned in string. + * If an error occurred, status will be false, otherwise status will be true and the data will be returned in string. * * @param maxsize Puts a maximum size limit on the file that is read. If the file is larger than this, truncated data * (with len > maxsize) will be returned. diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 44c3b0e790657..1e079be53c799 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1541,7 +1541,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp) " 'send' category of transactions.\n" " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n" " 'receive' category of transactions. Negative confirmations indicate the\n" - " transation conflicts with the block chain\n" + " transaction conflicts with the block chain\n" " \"bcconfirmations\": n, (numeric) The number of blockchain confirmations for the transaction. Available for 'send' and \n" " 'receive' category of transactions. Negative confirmations indicate the\n" " transation conflicts with the block chain\n" diff --git a/src/wallet/wallet_ismine.h b/src/wallet/wallet_ismine.h index 93cdf6ab8ff6d..51afd1b1402cb 100644 --- a/src/wallet/wallet_ismine.h +++ b/src/wallet/wallet_ismine.h @@ -17,7 +17,7 @@ class CScript; enum isminetype { ISMINE_NO = 0, - //! Indicates that we dont know how to create a scriptSig that would solve this if we were given the appropriate private keys + //! Indicates that we don't know how to create a scriptSig that would solve this if we were given the appropriate private keys ISMINE_WATCH_UNSOLVABLE = 1, //! Indicates that we know how to create a scriptSig that would solve this if we were given the appropriate private keys ISMINE_WATCH_SOLVABLE = 2, From f3a24c0a0e630d270fbefdd809b18b13fca32db1 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Thu, 28 Jan 2016 10:23:12 +0100 Subject: [PATCH 07/11] Merge #7396: [Qt] Add option to increase/decrease font size in the console window 43abb02 [Qt] Add a new chevron/arrow icon for the console prompt line (Jonas Schnelli) 56c9e66 [Qt] keep scroll position in GUI console after changing font size (Jonas Schnelli) 3a3a927 [Qt] Add option to increase/decrease font size in the console window (Jonas Schnelli) --- contrib/debian/copyright | 3 + src/Makefile.qt.include | 3 + src/qt/forms/debugwindow.ui | 159 +++++++++++++++++++++++++++---- src/qt/res/icons/chevron.png | Bin 0 -> 1923 bytes src/qt/res/icons/fontbigger.png | Bin 0 -> 1180 bytes src/qt/res/icons/fontsmaller.png | Bin 0 -> 951 bytes src/qt/rpcconsole.cpp | 60 +++++++++--- src/qt/rpcconsole.h | 4 + 8 files changed, 200 insertions(+), 29 deletions(-) create mode 100644 src/qt/res/icons/chevron.png create mode 100644 src/qt/res/icons/fontbigger.png create mode 100644 src/qt/res/icons/fontsmaller.png diff --git a/contrib/debian/copyright b/contrib/debian/copyright index bbaa5b1636698..c039a7bae5861 100644 --- a/contrib/debian/copyright +++ b/contrib/debian/copyright @@ -21,6 +21,7 @@ License: GPL-3+ Files: src/qt/res/icons/add.png src/qt/res/icons/address-book.png + src/qt/res/icons/chevron.png src/qt/res/icons/configure.png src/qt/res/icons/debugwindow.png src/qt/res/icons/edit.png @@ -56,6 +57,8 @@ Comment: Inspired by Stephan Hutchings Typicons Files: src/qt/res/icons/tx_mined.png src/qt/res/src/mine.svg + src/qt/res/icons/fontbigger.png + src/qt/res/icons/fontsmaller.png Copyright: Jonas Schnelli License: Expat Comment: diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 992aae2f27e60..364dce3da874a 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -167,6 +167,9 @@ BITCOIN_QT_H = \ RES_ICONS = \ qt/res/icons/bitcoin.ico \ qt/res/icons/bitcoin.png \ + qt/res/icons/chevron.png \ + qt/res/icons/fontbigger.png \ + qt/res/icons/fontsmaller.png \ qt/res/icons/drkblue/add.png \ qt/res/icons/drkblue/address-book.png \ qt/res/icons/drkblue/browse.png \ diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index ea9ac14ee2a85..f2275ac7ff5e4 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -438,6 +438,125 @@ 3 + + 5 + + + + + 4 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 24 + 24 + + + + + + + Decrease font size + + + + :/icons/fontsmaller:/icons/fontsmaller + + + + 24 + 16 + + + + false + + + true + + + + + + + + 24 + 24 + + + + Increase font size + + + + + + + :/icons/fontbigger:/icons/fontbigger + + + + 24 + 16 + + + + false + + + true + + + + + + + + 24 + 24 + + + + Clear console + + + Qt::LeftToRight + + + + + + + :/icons/remove:/icons/remove + + + Ctrl+L + + + false + + + true + + + + + @@ -458,44 +577,48 @@ - + 3 - - - > + + + false - - - - - - - - 24 + 16 24 - - Clear console - - :/icons/drkblue/remove:/icons/drkblue/remove + :/icons/prompticon + :/icons/prompticon:/icons/prompticon - - Ctrl+L + + + 14 + 14 + false + + true + + + + + + + + diff --git a/src/qt/res/icons/chevron.png b/src/qt/res/icons/chevron.png new file mode 100644 index 0000000000000000000000000000000000000000..ac985052c1527a9a687cc1acbb53f940a7df375b GIT binary patch literal 1923 zcmaJ?dr%YS77vlw@M@$)D2*d)C{}Fqf;>pZG$jdv6oLXlP(cmZg`|+|k}PKBC4z+O zwNItfiq)bPMQIUleV|lG=pAe&lwijxVp~?Y1!}p%?WAB4uHC5E`-iEtE1JiOSY&02HtV0t9RUOV5qr0U|M*C*X^DyjOr2E-#kD<8oreEFMq7 z7fEU}D)Rl5^`IO&iTF0tr|#^pzPQy~(C1=69gMGM14i>J830Hd(g z03(1x0j$yJ^hUGSj(!NxXe4U071f#bkXk8a5)^Es5tJxnxO@RWjxQI-iFmvOfmke8 zsZ;`Pypk)I^Mry$tP<9jm>@H{hz0+|3jPx7odpv@WL82J;|>T^Szr_Jux5$zDOzHM z3G!Hhis0kNK3&TrEcg^HkFmnP#BvBR9B*g;r_+lrVtl;YCv!^}PbMES6XR|n<~ls{ zR}XPrX4J}fEjBcHxIZ~Fo_=+FD5I@W7@9EB)5y*BWYkg%gMEX+v^?m%;r6!eEyDAL z%-%N`N@bU0^Pb)I4Pck>lHuq8ZJ&c$e|^pMZ+hvw|NOC{8AJwkf9Y!mU#(=2F>O{vc%kRxQ zih-^zOu}*o`InpVmsrjteie!dM@X18dRddUTLwE`X30ude6i1d3OG*BD#lut4A#PO zT5Wy9J(v5{I+J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64cFnL!OfBl$Gb~ns&az&eZ6bP#fHnk?aYA#fQ-QBaf_MbzP;i? z;Pb%sLV))KJ`Wrg0^9@03A~K#`|i{wftQhe-(8a?us-_+_>WwHydkhI`|dE!Xqkz1 zz#R;BQaFx^nOF#{Se^@*Zsg3wa$xBKdyQ#F%S=2HSh17QZv5k(|mO`G1V4On`yI>Z~A)vn#zfV-KsXKkBaOeXfszA@Xg zMVsEP1z4JWTf`rlHoadwurm8rNMmTW73E6@-p;r^TeRtFmFvMQ0<#FrA~1` #include #include +#include #include #include #include @@ -44,7 +45,8 @@ // TODO: receive errors and debug messages through ClientModel const int CONSOLE_HISTORY = 50; -const QSize ICON_SIZE(24, 24); +const QSize FONT_RANGE(4, 40); +const char fontSizeSettingsKey[] = "consoleFontSize"; const TrafficGraphData::GraphRange INITIAL_TRAFFIC_GRAPH_SETTING = TrafficGraphData::Range_30m; @@ -256,7 +258,8 @@ RPCConsole::RPCConsole(const PlatformStyle *platformStyle, QWidget *parent) : cachedNodeid(-1), platformStyle(platformStyle), peersTableContextMenu(0), - banTableContextMenu(0) + banTableContextMenu(0), + consoleFontSize(0) { ui->setupUi(this); GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); @@ -266,12 +269,16 @@ RPCConsole::RPCConsole(const PlatformStyle *platformStyle, QWidget *parent) : } // Needed on Mac also ui->clearButton->setIcon(QIcon(":/icons/" + theme + "/remove")); + ui->fontBiggerButton->setIcon(QIcon(":/icons/" + theme + "/fontbigger")); + ui->fontSmallerButton->setIcon(QIcon(":/icons/" + theme + "/fontsmaller")); // Install event filter for up and down arrow ui->lineEdit->installEventFilter(this); ui->messagesWidget->installEventFilter(this); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); + connect(ui->fontBiggerButton, SIGNAL(clicked()), this, SLOT(fontBigger())); + connect(ui->fontSmallerButton, SIGNAL(clicked()), this, SLOT(fontSmaller())); connect(ui->btnClearTrafficGraph, SIGNAL(clicked()), ui->trafficGraph, SLOT(clear())); // Wallet Repair Buttons @@ -303,6 +310,8 @@ RPCConsole::RPCConsole(const PlatformStyle *platformStyle, QWidget *parent) : ui->peerHeading->setText(tr("Select a peer to view detailed information.")); + QSettings settings; + consoleFontSize = settings.value(fontSizeSettingsKey, QFontInfo(QFont()).pointSize()).toInt(); clear(); } @@ -491,6 +500,41 @@ static QString categoryClass(int category) } } +void RPCConsole::fontBigger() +{ + setFontSize(consoleFontSize+1); +} + +void RPCConsole::fontSmaller() +{ + setFontSize(consoleFontSize-1); +} + +void RPCConsole::setFontSize(int newSize) +{ + QSettings settings; + + //don't allow a insane font size + if (newSize < FONT_RANGE.width() || newSize > FONT_RANGE.height()) + return; + + // temp. store the console content + QString str = ui->messagesWidget->toHtml(); + + // replace font tags size in current content + str.replace(QString("font-size:%1pt").arg(consoleFontSize), QString("font-size:%1pt").arg(newSize)); + + // store the new font size + consoleFontSize = newSize; + settings.setValue(fontSizeSettingsKey, consoleFontSize); + + // clear console (reset icon sizes, default stylesheet) and re-add the content + float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value(); + clear(); + ui->messagesWidget->setHtml(str); + ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum()); +} + /** Restart wallet with "-salvagewallet" */ void RPCConsole::walletSalvage() { @@ -568,26 +612,20 @@ void RPCConsole::clear() ui->messagesWidget->document()->addResource( QTextDocument::ImageResource, QUrl(ICON_MAPPING[i].url), - QImage(iconPath + iconName).scaled(ICON_SIZE, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + QImage(iconPath + iconName).scaled(QSize(consoleFontSize*2, consoleFontSize*2), Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); } // Set default style sheet QFontInfo fixedFontInfo(GUIUtil::fixedPitchFont()); - // Try to make fixed font adequately large on different OS -#ifdef WIN32 - QString ptSize = QString("%1pt").arg(QFontInfo(QFont()).pointSize() * 10 / 8); -#else - QString ptSize = QString("%1pt").arg(QFontInfo(QFont()).pointSize() * 8.5 / 9); -#endif ui->messagesWidget->document()->setDefaultStyleSheet( QString( "table { }" - "td.time { color: #808080; padding-top: 3px; } " + "td.time { color: #808080; font-size: %2; padding-top: 3px; } " "td.message { font-family: %1; font-size: %2; white-space:pre-wrap; } " "td.cmd-request { color: #006060; } " "td.cmd-error { color: red; } " "b { color: #006060; } " - ).arg(fixedFontInfo.family(), ptSize) + ).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize)) ); message(CMD_REPLY, (tr("Welcome to the Dash Core RPC console.") + "
" + diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 3f21ba0b9adf3..f6e73f7823d31 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -81,6 +81,9 @@ private Q_SLOTS: public Q_SLOTS: void clear(); + void fontBigger(); + void fontSmaller(); + void setFontSize(int newSize); /** Wallet repair options */ void walletSalvage(); @@ -152,6 +155,7 @@ public Q_SLOTS: RPCTimerInterface *rpcTimerInterface; QMenu *peersTableContextMenu; QMenu *banTableContextMenu; + int consoleFontSize; QCompleter *autoCompleter; }; From ad58bdc594a0e53812cafeb5efaba69e9e991e7b Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Mon, 4 Sep 2017 14:37:09 +0200 Subject: [PATCH 08/11] Copy/Move font size related icons into theme folders --- src/Makefile.qt.include | 12 +++++++++--- src/qt/dash.qrc | 9 +++++++++ src/qt/res/icons/{ => crownium}/fontbigger.png | Bin src/qt/res/icons/{ => crownium}/fontsmaller.png | Bin src/qt/res/icons/drkblue/fontbigger.png | Bin 0 -> 1180 bytes src/qt/res/icons/drkblue/fontsmaller.png | Bin 0 -> 951 bytes src/qt/res/icons/light/fontbigger.png | Bin 0 -> 1180 bytes src/qt/res/icons/light/fontsmaller.png | Bin 0 -> 951 bytes src/qt/res/icons/trad/fontbigger.png | Bin 0 -> 1180 bytes src/qt/res/icons/trad/fontsmaller.png | Bin 0 -> 951 bytes 10 files changed, 18 insertions(+), 3 deletions(-) rename src/qt/res/icons/{ => crownium}/fontbigger.png (100%) rename src/qt/res/icons/{ => crownium}/fontsmaller.png (100%) create mode 100644 src/qt/res/icons/drkblue/fontbigger.png create mode 100644 src/qt/res/icons/drkblue/fontsmaller.png create mode 100644 src/qt/res/icons/light/fontbigger.png create mode 100644 src/qt/res/icons/light/fontsmaller.png create mode 100644 src/qt/res/icons/trad/fontbigger.png create mode 100644 src/qt/res/icons/trad/fontsmaller.png diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 364dce3da874a..1408a2beac3e5 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -168,8 +168,6 @@ RES_ICONS = \ qt/res/icons/bitcoin.ico \ qt/res/icons/bitcoin.png \ qt/res/icons/chevron.png \ - qt/res/icons/fontbigger.png \ - qt/res/icons/fontsmaller.png \ qt/res/icons/drkblue/add.png \ qt/res/icons/drkblue/address-book.png \ qt/res/icons/drkblue/browse.png \ @@ -220,6 +218,8 @@ RES_ICONS = \ qt/res/icons/drkblue/about.png \ qt/res/icons/drkblue/about_qt.png \ qt/res/icons/drkblue/verify.png \ + qt/res/icons/drkblue/fontbigger.png \ + qt/res/icons/drkblue/fontsmaller.png \ qt/res/icons/crownium/add.png \ qt/res/icons/crownium/address-book.png \ qt/res/icons/crownium/browse.png \ @@ -270,6 +270,8 @@ RES_ICONS = \ qt/res/icons/crownium/about.png \ qt/res/icons/crownium/about_qt.png \ qt/res/icons/crownium/verify.png \ + qt/res/icons/crownium/fontbigger.png \ + qt/res/icons/crownium/fontsmaller.png \ qt/res/icons/light/add.png \ qt/res/icons/light/address-book.png \ qt/res/icons/light/browse.png \ @@ -320,6 +322,8 @@ RES_ICONS = \ qt/res/icons/light/about.png \ qt/res/icons/light/about_qt.png \ qt/res/icons/light/verify.png \ + qt/res/icons/light/fontbigger.png \ + qt/res/icons/light/fontsmaller.png \ qt/res/icons/trad/add.png \ qt/res/icons/trad/address-book.png \ qt/res/icons/trad/browse.png \ @@ -369,7 +373,9 @@ RES_ICONS = \ qt/res/icons/trad/tx_mined.png \ qt/res/icons/trad/about.png \ qt/res/icons/trad/about_qt.png \ - qt/res/icons/trad/verify.png + qt/res/icons/trad/verify.png \ + qt/res/icons/trad/fontbigger.png \ + qt/res/icons/trad/fontsmaller.png BITCOIN_QT_CPP = \ qt/bantablemodel.cpp \ diff --git a/src/qt/dash.qrc b/src/qt/dash.qrc index 29d6025c9e2f9..2ba93024c44e1 100644 --- a/src/qt/dash.qrc +++ b/src/qt/dash.qrc @@ -1,6 +1,7 @@ res/icons/bitcoin.png + res/icons/chevron.png res/icons/drkblue/address-book.png @@ -53,6 +54,8 @@ res/icons/drkblue/verify.png res/icons/drkblue/hd_enabled.png res/icons/drkblue/hd_disabled.png + res/icons/drkblue/fontbigger.png + res/icons/drkblue/fontsmaller.png res/icons/crownium/address-book.png @@ -105,6 +108,8 @@ res/icons/crownium/verify.png res/icons/crownium/hd_enabled.png res/icons/crownium/hd_disabled.png + res/icons/crownium/fontbigger.png + res/icons/crownium/fontsmaller.png res/icons/light/address-book.png @@ -157,6 +162,8 @@ res/icons/light/verify.png res/icons/light/hd_enabled.png res/icons/light/hd_disabled.png + res/icons/light/fontbigger.png + res/icons/light/fontsmaller.png res/icons/trad/address-book.png @@ -209,6 +216,8 @@ res/icons/trad/verify.png res/icons/trad/hd_enabled.png res/icons/trad/hd_disabled.png + res/icons/trad/fontbigger.png + res/icons/trad/fontsmaller.png res/css/drkblue.css diff --git a/src/qt/res/icons/fontbigger.png b/src/qt/res/icons/crownium/fontbigger.png similarity index 100% rename from src/qt/res/icons/fontbigger.png rename to src/qt/res/icons/crownium/fontbigger.png diff --git a/src/qt/res/icons/fontsmaller.png b/src/qt/res/icons/crownium/fontsmaller.png similarity index 100% rename from src/qt/res/icons/fontsmaller.png rename to src/qt/res/icons/crownium/fontsmaller.png diff --git a/src/qt/res/icons/drkblue/fontbigger.png b/src/qt/res/icons/drkblue/fontbigger.png new file mode 100644 index 0000000000000000000000000000000000000000..5ca5c563b25ecc2b90a064db3f86e02aa759bb66 GIT binary patch literal 1180 zcmV;N1Y`S&P)qpXJ000DINklA_IpxrUdgwZ&!Liq~JNrkPfg#{Xt6lxPqy2VvWi(9#@%Fmh1OY5AfW-x{xBwOp z5wHcT0W?JKn_gT1^8(Hc;5Gn80yu2IV?)3-fJ6X?2{GvJjqu>iIQICTJbWlb!A?Ex+v0j>nFAHX&7naZk( z1+X2!nSt!7IW@5WwgZ@=ea8l&U0V}7TD1ZIuK^4Jd{91ApBbBPz*Oy~*=NXy6j?4uJ0(b-aiX zaAx_r*&~)$cm%u+;H<5HDcX10$d?kPYma~v0H221V2`op}Ph3E*2B0aHOF z8a;wi?${IH7XXgi2)MKf;ekzTet8_oq@%V0PHl(L2R5)7{+R(k2QY0LVAkY-L6|N* z&18MlsN1<3aYq4|HN9srLZ7RNiEUg{J#LZjs=uE#>h%-An|tRh@-?4;soHndMeEe- z6o!CP0Podv^Oz3p0B{E2+R?Hj9lxH9 zTU-H7z%bLaz(zI(bDC}318@}(+?ihi*mDJ#Wv-YZOpghGhXKN!`Op<$mTV70GUGo@ ztl7qcfB_%40L+%JWeU@|0A3An0iLPJWky}ERZ56n4R9Us4OsZ>mqFI@#%B@2y&JuY zOj_RfaioB23lklcO6Z@ewBU&f|5E^;02~7Ntx=a-0AJL!=2Vq`4B)FO`%GQS?L-Io z_xo~tW;j*3qvntk09z_OxS^5^&y*jokZgFW&Rth!ZK|@j)wSGCRf2!NFSn1FlMPQ) zPu2naGPq;|-0b(|4%3OG3+FdFjU4XX78gdq8=9RUNWeu)08f~g?3~03xNZsH20)Jq z@K%(I?jqK{k4|06ve|ZM-$!%Ovhdwp`_|yMo&n^(Y+W(az9YCXs&pI4=Cgl|t%x@; za|AetWle0jE;^p=qXy}@8t%*_Oba`v4AmZ?B uBTVP=6Yt^zSX=;$3t({pEG~e%=6?Yavtd{5^U?hP0000qpXJ000AiNklI%MsuHY-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us-_+_>WwHydkhI`|dE!Xqkz1 zz#R;BQaFx^nOF#{Se^@*Zsg3wa$xBKdyQ#F%S=2HSh17QZv5k(|mO`G1V4On`yI>Z~A)vn#zfV-KsXKkBaOeXfszA@Xg zMVsEP1z4JWTf`rlHoadwurm8rNMmTW73E6@-p;r^TeRtFmFvMQ0<#FrA~1` Date: Tue, 8 Mar 2016 10:15:14 +0100 Subject: [PATCH 09/11] Merge #7628: QT: Add 'copy full transaction details' option b51ed40 QT: Add 'copy full transaction details' option (Eric Shaw) --- src/qt/transactiontablemodel.cpp | 28 ++++++++++++++++++++++++++++ src/qt/transactiontablemodel.h | 2 ++ src/qt/transactionview.cpp | 16 ++++++++++------ src/qt/transactionview.h | 1 + 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 1147a8236265e..28d67933b4e5e 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -634,6 +634,34 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return QString::fromStdString(rec->hash.ToString()); case TxHexRole: return priv->getTxHex(rec); + case TxPlainTextRole: + { + QString details; + QDateTime date = QDateTime::fromTime_t(static_cast(rec->time)); + QString txLabel = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address)); + + details.append(date.toString("M/d/yy HH:mm")); + details.append(" "); + details.append(formatTxStatus(rec)); + details.append(". "); + if(!formatTxType(rec).isEmpty()) { + details.append(formatTxType(rec)); + details.append(" "); + } + if(!rec->address.empty()) { + if(txLabel.isEmpty()) + details.append(tr("(no label)") + " "); + else { + details.append("("); + details.append(txLabel); + details.append(") "); + } + details.append(QString::fromStdString(rec->address)); + details.append(" "); + } + details.append(formatTxAmount(rec, false, BitcoinUnits::separatorNever)); + return details; + } case ConfirmedRole: return rec->status.countsForBalance; case FormattedAmountRole: diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index fe59a15f6a629..6932646e1e506 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -62,6 +62,8 @@ class TransactionTableModel : public QAbstractTableModel TxHashRole, /** Transaction data, hex-encoded */ TxHexRole, + /** Whole transaction as plain text */ + TxPlainTextRole, /** Is transaction confirmed? */ ConfirmedRole, /** Formatted amount, without brackets when unconfirmed */ diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index d696cdc375e52..27e6be30a2ca6 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -156,6 +156,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa QAction *copyAmountAction = new QAction(tr("Copy amount"), this); QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this); QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this); + QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this); QAction *editLabelAction = new QAction(tr("Edit label"), this); QAction *showDetailsAction = new QAction(tr("Show transaction details"), this); @@ -165,6 +166,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa contextMenu->addAction(copyAmountAction); contextMenu->addAction(copyTxIDAction); contextMenu->addAction(copyTxHexAction); + contextMenu->addAction(copyTxPlainText); contextMenu->addAction(editLabelAction); contextMenu->addAction(showDetailsAction); @@ -188,6 +190,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID())); connect(copyTxHexAction, SIGNAL(triggered()), this, SLOT(copyTxHex())); + connect(copyTxPlainText, SIGNAL(triggered()), this, SLOT(copyTxPlainText())); connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); } @@ -427,6 +430,11 @@ void TransactionView::copyTxHex() GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxHexRole); } +void TransactionView::copyTxPlainText() +{ + GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole); +} + void TransactionView::editLabel() { if(!transactionView->selectionModel() ||!model) @@ -597,12 +605,8 @@ bool TransactionView::eventFilter(QObject *obj, QEvent *event) QKeyEvent *ke = static_cast(event); if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier)) { - QModelIndex i = this->transactionView->currentIndex(); - if (i.isValid() && i.column() == TransactionTableModel::Amount) - { - GUIUtil::setClipboard(i.data(TransactionTableModel::FormattedAmountRole).toString()); - return true; - } + GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole); + return true; } } return QWidget::eventFilter(obj, event); diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index 4f416b80ac28e..5dd8963142947 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -94,6 +94,7 @@ private Q_SLOTS: void copyAmount(); void copyTxID(); void copyTxHex(); + void copyTxPlainText(); void openThirdPartyTxUrl(QString url); void updateWatchOnlyColumn(bool fHaveWatchOnly); From b967ad09edd9231e8e7aa39ab1ba43cde0063acd Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Mon, 14 Mar 2016 09:24:32 +0100 Subject: [PATCH 10/11] Merge #7668: Fix history deletion bug after font size change 21e45a0 Fix history deletion bug after font change (Andrew C) --- src/qt/rpcconsole.cpp | 11 +++++++---- src/qt/rpcconsole.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index b1a6299b15a48..e80e9b3e4a141 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -530,7 +530,7 @@ void RPCConsole::setFontSize(int newSize) // clear console (reset icon sizes, default stylesheet) and re-add the content float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value(); - clear(); + clear(false); ui->messagesWidget->setHtml(str); ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum()); } @@ -593,11 +593,14 @@ void RPCConsole::buildParameterlist(QString arg) Q_EMIT handleRestart(args); } -void RPCConsole::clear() +void RPCConsole::clear(bool clearHistory) { ui->messagesWidget->clear(); - history.clear(); - historyPtr = 0; + if(clearHistory) + { + history.clear(); + historyPtr = 0; + } ui->lineEdit->clear(); ui->lineEdit->setFocus(); diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index f6e73f7823d31..4e53ee6ebc2a5 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -80,7 +80,7 @@ private Q_SLOTS: void clearSelectedNode(); public Q_SLOTS: - void clear(); + void clear(bool clearHistory = true); void fontBigger(); void fontSmaller(); void setFontSize(int newSize); From 1a7ff227dc76d6f0bacc2d1383746d5545554aaf Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Wed, 6 Sep 2017 09:57:06 +0200 Subject: [PATCH 11/11] Use formatTxDate for date/time in TxPlainTextRole --- src/qt/transactiontablemodel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 28d67933b4e5e..497e374f69c7b 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -637,10 +637,9 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case TxPlainTextRole: { QString details; - QDateTime date = QDateTime::fromTime_t(static_cast(rec->time)); QString txLabel = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address)); - details.append(date.toString("M/d/yy HH:mm")); + details.append(formatTxDate(rec)); details.append(" "); details.append(formatTxStatus(rec)); details.append(". ");