[Kde-hardware-devel] Review Request: Adds Mobile Broadband info to plasma applet (depends on ModemManager patch)

Lamarque Vieira Souza lamarque at gmail.com
Sat May 22 07:05:13 CEST 2010


Em Sexta-feira 21 Maio 2010, Sebastian Kügler escreveu:
> On Fri May 21 2010 07:42:26 Lamarque Vieira Souza wrote:
> >         I did a test yesterday and Plasma::Label is capable of rendering
> >         a
> > 
> > html- like language used by Qt, that suffices to create the detail
> > window. We could use only one Plasma::Label and add/remove its contents
> > as needed. Updating the contents can make the screen flicker, is
> > Plasma::WebView better in this regard? I would like to update only the
> > needed parts, some parts (MAC, type, driver, etc) probably will not
> > change, but others like signal quality can change anytime.
> 
> I think it's limited to pretty basic rich text, we'd need table support.
> But you're right, let's try to use the (much lighter) Plasma::Label (it's
> backed by QLabel), and see if that is enough.

	It renders html tables too.
 
> Are you sure about the flickering, btw? All this stuff is double-buffered,
> and I don't remember seeing the flickering  you're talking about for
> years, especially not when just updating a couple of labels. If you can
> hand me some example code you see the flickering in, that'd be great so I
> can look into it (and learn what to avoid ;-)).

	I thought it could flicker, today I have tested it and it does not 
flicker.
 
> About the "only update what changes", think differently: If we split this
> stuff up, we're updating a number of widget (guess: 6-ish), by combining it
> (as I said), we get away with updating only one widget. Really, the more
> critical part here is to not occupy too much memory for something that is
> only viewed occasionally.

	Ok, after reading this e-mail I started to implement the details widget 
using html tables. After a day of work, here are the results for broadband and 
wireless:

http://reviewboard.kde.org/media/uploaded/images/2010/05/22/info_broadband.jpg
http://reviewboard.kde.org/media/uploaded/images/2010/05/22/info_wireless.jpg

	It works and now we can show only the details that applies to the network 
interface.

	I also set the traffic graph minimum height to 4 times 
QFontMetrics(KGlobalSettings::smallestReadableFont()).height(), this way the 
traffic graph always has enough height to draw four lines of text (the line 
for the transmit/receive speeds and three lines for the horizontal grid)

	Now the problems:

. I had to change the line "Received... Transmitted" below the graph to a html 
table too because now the m_gridLayout has only two columns instead of three. 
The last column is for the back button. As a consequency I cannot align the 
first html table with the html for this line. I tried everything I know to 
align them but nothing has worked.

. I had to add a hack to adjust the m_leftWidget width to prevent the back 
button being overried by some widget and therefore not working. Because of the
html table change this now happens all the time and not only when the 
KGlobalSettings::smallestReadableFont is a big font. The hack work but it 
causes the InterfaceDetailsWidget to have a two step size adjustment (for 
about two seconds the widget will increase in size two times). I am quite sure 
some users will complain about this and I also do not like it. I have been 
trying for hours to find a way to adjust the size before showing the widget 
but Qt is lazy enough to only adjust sizes when the widget is being shown, so 
I have to call my hack when the widget is being shown too.

. the traffic graph will have different heights depending on how much lines 
the first html table has.

. when the html table has several rows the last row is not displayed. I hacked 
this by adding an empty row at the end, so this is not a big deal.

. in line "Received... Transmitted" the final character has a fading out 
effect. Someone here know how to disable it?

	The changes are similar to what monolithic/tooltipbuilder.cpp does. One 
more thing monolithic/tooltipbuilder.cpp does is let the user select which 
detail (tooltip key) to show and in which order. I plan to add that feature 
too since the "Manage connections" kcm module already has the interface for 
the user select the tooltip keys, we can reuse that.

-- 
Lamarque V. Souza
http://www.geographicguide.com/brazil.htm
Linux User #57137 - http://counter.li.org/
http://www.kde-mg.org


More information about the Kde-hardware-devel mailing list