<br><br><div class="gmail_quote">2009/2/19 Aaron J. Seigo <span dir="ltr">&lt;<a href="mailto:aseigo@kde.org">aseigo@kde.org</a>&gt;</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">&gt; On Thursday, 19. February 2009 16:55:38 Thomas Coopman wrote:<br>
&gt; &gt; I have been running in the same problem and have looked a bit at the code<br>
&gt; &gt; and it looks like createConfigurationInterface is not in AppletScript so<br>
&gt; &gt; there are some changes needed to solve this.<br>
&gt; &gt;<br>
&gt; &gt; But if it is possible to use showConfiguration and get the same dialog I<br>
&gt; &gt; would like to know how too.<br>
&gt;<br>
&gt; Well, the following code emulates the wanted behaviour relatively well:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; def showConfigurationInterface(self):<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dialog = KPageDialog()<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dialog.setFaceType(KPageDialog.List)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dialog.setButtons( KDialog.ButtonCode(KDialog.Ok | KDialog.Cancel) )<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #The assignment of actions to the buttons happens in<br>
&gt; createConfigurationInterface(), as proposed.<br>
&gt; self.createConfigurationInterface(dialog)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dialog.exec_()<br>
&gt;<br>
&gt; It works nice, but you currently have to rewrite it every time you make a<br>
&gt; 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&#39;t get the &quot;standard&quot; 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&#39;t look like it will work to me, in applet.cpp:<br><br>&nbsp;&nbsp;&nbsp;&nbsp; } else if (d-&gt;script) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;script-&gt;showConfigurationInterface();<br>&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;generateGenericConfigDialog();<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;generateGenericConfigDialog()-&gt;show();<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;<br></div></div>Here because &#39;if (d-&gt;script)&#39; is true, it will call showConfigurationInterface on the scripting engine which doesn\&#39;t have the KConfigDialog stuff in it. <br>
<br>Personally I would rather Simon added the python code as per Benjamin&#39;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&#39;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>