<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<br><br>> From: aseigo@kde.org<br>> To: plasma-devel@kde.org<br>> Subject: Re: Javascript and notifications help<br>> Date: Fri, 19 Mar 2010 13:20:31 -0700<br>> CC: alanis.elise@hotmail.com<br>> <br>> hi Alanis ...<br>> <br>> On March 19, 2010, asdfgh ertyhn wrote:<br>> > I'm trying to use the notifications service within my javascript plasmoid<br>> > in order to display a nice popup notification on certain events, but I'm<br>> <br>> you know, this is a "funny" topic: it's not something i figured would be <br>> overly critical but it's something a lot of people want to do from their <br>> javascript plasmoid. so i had (obviously mistakenly) delayed this feature <br>> until the 4.5 release this summer (Javascript API v2).<br>> <br>> short story: there is no good way of doing it right now.<br>> <br>> longer story: i or someone likes me needs to write a small C++ Service plugin <br>> (does not need to be related to a data engine at all, in fact, though it <br>> probably could make sense as part of the Notifications engine as well) to do <br>> this. <br>> <br>> sorry for the horrible news. :/<br><br>Nevermind, I'll wait for the 4.5 release then :)<br>> <br>> > stuck with its initialization. Looking at the API ( service(string<br>> > dataEngineName, string sourceName) ), I wrote something like:<br>> > <br>> > job = service("notifications",)<br>> > <br>> > but then I was stuck on the meaning of the second parameter. Could you<br>> > explain what you mean with "sourceName" please? Furthermore, looking at<br>> <br>> the source name is what the entry is called in the DataEngine. the idea is <br>> this:<br>> <br>> you have a DataEngine and your are connected to one of the pieces of <br>> information it provides. in the Hotplug engine (which announces events like <br>> when you plug in a USB stick, for instance) this might be a disk drive. <br>> <br>> then you want to interact with it. in the Hotplug engine case, maybe you want <br>> to request that the disk be mounted. at that point you ask for the service for <br>> that source, and you do so by asking the DataEngine to give you a service for <br>> the source by that name.<br>> <br>> a concept we don't have is a "default service" for a DataEngine: you always <br>> need to ask for the service for a given source.<br>> <br>> in the case of a service-without-a-source, as in the case of notifications, <br>> one can ask directly for a Service without going through a DataEngine.<br>> <br><br>That's great, thanks for the comprehensive elucidation.<br><br>> for notifications, that Service needs to be written still.<br>> <br>> -- <br>> Aaron J. Seigo<br>> humru othro a kohnu se<br>> GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43<br>> <br>> KDE core developer sponsored by Qt Development Frameworks<br><br>I want to thank a lot Aaron and Marco for the hints they gave me ( I've googled for kdeexamples and I think it's an awesome idea<br>to keep all the source code samples organized in one place), you rock guys.<br>I really love Javascript bindings, it avoids me using languages such as c++ that drives me crazy :)<br><br>-- Alanis<br><br>                                            <br /><hr />Hotmail: Trusted email with powerful SPAM protection. <a href='https://signup.live.com/signup.aspx?id=60969' target='_new'>Sign up now.</a></body>
</html>