Skip to content
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

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

Merged
merged 8 commits into from Apr 4, 2012
Merged

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

merged 8 commits into from Apr 4, 2012

Conversation

Diapolo
Copy link

@Diapolo Diapolo commented Apr 2, 2012

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 ;).

@gmaxwell
Copy link
Contributor

gmaxwell commented Apr 2, 2012

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.

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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)?

setNumBlocks(clientModel->getNumBlocks());
connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int)));
// don't display the sync. message, if we are not connected to the network
if (clientModel->getNumConnections() > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will change that behaviour.

@laanwj
Copy link
Member

laanwj commented Apr 2, 2012

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 :)

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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).

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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

@laanwj
Copy link
Member

laanwj commented Apr 2, 2012

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.

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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.

@sipa
Copy link
Member

sipa commented Apr 2, 2012

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

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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.

@laanwj
Copy link
Member

laanwj commented Apr 2, 2012

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.

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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?

@laanwj
Copy link
Member

laanwj commented Apr 2, 2012

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.

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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 :).

@@ -451,20 +451,33 @@ void BitcoinGUI::setNumConnections(int count)

void BitcoinGUI::setNumBlocks(int count)
{
if(!clientModel)
// don't show / hide progressBar and it's label if we have no connection(s) to the network
if (!clientModel || clientModel->getNumConnections() == 0)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sipa
Copy link
Member

sipa commented Apr 2, 2012

Looks good so far, but

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

@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 :-/).

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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.

@laanwj
Copy link
Member

laanwj commented Apr 2, 2012

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.

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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 :).

@@ -138,17 +138,21 @@
frameBlocksLayout->addWidget(labelBlocksIcon);
frameBlocksLayout->addStretch();

// Progress bar for blocks download
progressBarLabel = new QLabel(tr("Synchronizing with network..."));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@laanwj
Copy link
Member

laanwj commented Apr 2, 2012

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).

@Diapolo
Copy link
Author

Diapolo commented Apr 2, 2012

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 :).

@sipa
Copy link
Member

sipa commented Apr 3, 2012

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

@laanwj
Copy link
Member

laanwj commented Apr 3, 2012

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

Edit: ACK

…wed plurals in translation for "x block(s) remaining"
@Diapolo
Copy link
Author

Diapolo commented Apr 3, 2012

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

progressBar->setVisible(false);

statusBar()->addWidget(progressBarLabel);
statusBar()->addWidget(progressBar);
statusBar()->addPermanentWidget(frameBlocks);

// define OS independent progress bar style (has to be placed after addWidget(), otherwise we crash)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right!

@Diapolo
Copy link
Author

Diapolo commented Apr 4, 2012

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

@laanwj
Copy link
Member

laanwj commented Apr 4, 2012

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.

@Diapolo
Copy link
Author

Diapolo commented Apr 4, 2012

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).

@laanwj
Copy link
Member

laanwj commented Apr 4, 2012

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.

@sipa
Copy link
Member

sipa commented Apr 4, 2012

Fine for 0.6.1 for me.

laanwj added a commit that referenced this pull request Apr 4, 2012
modified block DL progressbar to be more informative and precise
@laanwj laanwj merged commit cadae35 into bitcoin:master Apr 4, 2012
coblee pushed a commit to litecoin-project/litecoin that referenced this pull request Jul 17, 2012
modified block DL progressbar to be more informative and precise
suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
…mit) (bitcoin#1025)

* simplify CMasternodePayments::IsEnoughData (always using GetStorageLimit)
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Oct 30, 2019
… requested.

1a8ed6e [Startup] Don't continue loading the wallet if the shutdown was requested. (furszy)

Pull request description:

  Auto-explainable title.

ACKs for top commit:
  Fuzzbawls:
    ACK 1a8ed6e
  random-zebra:
    ACK 1a8ed6e and merging...

Tree-SHA512: bf8952699d1acda591a5cd9dfdca142a29c1c2c6aea5f6b9ede938a053dcc5194e8b691d606a4bdd684ce376a34aa3f14f759cddc438602dae4877ee024068d2
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants