<br><br><div class="gmail_quote">2009/2/19 Aaron J. Seigo <span dir="ltr"><<a href="mailto:aseigo@kde.org">aseigo@kde.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thursday 19 February 2009, Benjamin Kleiner wrote:<br>
</div><div class="Ih2E3d">> On Thursday, 19. February 2009 16:55:38 Thomas Coopman wrote:<br>
> > I have been running in the same problem and have looked a bit at the code<br>
> > and it looks like createConfigurationInterface is not in AppletScript so<br>
> > there are some changes needed to solve this.<br>
> ><br>
> > But if it is possible to use showConfiguration and get the same dialog I<br>
> > would like to know how too.<br>
><br>
> Well, the following code emulates the wanted behaviour relatively well:<br>
><br>
> def showConfigurationInterface(self):<br>
> dialog = KPageDialog()<br>
> dialog.setFaceType(KPageDialog.List)<br>
> dialog.setButtons( KDialog.ButtonCode(KDialog.Ok | KDialog.Cancel) )<br>
> #The assignment of actions to the buttons happens in<br>
> createConfigurationInterface(), as proposed.<br>
> self.createConfigurationInterface(dialog)<br>
> dialog.exec_()<br>
><br>
> It works nice, but you currently have to rewrite it every time you make a<br>
> new applet, which is kind of annoying.<br>
<br>
</div>ah, so this is a shortcoming of the python scriptengine ... which in turn is a<br>
limitation in AppletScriptEngine in that you can't get the "standard" Plasma<br>
config dialog from there. som<br>
<br>
ething like the attached patch which could then be used by the python engine<br>
to provide a nice method in the interpreter (e.g.<br>
createConfigurationInterface)</blockquote><div>The patch doesn't look like it will work to me, in applet.cpp:<br><br> } else if (d->script) {<br> d->script->showConfigurationInterface();<br> } else {<br>
- d->generateGenericConfigDialog();<br>+ d->generateGenericConfigDialog()->show();<br> }<br> <br></div></div>Here because 'if (d->script)' is true, it will call showConfigurationInterface on the scripting engine which doesn\'t have the KConfigDialog stuff in it. <br>
<br>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. <br><br>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.<br>
<br>-- Richard<br>