restore "this window" as a default button in the Open Project dialog

This commit is contained in:
Alexey Kudravtsev
2011-09-02 13:48:35 +04:00
parent da77c53141
commit 58489af2ee
2 changed files with 13 additions and 12 deletions
@@ -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]);
@@ -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);