Extender tutorial on techbase

Sebastian Kügler sebas at kde.org
Tue Sep 9 09:14:51 CEST 2008


On Tuesday 09 September 2008 02:26:51 Aaron J. Seigo wrote:
> On Monday 08 September 2008, Marco Martin wrote:
> > in popupapplet adding the possibility ti replace the icon with a generic
> > QGraphicsWidget
>
> this probably makes sense. the question would be how to make a nice API for
> it.
>
> there will *still* be cases where this fails and some code will need to be
> written, but it's one more case covered at least.

The case I've run into is that I'd like to add a popup to a normal applet (in 
this case the battery). So I'd still want all the magic in paintInterface() to 
work, and then just add a dialog. That's *mostly* what popupapplet does, but 
aq couple of things make it unusable for that case:
No option to always have it behave like in the panel (i.e. on planar / 
mediacenter FFs, it always expands. There has been a patch for it, but it 
wasn't merged, not sure why, but I would use it. Right now, I end up with 
setting up the dialog and positioning by hand, something I can 'mostly' copy 
over from either popupapplet, or libplasmaclock (both are slightly different 
:/).

So can we have something like the normal applet combined with popupdialog? The 
following methods should be there:

- paintInterface() for 'normal applet painting' (not just a graphicswidget)
- setHasPopup() and createPopup(Plasma::Dialog dialog) (enables a dialog, much 
  like createConfigurationInterface() in Applet)
- widget() and graphicsWidget() (to fill the popup with widgets or 
  plasma::widgets

What I would not like to do:

- take care of on-demand create of the dialog
- take care of positioning the dialog

Another problem is that libplasmaclock has a really "interesting" 
implementation of the extenders. I first took that as an example (in the 
mid_control applet, but it prove buggy, then I read the tutorial, went "wtf, 
libplasmaclock is doing something fairly different"). I didn't get the code to 
work well ... look at mid_control applet if you want to see the details.

For the things I'm working on (control panel area with dialogs popping up), 
the needs are all fairly similar, and sound like something that should be 
absolutely easy to do. Yet it's not. Modulo my stupidity.

That said, I think the API of the extenders (or what I read in the tutorial) 
is OK, now we need to rule out the bugs :>
-- 
sebas, Plasma API user

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 

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


More information about the Plasma-devel mailing list