mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not create frame if no opened projects
GitOrigin-RevId: 18974d21ea368408a17b2dba038b71a2bebc9c35
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0899b035e7
commit
06c72f51cd
@@ -501,12 +501,11 @@ public class RecentProjectsManagerBase extends RecentProjectsManager implements
|
||||
|
||||
@Nullable
|
||||
public Project doOpenProject(@NotNull @SystemIndependent String projectPath,
|
||||
Project projectToClose,
|
||||
@Nullable Project projectToClose,
|
||||
boolean forceOpenInNewFrame,
|
||||
@Nullable IdeFrame frame) {
|
||||
VirtualFile dotIdea = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(
|
||||
new File(projectPath, Project.DIRECTORY_STORE_FOLDER));
|
||||
|
||||
VirtualFile dotIdea = LocalFileSystem.getInstance()
|
||||
.refreshAndFindFileByPath(FileUtilRt.toSystemIndependentName(projectPath) + "/" + Project.DIRECTORY_STORE_FOLDER);
|
||||
if (dotIdea != null) {
|
||||
EnumSet<PlatformProjectOpenProcessor.Option> options = EnumSet.of(PlatformProjectOpenProcessor.Option.REOPEN);
|
||||
if (forceOpenInNewFrame) options.add(PlatformProjectOpenProcessor.Option.FORCE_NEW_FRAME);
|
||||
@@ -610,12 +609,11 @@ public class RecentProjectsManagerBase extends RecentProjectsManager implements
|
||||
}
|
||||
|
||||
protected boolean willReopenProjectOnStart() {
|
||||
return GeneralSettings.getInstance().isReopenLastProject() && getLastProjectPath() != null;
|
||||
return getLastProjectPath() != null && GeneralSettings.getInstance().isReopenLastProject();
|
||||
}
|
||||
|
||||
protected void doReopenLastProject(@Nullable IdeFrame frame) {
|
||||
GeneralSettings generalSettings = GeneralSettings.getInstance();
|
||||
if (!generalSettings.isReopenLastProject()) {
|
||||
if (!GeneralSettings.getInstance().isReopenLastProject()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -629,7 +627,7 @@ public class RecentProjectsManagerBase extends RecentProjectsManager implements
|
||||
}
|
||||
}
|
||||
|
||||
if (frame == null) {
|
||||
if (!openPaths.isEmpty() && frame == null) {
|
||||
Activity activity = StartUpMeasurer.start("showFrame");
|
||||
frame = ((WindowManagerImpl)WindowManager.getInstance()).showFrame(SplashManager.getHideTask());
|
||||
activity.end();
|
||||
|
||||
+4
-1
@@ -18,6 +18,7 @@ import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.project.ProjectManagerListener;
|
||||
import com.intellij.openapi.util.DimensionService;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.wm.*;
|
||||
import com.intellij.openapi.wm.impl.IdeFrameImpl;
|
||||
import com.intellij.openapi.wm.impl.IdeGlassPaneImpl;
|
||||
@@ -174,7 +175,9 @@ public class WelcomeFrame extends JFrame implements IdeFrame, AccessibleContextA
|
||||
((JFrame)frame).setVisible(true);
|
||||
IdeMenuBar.installAppMenuIfNeeded((JFrame)frame);
|
||||
ourInstance = frame;
|
||||
ourTouchbar = TouchBarsManager.showDialogWrapperButtons(frame.getComponent());
|
||||
if (SystemInfoRt.isMac) {
|
||||
ourTouchbar = TouchBarsManager.showDialogWrapperButtons(frame.getComponent());
|
||||
}
|
||||
}
|
||||
|
||||
public static void showIfNoProjectOpened() {
|
||||
|
||||
@@ -198,7 +198,9 @@ public class PlatformProjectOpenProcessor extends ProjectOpenProcessor implement
|
||||
() -> refResult.set(prepareAndOpenProject(virtualFile, options, finalBaseDir, finalDummyProject, finalDummyProjectName)),
|
||||
"Loading Project...", true, null, frame.getComponent()
|
||||
);
|
||||
if (progressCompleted) result = refResult.get();
|
||||
if (progressCompleted) {
|
||||
result = refResult.get();
|
||||
}
|
||||
}
|
||||
|
||||
if (result == null || result.first == null) {
|
||||
|
||||
Reference in New Issue
Block a user