Plasmoid configuraiton...

Ben Martin monkeyiq at users.sourceforge.net
Mon May 3 12:08:29 CEST 2010


Hi,
  Firstly, sorry if this a an FAQ or I've just majorly missed something.
I only created my first few plasmoids recently. Also, please CC me as
I'm currently not on the list :/

  If my understanding is correct, to configure a plasmoid you use a
KConfigGroup and use readEntry() to get at each key-value pair.
createConfigurationInterface() uses a .ui file to create a Qt interface
for configuration and then sets each element in the UI::foo to the
current setting. When okClicked is emitted and a slot called, you then
get the data from the Qt interface widgets, use
KConfigGroup::writeEntry() to put each setting out and also set instance
variables in the plasmoid and possibly update() to reflect changes.

  I think I might be off the track a little as it seems that you should
be able to automatically link instance variables to the UI widgets using
introspection. So if you have int m_funValue; as an instance member in
the plasmoid, and there is an m_funValue slider in the .ui file that
makes the configuration Qt interface, then the setting of the Qt
interface and getting happens automatically and perhaps the link from
m_funValue to the KConfigGroup also occurs so that the plasmoid itself
doesn't have to do any of the stuff in the proceeding paragraph.

  If there are examples using the above introspection style then I'd be
happy to port over my plasmoid to the same style. Any specific hints as
to which plasmoids to check out would be great. Otherwise, does this
seem to make sense as a possible extension?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100503/01eaeec2/attachment.sig 


More information about the Plasma-devel mailing list