From c5adf8f267b2b4b633af2738c8f21005d4382496 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Fri, 6 Jan 2017 10:42:27 +0100 Subject: [PATCH 1/3] [Qt] Show more significant warning if we fall back to the default fee --- src/qt/forms/sendcoinsdialog.ui | 20 ++++++++++++++++++++ src/qt/sendcoinsdialog.cpp | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index ca8ecffaf..2eb3276a8 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -759,11 +759,31 @@ + + + + Using the fallbackfee can result in sending a transaction that will take serval hours or days (or never) to confirm. Consider choosing your fee manually or wait until your have validated the complete chain. + + + color: rgb(255, 150, 0); +font-weight: bold; + + + Warning: Fee estimation is currently not possible. + + + false + + + Qt::Horizontal + + QSizePolicy::MinimumExpanding + 40 diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 5aeda7a30..6180107b0 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -655,6 +655,7 @@ void SendCoinsDialog::updateSmartFeeLabel() std::max(CWallet::fallbackFee.GetFeePerK(), CWallet::GetRequiredFee(1000))) + "/kB"); ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...) ui->labelFeeEstimation->setText(""); + ui->fallbackFeeWarningLabel->setVisible(true); } else { @@ -662,6 +663,7 @@ void SendCoinsDialog::updateSmartFeeLabel() std::max(feeRate.GetFeePerK(), CWallet::GetRequiredFee(1000))) + "/kB"); ui->labelSmartFee2->hide(); ui->labelFeeEstimation->setText(tr("Estimated to begin confirmation within %n block(s).", "", estimateFoundAtBlocks)); + ui->fallbackFeeWarningLabel->setVisible(false); } updateFeeMinimizedLabel(); From 3e4d7bfcb7d9f6d88b6120f44bb6cb7fa93d7adf Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 17 Feb 2017 08:18:32 +0000 Subject: [PATCH 2/3] Qt/Send: Figure a decent warning colour from theme --- src/qt/forms/sendcoinsdialog.ui | 8 +++++--- src/qt/sendcoinsdialog.cpp | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index 2eb3276a8..ca2da6bf3 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -764,9 +764,11 @@ Using the fallbackfee can result in sending a transaction that will take serval hours or days (or never) to confirm. Consider choosing your fee manually or wait until your have validated the complete chain. - - color: rgb(255, 150, 0); -font-weight: bold; + + + 75 + true + Warning: Fee estimation is currently not possible. diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 6180107b0..d39f92dda 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -656,6 +656,9 @@ void SendCoinsDialog::updateSmartFeeLabel() ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...) ui->labelFeeEstimation->setText(""); ui->fallbackFeeWarningLabel->setVisible(true); + int lightness = ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness(); + QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14)); + ui->fallbackFeeWarningLabel->setStyleSheet("QLabel { color: " + warning_colour.name() + "; }"); } else { From 7abe7bbf61d90dc003647f2cc5019e4652182399 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 17 Feb 2017 08:41:57 +0000 Subject: [PATCH 3/3] Qt/Send: Give fallback fee a reasonable indent --- src/qt/sendcoinsdialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index d39f92dda..39f828501 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -22,6 +22,7 @@ #include "txmempool.h" #include "wallet/wallet.h" +#include #include #include #include @@ -659,6 +660,7 @@ void SendCoinsDialog::updateSmartFeeLabel() int lightness = ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness(); QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14)); ui->fallbackFeeWarningLabel->setStyleSheet("QLabel { color: " + warning_colour.name() + "; }"); + ui->fallbackFeeWarningLabel->setIndent(QFontMetrics(ui->fallbackFeeWarningLabel->font()).width("x")); } else {