Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Reacting to project option changes

Thanks, this seems to do the trick. I can call event.getNewCProjectDescription() and event.getOldCProjectDescription(), get both configurations from these and compare the values for the option I'm interested in.

Mike

On 17 May 2010 10:28, James Blackburn <jamesblackburn@xxxxxxxxx> wrote:
Hi Mike,

On 17 May 2010 10:13, Mike Wrighton <mike.wrighton@xxxxxxxxxxxxxx> wrote:
Ah ok. Is there any way to detect changes in tool settings e.g. compiler flags etc? I've tried using a valueHandler class but it doesn't seem as if this can catch the event when the option is actually applied i.e. user clicks OK or apply?

I guess it depends on what you're trying to do. The way the MBS UI works is that all the tabs operate on a shared writable project description (held by CDTPropertyManager for the duration of the properties page being open).  They all make changes into this projDesc. On OK / Apply, the changes are committed back.
The result is that you should be able to modify the configuration during the various option value handler events, and if the user presses ok, you changes should be persisted, otherwise they'll be discarded.
The alternative is the project description event. Listen for the ABOUT_TO_APPLY -- at this point the project description (#getNewCProjectDescription()) is still modifiable. You should then be able to use ManagedBuildManager#getConfigurationFoDescription(ICConfigurationDescription) to get the build Configuration.

Cheers,
James


Mike


On 17 May 2010 10:00, James Blackburn <jamesblackburn@xxxxxxxxx> wrote:
Hi Mike,

On 17 May 2010 09:53, Mike Wrighton <mike.wrighton@xxxxxxxxxxxxxx> wrote:
I'm trying to do the same here, but the getDelta() method of CProjectDescriptionEvent seems to always return null, even though I've changed several build settings and clicked apply. I'm wondering if this is a bug or I'm just not using it properly?

Take a look at ICDescriptionDelta. The delta really only contains changes that are visible to the core model, so source paths, excludes, external settings, etc.  Settings which aren't contributed back by build won't show up.

Cheers,
James

Cheers,
Mike


On 6 July 2009 14:11, Christian W. Damus <cdamus@xxxxxxx> wrote:
Hi, Volodya,

I'm glad it works for you!  You are correct that the the project-description delta from the workspace notifies of changes to a different file:  it's the .project file.  The C Project Description file is .cproject.  Happily, there are APIs that let us not not worry about which file is which  ;-)

Cheers,

Christian


On Mon, 2009-07-06 at 17:03 +0400, Vladimir Prus wrote:
On Monday 06 July 2009 Christian W. Damus wrote:

Hi Christian,

> You can attach an ICProjectDescriptionListener to the CoreModel, to be
> notified whenever a project's description changes.  All of the managed
> build settings are stored in the project description.

This appears to be working fine for what I want. I previously
used resource listener, trying to catch deltas with IResourceDelta.DESCRIPTION
flag on project, but presumably that's some different description.

Thanks a lot!

- Volodya
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Christian W. Damus
Software Developer, IDE Team
QNX Software Systems

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top