From kde-core-devel Thu Sep 03 22:05:02 2009 From: John Tapsell Date: Thu, 03 Sep 2009 22:05:02 +0000 To: kde-core-devel Subject: Re: [PATCH] Detecting notification popup server capabilities Message-Id: <43d8ce650909031505x4779b4fbn2a5a1ee3a5289a71 () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=125201556605046 2009/9/3 Marco Martin : > On 8/28/09, Aurélien Gâteau 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.