[Panel-devel] Design of Sensor and meters

Aaron J. Seigo aseigo at kde.org
Wed Sep 14 02:56:15 CEST 2005


On Monday 12 September 2005 10:40, Vinay Khaitan wrote:
> Pedro has done some refactoring of superkaramba. He has encountered some
> design troubles. They are similiar to what I had earlier talked about i.e.
> meters dont know the format sensor's return value. And type of return value
> doesn't give any information about that.

if you need a key->value mapping, that's what a Map is for. e.g. QMap<QString, 
QVariant>

and again i really don't like the concept of meters constantly making calls to 
sensors to grab bits of data. just send the current state of the sensor in a 
signal to a slot in the sensor (it's cheap if we pass it by const reference) 
and it's done.

> MULTIMETER meter=bar number=2 orientation=horizontal, separationX=50
> separationY=50 value.1=cpu0.system bar.x=0 bar.y=etc
> value.2=cpu1.systemSENSOR=cpusensor

oi vey. we need to have a discussion about what plasmoids are going to look 
like.

to boil it down to essentials: are they going to be scripts, or are they going 
to be "theme files". the latter will certainly not encompasse the needs of 
plasma applets in the least, though theme files could be a specialized kind 
of plasmoid (and loaded via a theme container.. all transparent to the user, 
so no concerns there).

so if we say that plasmoids will be actual code at the most base level, with a 
simplistic theme engine added on top of that, then we ought to start phrasing 
our use cases in those terms.

> The separation stuff would set the separation of multiple meters.
> orientation is separation orientation.

how about:

MULTIMETER meter
meter.setType bar
meter.setNumberOfMeters 2
meter.setOrientation horizontal
meter.setMeterKey 1 cpu0.system
meter.setMeterKey 2 cpu1.system
SENSOR sensor = cpusensor
meter.connectTo sensor

looks almost identical, but is done more like a real script. what does concern 
me is the layout / geometry stuff:

meter.setSpacing 50
bar.x=0 bar.y=etc

this stuff tends to get really messy if you work with translated strings, 
themed widgets (e.g. not just pixmaps) and what not.. it's usually better to 
use layouts and define basic properties like preferred size, spacing and 
margins (all of which tend to have good defaults).

-- 
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

Full time KDE developer sponsored by Trolltech (http://www.trolltech.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20050914/18de2dfb/attachment.pgp


More information about the Panel-devel mailing list