<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">On Thursday, 19. February 2009 16:55:38 Thomas Coopman wrote:<br>
&gt; I have been running in the same problem and have looked a bit at the code<br>
&gt; and it looks like createConfigurationInterface is not in AppletScript so<br>
&gt; there are some changes needed to solve this.<br>
&gt;<br>
&gt; But if it is possible to use showConfiguration and get the same dialog I<br>
&gt; would like to know how too.<br>
Well, the following code emulates the wanted behaviour relatively well:<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>        <span style=" font-weight:600;">def</span> showConfigurationInterface(<span style=" color:#008000;">self</span>):<br>
                dialog = KPageDialog()<br>
                dialog.setFaceType(KPageDialog.List)<br>
                dialog.setButtons( KDialog.ButtonCode(KDialog.Ok | KDialog.Cancel) )<br>
                <span style=" font-style:italic; color:#585858;">#The assignment of actions to the buttons happens in createConfigurationInterface(), as proposed.</span><br>
                self.createConfigurationInterface(dialog)<br>
                dialog.exec_()<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>It works nice, but you currently have to rewrite it every time you make a new applet, which is kind of annoying.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>On Thursday, 19. February 2009 21:15:47 Aaron J. Seigo wrote:<br>
&gt; On Thursday 19 February 2009, Benjamin Kleiner wrote:<br>
&gt; &gt;   I have played around with the python bindings for plasma, and I noticed<br>
&gt; &gt; that the config dialog can't be "hijacked",<br>
&gt;<br>
&gt; so my question to you is, why do you want to do this?<br>
&gt;<br>
&gt; &gt; since<br>
&gt; &gt; plasmascript.Applet.createConfigurationInterface() won't get called, thou<br>
&gt; &gt; you can use showConfiguration to completely override it. Is it supposed<br>
&gt; &gt; to be this way, and if yes, why?<br>
&gt;<br>
&gt; yes, it is supposed to be this way. of course, it is up to the script<br>
&gt; engine itself. it can provide a way to "hijack" the config dialog, but in<br>
&gt; the case of native plasma widgets that's highly discouraged.<br>
&gt;<br>
&gt; ... which brings us back to the first question ;)<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>To answer it all at once and with <a href="http://www.mail-archive.com/plasma-devel@kde.org/msg03263.html"><span style=" text-decoration: underline; color:#e85290;">your own words</span></a>:<br>
<p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'dejavu sans'; color:#000000;">&gt; The Right Approach: reimplement createCofigurationInterface, create your<br />&gt; config dialog page(s) in there and add them to the KConfigDialog you receive<br />&gt; with the addPage method<br />&gt;<br />&gt; The Less Right Approach: reimplement showConfigurationInterface and do it all<br />&gt; from scratch. you will lose certain amounts of Plasma integration this way<br />&gt; (e.g. the "for free" keyboard shortcut page) making it "less right". sometimes<br />&gt; it's necessary.</span></p><p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'dejavu sans';">I also like to quote </span><a href="http://www.mail-archive.com/plasma-devel@kde.org/msg03272.html"><span style=" font-family:'dejavu sans'; text-decoration: underline; color:#e85290;">another mail further in the linked thread</span></a><span style=" font-family:'dejavu sans';">:</span></p><p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'dejavu sans';">&gt; while i'm sure you want your dialog to be its own unique flower in the field,<br />&gt; consider that consistency is far more important than anything you could ever<br />&gt; hope to achieve with this approach.</span></p><p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'dejavu sans';">Maybe you misunderstood me 'cause I used the phrase </span><span style=" font-family:'dejavu sans'; font-style:italic;">hijacking</span><span style=" font-family:'dejavu sans';"> to describe what I wanted:<br />To simply add pages to the standard config dialog, so I get a consistent look and feel.</span></p><p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'dejavu sans';">The code given above is, as you called it, the less right way, though it does the thing.</span></p><p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'dejavu sans';">It would just be nice if this would take place in plasmascript.Applet (like the ruby peeps did), or, even better, a real call with the same KConfigDialog-Object used in C++,<br />so we don't have to rewrite it everytime we do a new applet. Plus newcomers wouldn't clutter the consistency experience with tabbed config dialogs if they would be forced to use </span>showConfigurationInterface.</p></body></html>