modified block DL progressbar to be more informative and precise #1025

pull Diapolo wants to merge 8 commits into bitcoin:master from Diapolo:GUI-BlockDL changing 1 files +24 −10
  1. Diapolo commented at 6:03 AM on April 2, 2012: none

    I added a % left value to the tooltip, the progressbar text is now displayed in it's middle centered and uses real block values instead of only a % value ("x of y blocks (z %)"). The progressbar is hidden, if there is no network connection and get's hidden, if the connection is lost.

    Edit: Removed the dynamic component of the idea ;).

  2. gmaxwell commented at 6:09 AM on April 2, 2012: contributor

    NAK. Most confusing possibility yet proposed. :(

    The problem with relative progress is that people restart while syncing and freak out when it goes to zero... thinking that it's started from the start again. Some people have even given up on the reference client as a result of this (or so they say on IRC).

    Behavior that changes in ways that would take a paragraph to explain based on state which is hidden from the user is not intuitive at all.

    However, I like showing real block values— but UI clueful people seem to think this is a bad idea.

  3. Diapolo commented at 6:40 AM on April 2, 2012: none

    I'm new in that discussion, but think about it for a while ... the ugly thing is not really the full resync, but if you didn't start the client for a few days and it has to catch up let's say 1000 blocks. This would be displayed relative and does not seem to stuck for so long on 99%. I even added the strings "abs. display" / "rel. display" as a hint.

    But okay, so if the consens would be to not use a dynamic display at all, what do you think of the other changes (including only displaying the bar if there is a bc network connection)?

  4. in src/qt/bitcoingui.cpp:None in faa0dc8e50 outdated
     331 | @@ -332,8 +332,12 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
     332 |          setNumConnections(clientModel->getNumConnections());
     333 |          connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
     334 |  
     335 | -        setNumBlocks(clientModel->getNumBlocks());
     336 | -        connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int)));
     337 | +        // don't display the sync. message, if we are not connected to the network
     338 | +        if (clientModel->getNumConnections() > 0)
    


    laanwj commented at 6:42 AM on April 2, 2012:

    Do not make this check in the setModel function but in setNumBlocks.

    Background: in Qt, a model is assigned to a widget at most once (there are exceptions, for example when reading a new file and everything should be reset), so it must not make judgements based on temporary state.

    Also this does not handle the case where number of connections goes back to 0.


    Diapolo commented at 8:02 AM on April 2, 2012:

    Good point, will change that behaviour.

  5. laanwj commented at 6:59 AM on April 2, 2012: member

    We've already tried the "show relative progress" thing once. It didn't fly.

    Unless someone develops an elegant widget that shows both absolute and relative information in a neat, intuitive way (and cross-validates this with the complainers on the bitcoin forums and here) I'm reluctant to try it again.

    I do agree with only showing "catching up" and the progress bar when the network connection is up. See my implementation comment though :)

  6. Diapolo commented at 8:04 AM on April 2, 2012: none

    So if a relative display didn't fly what about displaying "x of y blocks (z %)" as text on the progressbar? I think it's very nice, because you see progress per block and not per % (which is ver imprecise).

  7. Diapolo commented at 8:27 AM on April 2, 2012: none

    Updated to be not relative anymore and changed network detection part as laanwj suggested.

  8. laanwj commented at 8:41 AM on April 2, 2012: member

    The problem is that the source information (the YY in "XX of YY blocks") is imprecise too. Showing that number only gives a false sense of precision.

    On the other hand I agree with you. If you show a progress bar, the % is redundant as it is already visually conveyed.

  9. Diapolo commented at 8:46 AM on April 2, 2012: none

    Can you explain, why YY is imprecise? That are the current all time blocks in the network (claimed by the nodes), but even if the real value is not correct, the new text display is clear.

    If you start the client and it sits on 99% for minutes you think fuck what's up. If it reads 9900 of 10000 blocks (99%) and keeps moving block for block you see it's working and it progresses further.

  10. sipa commented at 10:01 AM on April 2, 2012: member

    I'd say use an absolute percentage chain always, but put in readable text on it "est. X blocks left".

  11. Diapolo commented at 10:13 AM on April 2, 2012: none

    Last commit makes it absolute again, so that's fine and I won't touch it anymore ^^.

    So we have the coice if we keep "%", use my suggestion "x of y blocks (z%) or something like sipa suggested above. As I said everything is better than a simple % because users want to see at least a real progress.

    Edit: Tried it and a "x blocks remaining (y % done)" message looks nice and clean, too.

  12. laanwj commented at 10:43 AM on April 2, 2012: member

    Thanks for making it absolute again.

    I'm convinced. I think we should drop the percentage from the text and show "xx of estimated yy". Percentage is implicit in the progess bar visual and doesnt add anything.

    Sipa's suggestion to show only the estimated number of blocks left is also good. Advantage is that it shows only one number, disadvantage is that the derived number is less useful for problem diagnostics.

  13. Diapolo commented at 11:13 AM on April 2, 2012: none

    The more I think about it, the better I like sipas idea of only showing the remaining blocks. And for problem diagnostic we have a tooltip, which shows the real numbers.

    So "~xx blocks remaining" as text? Centered on the progressbar (perhaps hard to read as this uses the native OS style for the bar and text) or to the right of the bar?

  14. laanwj commented at 12:04 PM on April 2, 2012: member

    I'd say show it on the progress bar. That's one less level of indirection. If it looks weird on some OS we can always change it.

  15. Diapolo commented at 1:36 PM on April 2, 2012: none

    Was a bit tricky to count backwards (blocks remaining) and keep track of the right value (scale) of the progressbar, but now it's ready for testing / review :).

  16. in src/qt/bitcoingui.cpp:None in 9511c70427 outdated
     450 | @@ -451,20 +451,33 @@ void BitcoinGUI::setNumConnections(int count)
     451 |  
     452 |  void BitcoinGUI::setNumBlocks(int count)
     453 |  {
     454 | -    if(!clientModel)
     455 | +    // don't show / hide progressBar and it's label if we have no connection(s) to the network
     456 | +    if (!clientModel || clientModel->getNumConnections() == 0)
    


    Diapolo commented at 1:37 PM on April 2, 2012:

    @laanwj Will this interfere with status bar warnings or do they only work if there is a connection?


    laanwj commented at 4:48 PM on April 2, 2012:

    Yes, this interferes with the status bar warnings. But those do only work if the client was connected to the network at one point or another.

  17. sipa commented at 2:28 PM on April 2, 2012: member

    Looks good so far, but

  18. Diapolo commented at 2:35 PM on April 2, 2012: none

    @sipa The style/design of the progressbar comes from the OS and can only be changed by some form of Qt stylesheets afaik (see: http://harmattan-dev.nokia.com/docs/library/html/qt4/qprogressbar.html#details).

    2 options, put the text right to the progressbar or search the web for howto edit the style of the bar (which is a hard work, because of the different OS GUIs and color schemes :-/).

  19. Diapolo commented at 4:42 PM on April 2, 2012: none

    Okay, I found a way to apply stylesheets to the bar and it can be very well customized ... will add a commit so you could try it out @sipa.

  20. laanwj commented at 4:50 PM on April 2, 2012: member

    Ok, let us know how it goes. Sounds like something that is a nightmare to get right on all OSes. Otherwise, putting the text in the progressBarLabel to the left of the progress bar is fine too.

  21. Diapolo commented at 5:11 PM on April 2, 2012: none

    OMFG what a mess, but now I'm happy :-D. So on Windows the bar looks equal, no matter what theme I activate and even if I chose the classic theme.

    I moved some one-time functions so that they don't get called everytime setNumConnections() is called.

    To the style itself, I chose an orange as bar color, because of the Bitcoin icon and I think it ROCKS! But hey let's vote or you can make own suggestions :).

  22. in src/qt/bitcoingui.cpp:None in f4a1713cdc outdated
     137 | @@ -138,17 +138,21 @@
     138 |      frameBlocksLayout->addWidget(labelBlocksIcon);
     139 |      frameBlocksLayout->addStretch();
     140 |  
     141 | -    // Progress bar for blocks download
     142 | -    progressBarLabel = new QLabel(tr("Synchronizing with network..."));
    


    Diapolo commented at 5:13 PM on April 2, 2012:

    I removed that one, because we set the text below, so that was not needed. The same was true for the progressBar tooltip a few lines below.

  23. laanwj commented at 5:27 PM on April 2, 2012: member

    So on Windows the bar looks equal, no matter what theme I activate and even if I chose the classic theme.

    This does mean we lose platform-native styling for the progress bar. Not that that is necessarily a problem, I think it looks nice (also on Ubuntu 11.10).

  24. modified block DL progressbar to be dynamic and more precise 9ceae8acea
  25. removed relative progressbar display and moved re-worked network detection code to setNumBlocks() 068ed1e838
  26. changed progressbar text to "~n blocks remaining" 5519660a0d
  27. implemented OS independent progress bar style / moved one-time functions used on the bar to a better code location c7c0c93172
  28. color update for progress bar e9de46c436
  29. polished code and fixed progress display (was very jerky at the end of a sync) a7a69cd07a
  30. Diapolo commented at 9:59 PM on April 2, 2012: none

    I had to edit the code once more, because in the end of a sync the bar was rather jerky and jumped a bit too much. Because of that I had to seperate the "~x blocks remaining" text from the real progress bar values, to be not linked. Now the displayed text is one thing and the progressbar progress display another one.

    Edit: I will rebase this after I got some final ACKs :).

  31. sipa commented at 1:26 AM on April 3, 2012: member

    It looks nice, visual ACK. I didn't check the source code changes.

  32. laanwj commented at 6:05 AM on April 3, 2012: member

    That last commit did certainly make it better. It seemed like the number never changed while I was looking :-)

    Edit: ACK

  33. changed percentage done in tooltip to float to be more precise / allowed plurals in translation for "x block(s) remaining" ec9a4904f3
  34. Diapolo commented at 6:31 AM on April 3, 2012: none

    @laanwj Could you take a short look over the last commit. If you are fine with that, I will rebase!

  35. clarified comment why we use an own progressbar style / included "~" in the tr() call 853a4a81b3
  36. in src/qt/bitcoingui.cpp:None in ec9a4904f3 outdated
     149 |  
     150 |      statusBar()->addWidget(progressBarLabel);
     151 |      statusBar()->addWidget(progressBar);
     152 |      statusBar()->addPermanentWidget(frameBlocks);
     153 |  
     154 | +    // define OS independent progress bar style (has to be placed after addWidget(), otherwise we crash)
    


    laanwj commented at 6:45 AM on April 3, 2012:

    maybe also add an explanation why we need OS independent progress bar style, so that people in the future will understand :-)


    Diapolo commented at 6:57 AM on April 3, 2012:

    Like: "we did this, because with some OSes default style, text on the progress bar is unreadable" ;)?


    laanwj commented at 7:03 AM on April 3, 2012:

    Right!

  37. Diapolo commented at 5:00 AM on April 4, 2012: none

    So we have 1 "visual" ACK and laanwjs ACK, further dev votes :)?

  38. laanwj commented at 6:29 AM on April 4, 2012: member

    I don't think there's much more to be done, except determine whether we want this for 0.6.1 or 0.7.0. The code change is small and simple enough to make it end up in 0.6.1 IMO, the only hindrance is that some translation messages have been changed and it usually takes a while to update them.

  39. Diapolo commented at 6:51 AM on April 4, 2012: none

    As for the translations, I would push the new master file (en) early to transifex, so that translators have enough time to keep up. So I guess there will be RCs for 0.6.1 and I suggest let's integrate this one here.

    Remember, there is that Wallet-HTML-thing from #945, which has to do with translations, too (even if we would do that).

  40. laanwj commented at 6:58 AM on April 4, 2012: member

    Yes, agreed. I'm for merging this as soon as possible. (and also #1002, depending on whether we fix URL handling for 0.6.1)

    #945 is for 0.7.0 as it is pretty low-priority (nearly no visual difference) but a lot of hassle for translators.

  41. sipa commented at 10:38 AM on April 4, 2012: member

    Fine for 0.6.1 for me.

  42. laanwj referenced this in commit cadae3588c on Apr 4, 2012
  43. laanwj merged this on Apr 4, 2012
  44. laanwj closed this on Apr 4, 2012

  45. coblee referenced this in commit 018cfa8392 on Jul 17, 2012
  46. suprnurd referenced this in commit d6637c2e8e on Dec 5, 2017
  47. lateminer referenced this in commit 988ee3fe37 on Oct 30, 2019
  48. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me