[PATCH] Detecting notification popup server capabilities

John Tapsell johnflux at gmail.com
Thu Sep 3 23:05:02 BST 2009


2009/9/3 Marco Martin <notmart at gmail.com>:
> On 8/28/09, Aurélien Gâteau <aurelien.gateau at canonical.com> wrote:
>> Sebastian Trüg a écrit :
>>> sounds like a weird solution to me. What are apps supposed to do in such a
>>>
>>> case? Just not add actions? That can be handled on another level I
>>> suppose.
>>
>> I was indeed thinking about this: just letting knotify discard the
>> action if the notification server does not support them. I can easily
>> provide a patch to do this.
> that's the best way
>
>>
>> Still, I think it's useful to let applications know whether actions are
>> supported or not. This way they can switch to other means of
> they are really a model/view approach, and the model shouldn't need to
> know about the view

I think it's reasonable for applications to optionally provide a
second string. E.g.

 KNotification *notify=new KNotification("new_message");
 notify->setText(i18n("Download complete.  Click view to view") ,
message->from() );
 notify->setActions( i18n("View,Ignore").split(',') );
 notify->setNoActionText(i18n("Download complete"));


I can't think of a decent example where you'd want different text when
no actions are available, but maybe also useful so that you could do
notify->setNoActionText("")  or something for the action to be ignored
if actions aren't supported.




More information about the kde-core-devel mailing list