diff --git a/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java b/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java index 391055a788ac..1e2c60b20114 100644 --- a/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java +++ b/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java @@ -200,9 +200,12 @@ public class NewProjectUtil { final GeneralSettings settings = GeneralSettings.getInstance(); int exitCode = settings.getConfirmOpenNewProject(); if (exitCode == GeneralSettings.OPEN_PROJECT_ASK) { - exitCode = Messages.showOkCancelDialog(projectToClose, IdeBundle.message("prompt.open.project.in.new.frame"), IdeBundle.message("title.new.project"), - IdeBundle.message("button.existingframe"), IdeBundle.message("button.newframe"), - Messages.getQuestionIcon(), new ProjectNewWindowDoNotAskOption()); + exitCode = Messages.showOkCancelDialog(projectToClose, + IdeBundle.message("prompt.open.project.in.new.frame"), + IdeBundle.message("title.new.project"), + IdeBundle.message("button.existingframe"), + IdeBundle.message("button.newframe"), + Messages.getQuestionIcon(), new ProjectNewWindowDoNotAskOption()); } if (exitCode == DialogWrapper.OK_EXIT_CODE) { // "No" option ProjectUtil.closeAndDispose(projectToClose != null ? projectToClose : openProjects[openProjects.length - 1]); diff --git a/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java b/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java index f5613fde8de9..dde191e12a0b 100644 --- a/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java +++ b/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java @@ -182,13 +182,12 @@ public class ProjectUtil { if (settings.getConfirmOpenNewProject() == GeneralSettings.OPEN_PROJECT_ASK) { return Messages.showYesNoCancelDialog(IdeBundle.message("prompt.open.project.in.new.frame"), IdeBundle.message("title.open.project"), + IdeBundle.message("button.existingframe"), IdeBundle.message("button.newframe"), - IdeBundle.message("button.existingframe"), - CommonBundle.getCancelButtonText(), Messages.getQuestionIcon(), + CommonBundle.getCancelButtonText(), Messages.getQuestionIcon(), new ProjectNewWindowDoNotAskOption()); - } else { - return settings.getConfirmOpenNewProject(); } + return settings.getConfirmOpenNewProject(); } private static boolean isSameProject(String path, Project p) { @@ -203,11 +202,10 @@ public class ProjectUtil { final File openFile = new File(toOpen); if (openFile.isDirectory()) { return FileUtil.pathsEqual(toOpen, existingBaseDir.getPath()); - } else { - if (StorageScheme.DIRECTORY_BASED == projectStore.getStorageScheme()) { - // todo: check if IPR is located not under the project base dir - return FileUtil.pathsEqual(FileUtil.toSystemIndependentName(openFile.getParentFile().getPath()), existingBaseDir.getPath()); - } + } + if (StorageScheme.DIRECTORY_BASED == projectStore.getStorageScheme()) { + // todo: check if IPR is located not under the project base dir + return FileUtil.pathsEqual(FileUtil.toSystemIndependentName(openFile.getParentFile().getPath()), existingBaseDir.getPath()); } return FileUtil.pathsEqual(toOpen, existing);