From 8f5139db6054f9482b0ff08883a3d3a5a39e16c1 Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Mon, 26 Aug 2013 17:59:31 +0400 Subject: [PATCH] IDEA-108265. Now user is asked whether the project should be opened in a new frame. --- .../ui/win/RecentProjectApplication.java | 39 +++++++++++++++++++ .../intellij/ui/win/SocketControlHelper.java | 2 +- .../src/META-INF/PlatformExtensions.xml | 1 + 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 platform/platform-impl/src/com/intellij/ui/win/RecentProjectApplication.java diff --git a/platform/platform-impl/src/com/intellij/ui/win/RecentProjectApplication.java b/platform/platform-impl/src/com/intellij/ui/win/RecentProjectApplication.java new file mode 100644 index 000000000000..9561c77b02d6 --- /dev/null +++ b/platform/platform-impl/src/com/intellij/ui/win/RecentProjectApplication.java @@ -0,0 +1,39 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.ui.win; + +import com.intellij.ide.impl.ProjectUtil; +import com.intellij.openapi.diff.ApplicationStarterBase; + + +/** + * @author Denis Fokin + */ +public class RecentProjectApplication extends ApplicationStarterBase { + public RecentProjectApplication() { + super("reopen", 1); + } + + @Override + public String getUsageMessage() { + return String.format("This command is used for internal purpose only."); + } + + @Override + protected void processCommand(String[] args) throws Exception { + ProjectUtil.openProject(args[1], null, false); + } +} \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java b/platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java index 84372bf5c9cd..b2f7738d6c7d 100644 --- a/platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java +++ b/platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java @@ -46,7 +46,7 @@ public class SocketControlHelper { DataOutputStream out = new DataOutputStream(socket.getOutputStream()); try { - out.writeUTF(ACTIVATE_COMMAND + new File(".").getAbsolutePath() + "\0" + pathToProject); + out.writeUTF(ACTIVATE_COMMAND + new File(".").getAbsolutePath() + "\0" + "reopen" + "\0" + pathToProject); out.flush(); String response = in.readUTF(); if (response.equals("ok")) { diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml index 8c05bb9909f6..fd6b440ff34a 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml @@ -3,6 +3,7 @@ +