Applet::flushPendingConstraintsEvents() calls setHasConfigurationInterface(true)

Aaron J. Seigo aseigo at kde.org
Mon Jan 19 22:16:25 CET 2009


On Monday 19 January 2009, Richard Dale wrote:
> Niels Slot and myself were looking at a problem with the Ruby tutorial
> applet, in that it was ignoring setHasConfigurationInterface(false) calls
> in its init() method. When I looked at the Plasma::Applet applet.cpp code
> there is a call to see it to true in flushPendingConstraintsEvents().

this was to make it possible to have keyboard shortcuts for all widgets. the 
default is that all widgets do have them, and widgets should have to take 
explicit action to avoid it.

more of the "do the default thing by policy".

i put it i the constraints event so that i wouldn't have to go hunting for 
every call to setHasConfigurationInterface(false) out there and remove it. as 
this changed happened late in the 4.2 cycle this was a sure fire way to get 
the config dialog everywhere it needed to be.

with 4.3 open, though, i can probably go the long route now.

> Is this correct? It isn't obvious why the call is here, but it does mean
> that scripting applets can't turn off their configuration interface.

MyAppletScript::constraintsEvent(Plasma::Constraints constraints)
{
     if (constraints & Plasma::StartupCompletedConstraint) {
        setHasConfigurationInterface(false);
    }
}

alternatively, it could:

* catch if setHasConfigurationInterface(false) is ever called and not set it 
to true itself, so it becomes an implied default

* move it to the ctor .... which is essentially the same thing now that i 
think about it

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090119/26e905d2/attachment.sig 


More information about the Plasma-devel mailing list