[Project_owners] Apply Options dialog changes

Chris Means cmeans at spatialpoint.com
Mon Nov 29 22:43:53 EST 2004


Hi Ben,

> >> 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've only just been given access...my code hasn't been checked in yet.

In the meantime, you can pull it off my home server:

http://www.intfar.com/xpis/sahUserStats_v0.3.2.xpi

> > I'm not sure what you want/need, but this might help:
> >
> > // Setup observer
> > observerService =
> > 
> Components.classes["@mozilla.org/observer-service;1"].getService(Compo
> > nents.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.

Yes, I am storing my settings in the prefs.

This sounds like the right approach for me to take.

Thanks.

-Chris



More information about the Project_owners mailing list