Applet::createConfigurationInterface
Aaron J. Seigo
aseigo at kde.org
Tue Apr 8 10:43:16 CEST 2008
On Tuesday 08 April 2008, Sebastian Kuegler wrote:
> On Tuesday 08 April 2008 06:39:10 Aaron J. Seigo wrote:
> > On Monday 07 April 2008, Sebastian Kuegler wrote:
> > > From the API it's not easily visible how createConfigurationInterface()
> > > is supposed to be used. Can you give a brief outline how this function
> > > should be used in an applet?
> >
> > you can look at the analog clock applet, but generally it's this:
>
> I don't see where the analog clock (or any other applet) uses this method
> rather than the old way of doing it. grep doesn't show any users in
> kdebase.
whoops, i didn't commit this =/
> > void createConfigurationInterface(KConfigureDialog *parent)
> > {
> > QWidget *page = new QWidget(parent);
> > /* fill page with widgets */
> > parent->addPage(page);
> > }
>
> Not quite clear how adding a UI file works then ...
void Clock::createConfigurationInterface(KConfigDialog *parent)
{
//TODO: Make the size settable
QWidget *widget = new QWidget();
ui.setupUi(widget);
parent->setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply );
connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()));
connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted()));
parent->addPage(widget, parent->windowTitle(), "chronometer");
<... bunch of set up code, e.g. setting widget values ...>
}
this is of course the difficult path ... we do have support for packages with
kconfigxt and ui files. unfortunately, kconfigxt is broken when it comes to
KConfigGroup which is why i haven't yet exposed this more.
i'd *like* to make it possible to just expose your ui and package files and
have it made for you. we theoretically do this for scripted applets already
but due to the kconfigskeleton uselessness it's more theoretical than
practical code ;) once that's addressed, i'll make this available to c++
applets as well.
> Sorry for being a bit dense.
np =)
--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080408/ac3dcc5f/attachment.pgp
More information about the Panel-devel
mailing list