[Kde-bindings] discrepancy in python bindings for plasma
Richard Dale
rdale at foton.es
Wed Feb 18 21:51:15 UTC 2009
On Wednesday 18 February 2009 21:37:14 Simon Edwards wrote:
> Hello,
>
> Benjamin Kleiner wrote:
> > I have played around with the python bindings for plasma, and I noticed
> > that the config dialog can't be "hijacked", since
> > plasmascript.Applet.createConfigurationInterface() won't get called,
> > thou you can use showConfiguration to completely override it. Is it
> > supposed to be this way, and if yes, why?
>
> The scripted applet API doesn't fully mirror the C++ Applet API, and
> you'll have to ask the Plasma team as to why that it. Personally, I
> haven't missed createConfigurationInterface() in my plasma experiments.
> If it bothers you, you could put in a request to the Plasma people.
For Ruby, I reimplemented the C++ showConfigurationInterface() method and
called createConfigurationInterfacer() from that:
# Override this in your scripting applet
def createConfigurationInterface(dialog)
end
def showConfigurationInterface
dialogId =
"#{@applet_script.applet.id}settings#{@applet_script.applet.name}"
windowTitle = KDE::i18nc("@title:window", "%s Settings" %
@applet_script.applet.name)
@nullManager = KDE::ConfigSkeleton.new(nil)
@dialog = KDE::ConfigDialog.new(nil, dialogId, @nullManager)
@dialog.faceType = KDE::PageDialog::Auto
@dialog.windowTitle = windowTitle
@dialog.setAttribute(Qt::WA_DeleteOnClose, true)
createConfigurationInterface(@dialog)
# TODO: would be nice to not show dialog if there are no pages added?
# Don't connect to the deleteLater() slot in Ruby as it causes crashes
# connect(@dialog, SIGNAL(:finished), @nullManager, SLOT(:deleteLater))
# TODO: Apply button does not correctly work for now, so do not show
it
@dialog.showButton(KDE::Dialog::Apply, false)
@dialog.show
end
-- Richard
More information about the Kde-bindings
mailing list