-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Musicbrainz: Elide long error messages in the progress bar #13673
Conversation
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.
LGTM
src/library/dlgtagfetcher.cpp
Outdated
QString cantConnect = tr("Can't connect to %1: %2").arg(app, message); | ||
QFontMetrics metrics(loadingProgressBar->font()); | ||
QString elidedCantConnect = metrics.elidedText( |
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.
All are const, right?
I wonder if we need the full error string/url at all. Besides, I wouldn't expect a tooltip on a progressbar. |
src/library/dlgtagfetcher.cpp
Outdated
Qt::ElideRight, | ||
loadingProgressBar->width() - 4); | ||
loadingProgressBar->setFormat(elidedCantConnect); | ||
if (cantConnect.size() != elidedCantConnect.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.
Is there the possibility of the edge case that the elided text has the same length as the non-elided text? Could this happen when the text gets elided but then the added ellipses pads it back out to the same length again? That would cause information to be missing (not much sure, but still a character or two) and no tooltip being shown.
Unless we know this is a performance problem, I would just always set the tooltip. makes the code simpler and avoids the edge case.
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.
Right, that is likely, but no gurantee, because the elipsis can be either the … (https://www.compart.com/de/unicode/U+2026) or ... (three dots) depending on the font.
We show the translated error string form the Qt backend that is intendend to be displayed to the user. So I consider it a good idea to show it. The errror message is long if it contains a long path auto generated path, so eliding will probably not cut off sigificant data and we may consider to remove the tooltip.
Only if the original message is too long and independent froem the preferendes. This was just a quick workaround. If you prefer I will remove the tooltip. Please give a hint. |
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.
LGTM. Thank you.
Merge? @ronso0 Is that OK for now? |
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.
Yup, LGTM.
Thank you!
And put the full text into a tooltip, like we do in the library table.
This fixes #13664