[Okular-devel] handle 'point and click' events (textedit-URIs)

Wilbert Berendsen wbsoft at xs4all.nl
Fri Jan 2 08:15:11 CET 2009


Hi,

I studied the Okular code a bit more and I see it is quite configurable 
indeed.

But if there is no way for a parent application (that embeds Okular) to be 
called when the user clicks a textedit:// link, my nice Frescobaldi editor 
will stop working in KDE 4.2 and I couldn't do anything about it. :-(

I certainly can live with textedit:/ handling inside Okular, but then we 
should arrange a way for applications to override the default handling (open a 
configured editor). That could be done via an environment variable, like it is 
currently done in ktextedtitservice.cpp (part of lilypond-kde4). (Specalized 
LilyPond-editors set the environment variable if they want to interact with an 
embedded Okular directly. Qt signals could be nice too, of course, but still 
there should be a way to override the default handling.)

See http://code.google.com/p/lilykde/source/browse/trunk/lilypond-
kde4/ktexteditservice.cpp (one line).

If the environment variable TEXTEDIT_DBUS_PATH is set, it is expected to 
contain the DBus name and the path of a DBus object. The method 
'openTextEditUrl( url )' is then called on that object using the interface 
'org.lilypond.TextEdit'.

Some of the code from my ktexteditservice.cpp could be moved to Okular, so 
that Frescobaldi (and possible other specialized LilyPond editors that embed 
Okular) remain working in KDE 4.2

I will try to bake up a patch that checks the environment and performs a DBus-
call. Also a "Let KDE handle textedit urls" option could be added to the 
texteditor settings dialog that leaves handling of textedit urls to KDE 
(KRun).

with best regards,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
        -- Mahatma Gandhi



More information about the Okular-devel mailing list