From 279868fade6bc1d94fa00d056e4bb7a519f79325 Mon Sep 17 00:00:00 2001 From: Mikhail Sennikovsky Date: Thu, 26 Apr 2007 20:15:44 +0000 Subject: [PATCH] Fix from Andrew Ferguson to the project creation with small updates --- .../cdt/ui/wizards/CDTCommonProjectWizard.java | 15 ++++++++++++--- .../eclipse/cdt/ui/wizards/IWizardWithMemory.java | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java index caef8120e9f..df180299378 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java @@ -54,7 +54,8 @@ implements IExecutableExtension, IWizardWithMemory private String wz_title; private String wz_desc; - public String lastProjectName = null; + private String lastProjectName = null; + private IPath lastProjectLocation = null; private ICWizardHandler savedHandler = null; protected List localPages = new ArrayList(); // replacing Wizard.pages since we have to delete them @@ -83,7 +84,9 @@ implements IExecutableExtension, IWizardWithMemory * @return true if user has changed settings since project creation */ private boolean isChanged() { - if (savedHandler != fMainPage.h_selected || !fMainPage.getProjectName().equals(lastProjectName)) + if (savedHandler != fMainPage.h_selected + || !fMainPage.getProjectName().equals(lastProjectName) + || !fMainPage.getProjectLocation().equals(lastProjectLocation)) return true; return savedHandler.isChanged(); } @@ -95,6 +98,7 @@ implements IExecutableExtension, IWizardWithMemory savedHandler = fMainPage.h_selected; savedHandler.saveState(); lastProjectName = fMainPage.getProjectName(); + lastProjectLocation = fMainPage.getProjectLocation(); // start creation process invokeRunnable(getRunnable(defaults)); } @@ -112,6 +116,7 @@ implements IExecutableExtension, IWizardWithMemory } catch (CoreException ignore) {} newProject = null; lastProjectName = null; + lastProjectLocation = null; } private boolean invokeRunnable(IRunnableWithProgress runnable) { @@ -154,7 +159,7 @@ implements IExecutableExtension, IWizardWithMemory getShell().getDisplay().syncExec(new Runnable() { public void run() { try { - newProject = createIProject(lastProjectName, fMainPage.getProjectLocation()); + newProject = createIProject(lastProjectName, lastProjectLocation); if (newProject != null) fMainPage.h_selected.createProject(newProject, defaults); } catch (CoreException e) { CUIPlugin.getDefault().log(e); } @@ -222,4 +227,8 @@ implements IExecutableExtension, IWizardWithMemory public String getLastProjectName() { return lastProjectName; } + + public IPath getLastProjectLocation() { + return lastProjectLocation; + } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/IWizardWithMemory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/IWizardWithMemory.java index b2c23ea0ca7..ad6448f1d54 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/IWizardWithMemory.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/IWizardWithMemory.java @@ -10,10 +10,14 @@ *******************************************************************************/ package org.eclipse.cdt.ui.wizards; +import org.eclipse.core.runtime.IPath; import org.eclipse.jface.wizard.IWizard; public interface IWizardWithMemory extends IWizard { // returns name of last-created project // or null if no projects were created public String getLastProjectName(); + + public IPath getLastProjectLocation(); + }