Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[Qt] replace fee slider with a Dropdown, extend conf. targets #10769
Conversation
jonasschnelli
added the
GUI
label
Jul 7, 2017
|
I probably need to mention why a dropbox and not a slider.
|
| @@ -31,6 +31,25 @@ | ||
| #include <QTextDocument> | ||
| #include <QTimer> | ||
| +static const std::array<int, 8> confTargets = { {2, 4, 6, 12, 48, 144, 504, 1008} }; |
| @@ -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())) { |
promag
Jul 7, 2017
Contributor
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? |
jonasschnelli
added this to the
0.15.0
milestone
Jul 9, 2017
|
Re-added targets 3, 5, 24 and removed the tilde in front of the target-in-blocks/-time. |
| @@ -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} }; |
| @@ -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) { |
| - 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))); |
promag
Jul 10, 2017
Contributor
Alternative format: "%2 (%1 blocks)" since the label is Confirmation 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); |
jonasschnelli
Jul 13, 2017
Member
Hmm... I think an addition is required: we probably need to migrate the old slider value to the new dropdown?
|
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. |
laanwj
self-assigned this
Jul 11, 2017
jonasschnelli
referenced
this pull request
Jul 11, 2017
Merged
Add PR description to merge commit in github-merge.py #10786
| @@ -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} }; |
| + return i; | ||
| + } | ||
| + } | ||
| + return confTargets.back(); |
|
GUI-screenshot-looks-nice-ACK. Didn't look at the code. |
|
utACK 19eae9c 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. |
jonasschnelli
added some commits
Jul 7, 2017
|
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 |
sipa
merged commit 2aef1f1
into
bitcoin:master
Jul 15, 2017
1 check passed
sipa
added a commit
that referenced
this pull request
Jul 15, 2017
|
|
sipa |
8fdd23a
|

jonasschnelli commentedJul 7, 2017
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