-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[Qt] replace fee slider with a Dropdown, extend conf. targets #10769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I probably need to mention why a dropbox and not a slider.
|
src/qt/sendcoinsdialog.cpp
Outdated
@@ -31,6 +31,25 @@ | |||
#include <QTextDocument> | |||
#include <QTimer> | |||
|
|||
static const std::array<int, 8> confTargets = { {2, 4, 6, 12, 48, 144, 504, 1008} }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename conf_targets
.
src/qt/sendcoinsdialog.cpp
Outdated
@@ -31,6 +31,25 @@ | |||
#include <QTextDocument> | |||
#include <QTimer> | |||
|
|||
static const std::array<int, 8> confTargets = { {2, 4, 6, 12, 48, 144, 504, 1008} }; | |||
int getConfTargetForIndex(int index) { | |||
if (index+1 > static_cast<int>(confTargets.size())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (index >= ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just:
return conf_targets[max(0, min(conf_targets.size() - 1, index)]
Looking at the screenshot, I would drop the tilde before the number of blocks, i.e. Also, shouldn't blocks have a lowercase b? |
Will review shortly. Thanks for doing! Also please add a target for 24 for compatibility with the old estimates (where 25 was the highest possible target). It may be a target that people are used to using. |
Confirmation is when it's 6 blocks deep, so +5 to all the numbers here? Or change it to "begin confirmation" like we currently have... |
I like how it looks, @morcos any concerns about missing 3,5 making users fee choices more clumpy? |
979cd99
to
19eae9c
Compare
Re-added targets 3, 5, 24 and removed the tilde in front of the target-in-blocks/-time. |
@@ -177,10 +199,10 @@ void SendCoinsDialog::setModel(WalletModel *_model) | |||
|
|||
// set the smartfee-sliders default value (wallets default conf.target or last stored value) | |||
QSettings settings; | |||
if (settings.value("nSmartFeeSliderPosition").toInt() == 0) | |||
ui->sliderSmartFee->setValue(ui->sliderSmartFee->maximum() - model->getDefaultConfirmTarget() + 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should call settings.remove("nSmartFeeSliderPosition")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I think an addition is required: we probably need to migrate the old slider value to the new dropdown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem particularly important to me.
src/qt/sendcoinsdialog.cpp
Outdated
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables())); | ||
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels())); | ||
for (const int &n : confTargets) { | ||
ui->confTargetSelector->addItem(tr("%1 blocks, %2").arg(n).arg(GUIUtil::formatNiceTimeOffset(n*Params().GetConsensus().nPowTargetSpacing))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative format: "%2 (%1 blocks)"
since the label is Confirmation time
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Your right.. will fix.
src/qt/sendcoinsdialog.cpp
Outdated
@@ -31,6 +31,25 @@ | |||
#include <QTextDocument> | |||
#include <QTimer> | |||
|
|||
static const std::array<int, 11> confTargets = { {2, 3, 4, 5, 6, 12, 24, 48, 144, 504, 1008} }; | |||
int getConfTargetForIndex(int index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update block style. Same for getIndexForConfTarget
.
src/qt/sendcoinsdialog.cpp
Outdated
@@ -31,6 +31,25 @@ | |||
#include <QTextDocument> | |||
#include <QTimer> | |||
|
|||
static const std::array<int, 11> confTargets = { {2, 3, 4, 5, 6, 12, 24, 48, 144, 504, 1008} }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snake case.
ACK 19eae9c @gmaxwell Actually my preference would be to remove the 3 and 5 targets. I think it gives a false sense of accuracy with the estimates. I don't imagine much clumping concern as those estimates often aren't that different from each other and there is a much larger range of estimates to choose from as well as time variability. I also think its a bit cleaner not to be faced with too many choices in a dropdown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really think we need this for 15.
src/qt/sendcoinsdialog.cpp
Outdated
@@ -31,6 +31,25 @@ | |||
#include <QTextDocument> | |||
#include <QTimer> | |||
|
|||
static const std::array<int, 11> confTargets = { {2, 3, 4, 5, 6, 12, 24, 48, 144, 504, 1008} }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not sure its worth having 5 here, maybe not 3 either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why the extra set of {}?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why the extra set of {}?
Compiler warning.
src/qt/sendcoinsdialog.cpp
Outdated
return i; | ||
} | ||
} | ||
return confTargets.back(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant .size() - 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Yes. Will fix.
GUI-screenshot-looks-nice-ACK. Didn't look at the code. |
utACK 19eae9c3602c784d55f8edc94300da1ece686a6c modulo the thing @TheBlueMatt pointed out. I don't think we need the 3, 4, or 5 block target estimates. It may also be useful to include a tooltip that explains why you see the line "Estimated to begin confirmation within N blocks" where N is less than the confirmation target that you chose as seen in the screenshot below. This discrepancy may confuse users. |
Yes would be a nice improvement, could be left for another PR as it's a preexisting issue. Would be great to get than in for 0.15 as well, but wouldn't want it to hold up this. The other feature that I'd ideally like is the ability to force estimates conservative or economical regardless of the Replace-By-Fee setting. Again just a wish list item. |
19eae9c
to
ff54ece
Compare
Always round up (conservative)
ff54ece
to
2aef1f1
Compare
Removed again target 3 and 5 and fixed points found by @TheBlueMatt and @promag. Thanks for a retest/re-ack. |
Tested ACK 2aef1f1 |
utACK 2aef1f1 |
…argets 2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
…conf. targets 2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
…conf. targets 2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
…conf. targets 2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
…conf. targets 2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
…conf. targets 2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
…conf. targets 2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
…conf. targets 2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli) bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli) Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
Addresses #10590.
This PR replaces the fee slider with a Dropbox box. The Dropdown contains the target in ~blocks and ~estimated time to confirm.
The current supported confirmation targets are: 2, 4, 6, 12, 48, 144, 504, 1008