KNotifyClient addition

Jason Keirstead jason at keirstead.org
Wed Apr 2 19:58:07 BST 2003


I have a proposal for KNotifyClient::userEvent and ::event that I think would be very very usefull to a number
of apps. I brought it up in a thread before but didn't get much feedback.

Here is the current KNotifyClient::userEvent, and ::event

	bool userEvent (const QString &text=QString::null, int present=Default, int level=Default,
		const QString &sound=QString::null, const QString &file=QString::null)

	bool event (const QString &message, const QString &text=QString::null)

	bool event (StandardEvent event, const QString &text=QString::null)

What I propose is adding these 2 new optional paramaters to these functions:

	const QString &actionText = QString::null, const char* actionSignal

What this would do, is if the event was a graphical event( A KMessageBox or a KPassivePopup ), it would
add a means to the notification to signify a response to the program..

I envision in the KMessageBox circumstance, if these arguments are provided, instead of the "Ok"
button, the user would be presented with a Button with actionText on it, connected to a new signal
added to KNotifier. A pointer to this signal would be returned with actionSignal. A second button labeled
"Ignore" would close the message box without firing the signal.

For a KPassivePopup, a hyperlink style link could be creatted with the actionText on it, that would
fire the actionSignal if clicked before the popup vanished.

The purpose of this proposal would be to allow an app to get some feedback RE the notification.
One example would be KMail's "New Mail" event. Currently, if you turn on a passive popup or 
message box for this event, all thebox does is poop up and say that you have new mail. Once
dismissed, you have to go to the KMail window, find the message, click on it, etc. With this
API addition, the box could simply have a "View" option in the box, that opened the email
immediately.

This is just one small example to illustrate how usefull it could be.

If I get positive feedback regarding this I could implement the functionality in
KNotifyClient myself.

-- 
Jason Keirstead, BCS
http://www.keirstead.org




More information about the kde-core-devel mailing list