<div dir="ltr"><br><br><div class="gmail_quote">2008/9/11 Petri Damstén <span dir="ltr"><<a href="mailto:petri.damsten@gmail.com">petri.damsten@gmail.com</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;">
Hi,<br>
<br>
I have been playing with webkit AppletScript. There is a small example<br>
(webkit/code/test.html) using plasma dataengines so I have added more<br>
functions (init(), engine.connectSource(), etc.) and plasma package support so<br>
it looks more like a normal plasma applet.<br>
<br>
Applets connect to apply & ok to know when user accepted config, but if<br>
AppletScript uses configxml there seems to be no way to do that? Maybe<br>
configAccepted signal in applet? I guess this could be good for Applets too so<br>
they don't have to rely parent to have ok/apply.</blockquote>The biggest problem with using configxml with script engine based applets is in this code where it tests 'if (d->script) {' and then leaves early. I've no idea what script engine applets would want to do that is different from a normal applet as the whole point of configxml is that it is a sort of 'fire and forget' api that doesn't actually need any programmer intervention to use.<br>
<br> if (d->package && d->configXml) {<br> QString uiFile = d->package->filePath("mainconfigui");<br> if (uiFile.isEmpty()) {<br> return;<br> }<br><br> KConfigDialog *dialog = new KConfigDialog(0, dialogId, d->configXml);<br>
dialog->setWindowTitle(windowTitle);<br> dialog->setAttribute(Qt::WA_DeleteOnClose, true);<br><br> QUiLoader loader;<br> QFile f(uiFile);<br> if (!f.open(QIODevice::ReadOnly)) {<br>
delete dialog;<br><br> if (d->script) {<br> d->script->showConfigurationInterface();<br> }<br> return;<br> }<br><br> QWidget *w = loader.load(&f);<br>
f.close();<br><br> dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name()));<br> dialog->show();<br> } else if (d->script) {<br><br>-- Richard<br></div>
<br></div>