mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-93059 "Open" action does nothing if you select a directory which doesn't have .idea under it
This commit is contained in:
@@ -819,7 +819,7 @@ public class Messages {
|
||||
/**
|
||||
* Shows dialog with given message and title, information icon {@link #getInformationIcon()} and OK button
|
||||
*/
|
||||
public static void showInfoMessage(Project project, @Nls String message, @Nls String title) {
|
||||
public static void showInfoMessage(@Nullable Project project, @Nls String message, @Nls String title) {
|
||||
if (canShowMacSheetPanel()) {
|
||||
MacMessages.getInstance().showOkMessageDialog(title, message, OK_BUTTON, WindowManager.getInstance().suggestParentWindow(project));
|
||||
return;
|
||||
|
||||
@@ -88,6 +88,15 @@ public class OpenFileAction extends AnAction implements DumbAware {
|
||||
FileChooser.chooseFiles(descriptor, project, userHomeDir, new Consumer<List<VirtualFile>>() {
|
||||
@Override
|
||||
public void consume(final List<VirtualFile> files) {
|
||||
for (VirtualFile file : files) {
|
||||
if (!descriptor.isFileSelectable(file)) { // on Mac, it could be selected anyway
|
||||
Messages.showInfoMessage(project,
|
||||
file.getPresentableUrl() + " contains no " +
|
||||
ApplicationNamesInfo.getInstance().getFullProductName() + " project",
|
||||
"Cannot Open Project");
|
||||
return;
|
||||
}
|
||||
}
|
||||
doOpenFile(project, files);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user