ActiveState Community

'Make active project' notification

Posted by bcorfman on 2007-07-16 05:00
OS: All / Any

Yet another notification question ...

I can't find a obsSvc.notifyObservers call in the Komodo source for when 'Make active project' is selected from the Project window. From my JavaScript extension, how can I find out that this event has been fired?

Thanks.

shanec | Mon, 2007-07-16 15:45

I've added three new notifications (nsIObserver notifications) that are sent from the part service (koIPartService). They are:

current_project_changed: sent when the current project is changed, subject is the project (koIProject)

project_added: sent when a project is added to the part service. This happens when the project is being added to the project tab, after it has been loaded from disk. subject is the project (koIProject)

project_removed: sent when a project is removed from the part service. This happens when a project is removed from the project tab (eg. closing a project). subject is the project (koIProject)

These will be available in one of the updates we provide this week.

bcorfman | Tue, 2007-07-17 05:24

Cool, thanks.

bcorfman | Mon, 2008-04-28 06:10

Shane, I'm observing "current_project_changed" notifications in my newest version of kNose (1.1.2). It doesn't seem to do anything. What I'm expecting to happen is when I right-click on a project in the project tree and select "Make active project", I should get a notification in my extension. Is that right?

ToddW | Mon, 2008-04-28 08:51

Hi Brandon,

The notification is failing to be sent because of this bug:
http://bugs.activestate.com/show_bug.cgi?id=75473

Hopefully this will get fixed in the Komodo 4.3.3 build.

Cheers,
Todd