[Project_owners] Apply Options dialog changes

Ben Bucksch ben.bucksch.news at beonex.com
Mon Nov 29 20:00:51 EST 2004


HJ wrote:

> Chris Means wrote:
>
>> I'm finishing up an extension that updates the status bar with a users'
>> current SETI @ Home statistics.
>
Where's your project hosted (i.e. URL)?

> I'm not sure what you want/need, but this might help:
>
> // Setup observer
> observerService = 
> Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); 
>
> observerService.addObserver(setiObserver, "updateSETI", false);
>
> // Trigger update (should be used in Options dialog)
> observerService.notifyObservers(null, "updateSETI", "update");

There's a special observer for pref changes (assuming your options are 
stored in Mozilla's pref.js), see e.g. nsHttpHandler::Init() in 
netwerk/protocols/http/. Not sure why they use (the internal) 
nsIPrefBranchInternal, though.

Ben


More information about the Project_owners mailing list