2009/2/19 Aaron J. Seigo <ase...@kde.org> > On Thursday 19 February 2009, Benjamin Kleiner wrote: > > On Thursday, 19. February 2009 16:55:38 Thomas Coopman wrote: > > > I have been running in the same problem and have looked a bit at the > code > > > and it looks like createConfigurationInterface is not in AppletScript > so > > > there are some changes needed to solve this. > > > > > > But if it is possible to use showConfiguration and get the same dialog > I > > > would like to know how too. > > > > Well, the following code emulates the wanted behaviour relatively well: > > > > def showConfigurationInterface(self): > > dialog = KPageDialog() > > dialog.setFaceType(KPageDialog.List) > > dialog.setButtons( KDialog.ButtonCode(KDialog.Ok | > KDialog.Cancel) ) > > #The assignment of actions to the buttons happens in > > createConfigurationInterface(), as proposed. > > self.createConfigurationInterface(dialog) > > dialog.exec_() > > > > It works nice, but you currently have to rewrite it every time you make a > > new applet, which is kind of annoying. > > ah, so this is a shortcoming of the python scriptengine ... which in turn > is a > limitation in AppletScriptEngine in that you can't get the "standard" > Plasma > config dialog from there. som > > ething like the attached patch which could then be used by the python > engine > to provide a nice method in the interpreter (e.g. > createConfigurationInterface)
The patch doesn't look like it will work to me, in applet.cpp: } else if (d->script) { d->script->showConfigurationInterface(); } else { - d->generateGenericConfigDialog(); + d->generateGenericConfigDialog()->show(); } Here because 'if (d->script)' is true, it will call showConfigurationInterface on the scripting engine which doesn\'t have the KConfigDialog stuff in it. Personally I would rather Simon added the python code as per Benjamin's mail, to the python version of the showConfigurationInterface() method as per the Ruby and C# implementations. A few months ago I did post a mail saying that I would have prefered the hook method in the scripting engine to be createConfigurationInterface() and not showConfigurationInterface(), but Aaron thought that it wouldn't be generic enough as it would be assuming all script engines would want kde style dialogs. Which seems fair enough to me. -- Richard
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel