diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2008-12-04 13:13:44 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2008-12-04 13:13:44 +0000 |
commit | a076dcde36c0638842d23f3c79f890975a64feb4 (patch) | |
tree | 256cf661ce346c6b7fcfb92ffb7b4759cabe7ee2 | |
parent | Added preferences for Cygwin, MinGW and MSYS paths on windows. (diff) | |
download | rtems-eclipse-plug-in-a076dcde36c0638842d23f3c79f890975a64feb4.tar.bz2 |
Fixed synchronization problem between the wizard and the project properties.
-rw-r--r-- | org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java b/org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java index 8846e6a..d6794fe 100644 --- a/org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java +++ b/org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java @@ -14,6 +14,8 @@ package org.rtems.cdt.wizards; import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPage; import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager; +import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard; +import org.eclipse.core.resources.IProject; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; @@ -71,7 +73,6 @@ public class BasicSetup extends MBSCustomPage { label.setText( "Base path:"); mBasePath = new Text( mComposite, SWT.LEFT | SWT.BORDER); - mBasePath.setText( Storage.getPreference( Constants.BASE_PATH_KEY)); gd = new GridData( GridData.FILL_HORIZONTAL); mBasePath.setLayoutData( gd); @@ -90,7 +91,6 @@ public class BasicSetup extends MBSCustomPage { label.setText( "BSP path:"); mBSPPath = new Text( mComposite, SWT.LEFT | SWT.BORDER); - mBSPPath.setText( Storage.getPreference( Constants.BSP_PATH_KEY)); gd = new GridData( GridData.FILL_HORIZONTAL); mBSPPath.setLayoutData( gd); @@ -170,6 +170,32 @@ public class BasicSetup extends MBSCustomPage { } public void setVisible( boolean visible) { + // Get current project + CDTCommonProjectWizard wizard = (CDTCommonProjectWizard) getWizard(); + IProject project = wizard.getLastProject(); + + /* + * Here we have to take care about the synchronization between the wizard + * and the properties of the new project (advanced settings dialog). + */ + if (visible) { + if (project != null) { + // For already created projects use the properties + mBasePath.setText( Storage.getProperty( project, Constants.BASE_PATH_KEY)); + mBSPPath.setText( Storage.getProperty( project, Constants.BSP_PATH_KEY)); + } else { + // For not yet created projects use the preferences + mBasePath.setText( Storage.getPreference( Constants.BASE_PATH_KEY)); + mBSPPath.setText( Storage.getPreference( Constants.BSP_PATH_KEY)); + } + } else { + if (project != null) { + // Store the wizard values in the properties if the project exists already + Storage.setProperty( project, Constants.BASE_PATH_KEY, mBasePath.getText()); + Storage.setProperty( project, Constants.BSP_PATH_KEY, mBSPPath.getText()); + } + } + mComposite.setVisible( visible); } |