[PATCH] Support for title in notifications

Aurélien Gâteau aurelien.gateau at canonical.com
Wed Apr 8 10:30:25 BST 2009


Olivier Goffart wrote:
> Le Tirsdag 7 april 2009, Aurélien Gâteau a écrit :
>> Hi,
>>
>> Right now, the notifications implemented by Plasma can display a text
>> and an optional title. Unfortunately, it is not possible to define a
>> custom title with KNotification (it's possible with kdialog, though,
>> because it talks to Plasma directly)
>>
>> There is some discussion going on on freedesktop xdg ml about getting
>> Galago and KDE notifications to agree on a common spec. Adding support
>> for title is imho a necessary step in this direction.
> 
> I haven't seen any discussion regarding the title there.

True, but while I was working on this, I figured a necessary step to
agree on a common spec is to have as much common features as possible.

Thinking of it a bit more, I realize it does not really concerns this
common spec, since both the Galago and KDE notification DBus API support
titles. Realizing that KNotification does not support them but kdialog
does, I thought it would be a step in the right direction to add support
for titles to KNotification.

> It is not well defined what goes into title, and what goes into message.
> 
> Also, i see that this will be a source of confusion. For example, should 
> applications repeat or not the title in the message?  I see some application 
> using only the title.
> 
> But the point is that the title doesn't appears in the log, is not spoken with 
> ktts, is not in any other presentation 'plugin'. so if you don't repeat the 
> title in the message, you loose information in others presentation (might be 
> fixed by adding support for it in each every presentation).

You already loose information: the notification text is lost when you
use a sound notification. Adding the title to the log and to ktts should
be easy. I can update my changes to add this.

> 
> Bref: i think knotify4 should come with a title such as "Notification from 
> fooapp" or might even take a title from the .notifyrc file.
> But we should not necesserly add that to KNotification just "because the 
> galago specification has it"

As I said, it's not "the galago specification has it", both galago and
kde specifications have it.

> Unless you come with good uses case. I don't think a dynamic title is required 
> in the documentation.

It allows for smaller notifications. In the case of Kopete, if you move
the contact name to the title, you will use less height for the body and
the notification implementation could take this into account to display
less thinner notifications. You can have a look at mockups from the
NotifyOSD [1] wiki page for an example.

[1]: https://wiki.ubuntu.com/NotifyOSD#Inside%20the%20bubble


Answering your concern about DBus binary compatibility from your other
message: I can adjust my changes to introduce a new method: setTitle(id,
title) and keep the existing methods as they are. This should be BC I think.

Aurélien




More information about the kde-core-devel mailing list