mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-135612 Git clone dialog: create parent dir automatically
Warn only if it can't be created or is not writeable
This commit is contained in:
@@ -94,6 +94,17 @@ public abstract class CloneDvcsDialog extends DialogWrapper {
|
||||
setOKButtonText(DvcsBundle.getString("clone.button"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doOKAction() {
|
||||
File parent = new File(getParentDirectory());
|
||||
if (parent.exists() && parent.isDirectory() && parent.canWrite() || parent.mkdirs()) {
|
||||
super.doOKAction();
|
||||
return;
|
||||
}
|
||||
setErrorText("Couldn't create " + parent + "<br/>Check your access rights");
|
||||
setOKActionEnabled(false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getSourceRepositoryURL() {
|
||||
return getCurrentUrlText();
|
||||
@@ -215,11 +226,6 @@ public abstract class CloneDvcsDialog extends DialogWrapper {
|
||||
setOKActionEnabled(false);
|
||||
return false;
|
||||
}
|
||||
else if (!file.getParentFile().exists()) {
|
||||
setErrorText(DvcsBundle.message("clone.parent.missing.error", file.getParent()));
|
||||
setOKActionEnabled(false);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user