|
|
This class provides a method for issuing events to a KNotifyServer call KNotifyClient::event("eventname"); to issue it. On installation, there should be a file called $KDEDIR/share/apps/appname/eventsrc which contains the events.
The file looks like this:
[!Global!] Name=executable Comment=FriendlyNameOfApp [eventname] Name=FriendlyNameOfEvent Comment=Description Of Event default_sound=filetoplay.wav default_presentation=1 ...
default_presentation contains these ANDed events: None=0, Sound=1, Messagebox=2, Logfile=4, Stderr=8
You can also use the following events, which are system controlled and do not need to be placed in your eventsrc:
cannotopenfile (more to come)
This class works, but is still in testing.
|
The Default constructor. You should have little use for this thanks to the event method. This will launch the KNotify service if needed.
Parameters:
message | The event type to send, such as "Desktop1" for a virtual desktop change |
text | If you need to send off a message with your alert. This will happen for an error level of 2 or more. |
present | How to present it. If "Default" is chosen, the server will decide according to the config |
sound | The sound to play (KDEDIR/share/sounds/ if not absolute) |
file | file to write to (if selected) |
client | The DCOPClient to use. Usually it pulls the one from your KApplication. |
bool |
[slot]
If you need to send a message a whole lot sequentially, for reasons I don't want to know, you might instanciate a KNotifyClient, and call this function when needed.
bool |
[static]
This should be the most used method in here. Call it by KNotifyClient::event("EventName"); It will use KApplication::kApplication->dcopClient() to communicate to the server
Parameters:
message | The name of the event |
text | The text to put in a dialog box. This won't be shown if the user connected the event to sound, only. |
bool |
[static]
Will fire an event that's not registered.
Parameters:
text | The error message text, if applicable |
present | The error message level, defaulting to "Default" |
file | The sound file to play if selected with present |
int |
[static]
Gets the presentation associated with a certain event name Remeber that they may be ORed: if (present & KNotifyClient::Sound) { [Yes, sound is a default] }
QString |
[static]
Gets the default file associated with a certain event name The control panel module will list all the event names This has the potential for being slow.
int |
[static]
Gets the default presentation for the event of this program. Remember that the Presentation may be ORed. Try this: if (present & KNotifyClient::Sound) { [Yes, sound is a default] }
QString |
[static]
Gets the default File for the event of this program. It gets it in relation to present. Some events don't apply to this function ("Message Box") Some do (Sound)