Passive Notifications in Kate Part

In KDE 4.10, Kate Part got a new MessageInterface. The idea of this interface is to have a standardized way of showing notifications in a non-intrusive way, similar to how KMessageWidget in kdelibs works. Using the MessageInterface is extremly easy, for instance to show a quick notification, you write

KTextEditor::Message *message = new KTextEditor::Message(KTextEditor::Message::Positive,
                                                         "Code successfully reformated.");
document->postMessage(message);

That’s basically it! The result looks like this (with a nice fade-in and fade-out animation):

As developer, once you called postMessage(), you can safely forget the message pointer. It’s automatically deleted either if the user closes the notification, or if the document is closed or reloaded. The API for more tricks. You can add multiple actions through KTextEditor::Message::addAction(), which then appear as buttons. For each added action, you can control whether triggering the action should close the widget or not.

Further, you can set an auto hide timer through Message::setAutoHide(int timeInMilliSeconds).

If you want a message to only appear in one specific KTextEditor::View of the Document, you just call Message::setView() before calling postMessage(). If several messages are in the queue, the one with the highest Message::priority() is shown first.

This notification system is already used in Kate Part by the data recovery (swap files), or to show a notification when loading remote files, and in some other places.

The cool thin is that this solution requires no special code in KateView or other classes, hence, it’s a perfectly clean solution with an easy-to-use API. You as KTextEditor user (developer) should definitely consider using it when it’s public.

Note: The MessageInterface is a KTextEditor interface; however, since the 4.10 branch is frozen for BIC changes, we cannot just add this interface for KDE 4.10. Instead, for Kate Part users (Kile, KDevelop, …) this interface will only be available in KDE5.

Finally, an example of all four message types: Positive, Information, Warning and Error:

Kate needs BiDi/Unicode aware developers ;)

During our long bug hunting and fixing sprint I came along some nasty BiDi or Unicode related bugs.

I and most others in the Kate team are not really able to fix such issues :( We lack both the knowledge of the underlying techniques and are not able to write/read any language that really uses complex unicode chars or BiDi text.

Therefore: If you know Qt and you want to help out with fixing BiDi/Unicode related bugs, please provide patches for them in the KDE Bugzilla!

Here are the relevant bugs:

Any help here is highly appreciated! If you have questions about the internals of KatePart needed to fix such an issue, just ask in the bug or kwrite-devel@kde.org.

Busy Kate/KDevelop Sprint results in Mini-Map

One of the results of the Kate/KDevelop sprint in Vienna is the new “MiniMap” that can be used instead of the vertical scrollbar. I came to the sprint with a black and white version of it for the symbols viewer, but got encouraged to integrate it to the core. The result, in cooperation with Sven Brauch from KDevelop, is a nice Mini-Map that can be enabled both in Kate and KDevelop.

And to make this into a real blog and to provide proof, here are a couple of screenshots:

The MiniMap enabled

Here is where/how you turn it on in Kate