From fe2cc5e4fd29cc7e830166698dc3ddc4cd60771d Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Fri, 16 Oct 2009 15:10:50 +0000 Subject: [PATCH] bug 292304: XLC New Project Wizard does not like change of heart when users switch from other wizards Patch from Marc-Andre Laperle --- .../xlc/ui/wizards/XLCSettingsWizardPage.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java index da6c672cd5a..cfc4f7d06a0 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java @@ -63,8 +63,6 @@ public class XLCSettingsWizardPage extends MBSCustomPage { } } - private boolean fVisited = false; - private Composite fComposite = null; private Text fDirTextBox; @@ -76,6 +74,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { */ public XLCSettingsWizardPage(String pageID) { super(pageID); + setDefaultPreferences(pageID); } /** @@ -83,14 +82,20 @@ public class XLCSettingsWizardPage extends MBSCustomPage { */ public XLCSettingsWizardPage() { super(PAGE_ID); + setDefaultPreferences(PAGE_ID); + } + + private void setDefaultPreferences(String pageID) { + String compilerPath = XLCUIPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.P_XL_COMPILER_ROOT); + MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XL_COMPILER_ROOT, compilerPath); + MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, PreferenceConstants.P_XL_COMPILER_VERSION_8); } /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPage#isCustomPageComplete() */ protected boolean isCustomPageComplete() { - // Don't allow the user to finish without visiting the page. - return fVisited; + return true; } /* (non-Javadoc) @@ -282,10 +287,6 @@ public class XLCSettingsWizardPage extends MBSCustomPage { */ public void setVisible(boolean visible) { fComposite.setVisible(visible); - if (visible) { - fVisited = true; - } - } }