GUI: MessageView: show an indicator whenever the message parts are being loaded

Review Request #112092 - Created Aug. 14, 2013 and submitted

Jan Kundrát
GUI: MessageView: show an indicator whenever the message parts are being loaded

It looks that QWebView does not have support for showing any placeholder
whenever it is loading data from network; instead, a simple empty widget is
shown. This is suboptimal because the user doesn't know that the mail is
currently loading unless they pay close attention to the global
application-level progress indicator in the status bar.

This patch propagates loadingStarted/loadingFinished signals of the enclosed
SimplePatrWidget instances to the MessageView which simply shows/hides another
progress indicator.

Another idea was to implement this on the QNAM level, but it turned out that the
same MsgPartNetAccessManager is used also for attachment download which is not
what we are interested in.
github, branch show-part-loading
Caspar Schutijser
Commit Hook
Jan Kundrát
Review request changed

Status: Closed (submitted)

Thomas Lübking
text = tr("Fetching\nMessage");
int step = myScanningStep;
int startAngle = 16*90 - 40*step*step;
step = (myScanningStep+9)%12;
int endAngle = 16*90 - 40*step*step;
int span = endAngle - startAngle;
if ( span < 0 )
   span = 360*16+span;

c.setAlpha( c.alpha() / 3 );
p.setPen( QPen(c, qMax(1,r.width()/16), Qt::SolidLine, Qt::RoundCap) );
.setBrush( Qt::NoBrush );
p.drawArc( r, startAngle, span );
p.setPen( c );
p.setFont( fnt );
p.drawText(r, Qt::AlignCenter|Qt::TextDontClip, text );

--------- /snip

This creates a hunting circle (tries to bite its own ass) and paints the text in the center.
Could be painted directly into the viewport and utilize the QPalette::Text color to look less patched on.

-> Opinion?
  1. I knew you will chime in when I hack together an ugly way with a QProgressBar :). Yes, I would love to see someting similar to Harmattan's spinner (a hybrid between a circle and a square with spinning B-W gradient), or to, or something "like" that, even if different. Bonus points if it can be implemented in an effective manner. Patches more than welcome; I don't know how painting works to be able to code this without RTFMing.