Javascript and notifications help

asdfgh ertyhn alanis.elise at hotmail.com
Sat Mar 20 00:28:24 CET 2010




> From: aseigo at kde.org
> To: plasma-devel at kde.org
> Subject: Re: Javascript and notifications help
> Date: Fri, 19 Mar 2010 13:20:31 -0700
> CC: alanis.elise at hotmail.com
> 
> hi Alanis ...
> 
> On March 19, 2010, asdfgh ertyhn wrote:
> > I'm trying to use the notifications service within my javascript plasmoid
> > in order to display a nice popup notification on certain events, but I'm
> 
> you know, this is a "funny" topic: it's not something i figured would be 
> overly critical but it's something a lot of people want to do from their 
> javascript plasmoid. so i had (obviously mistakenly) delayed this feature 
> until the 4.5 release this summer (Javascript API v2).
> 
> short story: there is no good way of doing it right now.
> 
> longer story: i or someone likes me needs to write a small C++ Service plugin 
> (does not need to be related to a data engine at all, in fact, though it 
> probably could make sense as part of the Notifications engine as well) to do 
> this. 
> 
> sorry for the horrible news. :/

Nevermind, I'll wait for the 4.5 release then :)
> 
> > stuck with its initialization. Looking at the API ( service(string
> > dataEngineName, string sourceName) ), I wrote something like:
> > 
> > job = service("notifications",)
> > 
> > but then I was stuck on the meaning of the second parameter. Could you
> > explain what you mean with "sourceName" please? Furthermore, looking at
> 
> the source name is what the entry is called in the DataEngine. the idea is 
> this:
> 
> you have a DataEngine and your are connected to one of the pieces of 
> information it provides. in the Hotplug engine (which announces events like 
> when you plug in a USB stick, for instance) this might be a disk drive. 
> 
> then you want to interact with it. in the Hotplug engine case, maybe you want 
> to request that the disk be mounted. at that point you ask for the service for 
> that source, and you do so by asking the DataEngine to give you a service for 
> the source by that name.
> 
> a concept we don't have is a "default service" for a DataEngine: you always 
> need to ask for the service for a given source.
> 
> in the case of a service-without-a-source, as in the case of notifications, 
> one can ask directly for a Service without going through a DataEngine.
> 

That's great, thanks for the comprehensive elucidation.

> for notifications, that Service needs to be written still.
> 
> -- 
> Aaron J. Seigo
> humru othro a kohnu se
> GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43
> 
> KDE core developer sponsored by Qt Development Frameworks

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
to keep all the source code samples organized in one place), you rock guys.
I really love Javascript bindings, it avoids me using languages such as c++ that drives me crazy :)

-- Alanis

 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20100319/028dc701/attachment.html 


More information about the Plasma-devel mailing list