diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/CvsWizard.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/CvsWizard.java index 9c6a7e2bd076..4b14ec5be781 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/CvsWizard.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/CvsWizard.java @@ -41,6 +41,17 @@ public class CvsWizard extends AbstractWizard { return null; } + @Override + protected void doNextAction() { + if ((myCurrentStep + 1) >= mySteps.size()) return; + final WizardStep nextStep = mySteps.get(myCurrentStep + 1); + if (! nextStep.preNextCheck()) { + return; + } + + super.doNextAction(); + } + public void updateStep() { super.updateStep(); if (getNumberOfSteps() == 0) return; diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCvsElementStep.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCvsElementStep.java index b6fc9148afd9..cad563ee7c46 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCvsElementStep.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCvsElementStep.java @@ -77,18 +77,24 @@ public class SelectCvsElementStep extends WizardStep { errors.set(Boolean.TRUE); } }); - final boolean logged = performer.loginAll( - new ModalityContextImpl(ModalityState.stateForComponent(mySelectCVSConfigurationStep.getComponent()), false), false); + /*final boolean logged = performer.loginAll( + new ModalityContextImpl(ModalityState.stateForComponent(mySelectCVSConfigurationStep.getComponent()), false), false);*/ + final boolean logged = performer.loginAll(new ModalityContextImpl(ModalityState.current(), false), false); if ((! logged) || (! errors.isNull())) { return false; } return true; } + @Override + public boolean preNextCheck() { + CvsRootConfiguration selectedConfiguration = mySelectCVSConfigurationStep.getSelectedConfiguration(); + return isLogged(selectedConfiguration); + } + public boolean setActive() { CvsRootConfiguration selectedConfiguration = mySelectCVSConfigurationStep.getSelectedConfiguration(); - if (! isLogged(selectedConfiguration)) return false; if (myCvsTree == null || !Comparing.equal(myConfiguration, selectedConfiguration)) { myConfiguration = selectedConfiguration; diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/WizardStep.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/WizardStep.java index b010c95a5623..273f76d63d64 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/WizardStep.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/WizardStep.java @@ -53,6 +53,10 @@ public abstract class WizardStep extends StepAdapter{ } + public boolean preNextCheck() { + return true; + } + public abstract boolean nextIsEnabled(); public abstract boolean setActive(); protected abstract JComponent createComponent();