From e5697375940aac1abad44d02bd7e6b5b2479cbd5 Mon Sep 17 00:00:00 2001
From: Kirill Likhodedov
Date: Wed, 4 Nov 2015 14:14:12 +0300
Subject: [PATCH] Finalize Changes -> Version Control toolwindow migration
* Remove vcs.merge.toolwindows registry key
* Fix the name of the toolwindow action id
---
.../ide/actions/ActivateToolWindowAction.java | 5 -----
.../src/tips/ChangesView.html | 2 +-
.../src/idea/Keymap_Default.xml | 2 +-
.../src/idea/Keymap_Mac.xml | 2 +-
.../src/idea/Keymap_MacClassic.xml | 2 +-
.../src/idea/Keymap_XWin.xml | 2 +-
.../src/idea/Keymap_Xcode.xml | 2 +-
.../openapi/keymap/KeymapsTestCase.java | 2 +-
.../util/resources/misc/registry.properties | 4 ----
.../changes/ui/ChangesViewContentManager.java | 6 ++----
.../vcs/impl/ProjectLevelVcsManagerImpl.java | 19 +++----------------
.../plugins/terminal/JBTerminalPanel.java | 2 +-
python/edu/resources/tips/ChangesView.html | 2 +-
python/resources/tips/ChangesView.html | 2 +-
14 files changed, 15 insertions(+), 39 deletions(-)
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ActivateToolWindowAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ActivateToolWindowAction.java
index fdfcf564bce1..8a6b478b2a0d 100644
--- a/platform/platform-impl/src/com/intellij/ide/actions/ActivateToolWindowAction.java
+++ b/platform/platform-impl/src/com/intellij/ide/actions/ActivateToolWindowAction.java
@@ -24,7 +24,6 @@ import com.intellij.openapi.keymap.Keymap;
import com.intellij.openapi.keymap.KeymapManager;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.openapi.wm.impl.ToolWindowImpl;
@@ -140,10 +139,6 @@ public class ActivateToolWindowAction extends DumbAwareAction {
*/
@NonNls
public static String getActionIdForToolWindow(String id) {
- //todo[kb] remove as soon as finish with vcs merging or provide aliasing mechanism
- if (Registry.is("vcs.merge.toolwindows") && "Version Control".equals(id)) {
- id = "Changes";
- }
return "Activate" + id.replaceAll(" ", "") + "ToolWindow";
}
diff --git a/platform/platform-resources-en/src/tips/ChangesView.html b/platform/platform-resources-en/src/tips/ChangesView.html
index 73d19bbd87a1..ddfbd8a8699b 100644
--- a/platform/platform-resources-en/src/tips/ChangesView.html
+++ b/platform/platform-resources-en/src/tips/ChangesView.html
@@ -4,7 +4,7 @@
The Changes tool window shows all deleted, modified, and unversioned files in a single view.
-Use &shortcut:ActivateChangesToolWindow; keyboard shortcut to show or hide this tool window.
+Use &shortcut:ActivateVersionControlToolWindow; keyboard shortcut to show or hide this tool window.
From the Changes tool window you can perform all the necessary version control actions: commit changes, manage changelists, put resources under version control, examine differences and more.
diff --git a/platform/platform-resources/src/idea/Keymap_Default.xml b/platform/platform-resources/src/idea/Keymap_Default.xml
index 9171e4c4db14..50e16942abb0 100644
--- a/platform/platform-resources/src/idea/Keymap_Default.xml
+++ b/platform/platform-resources/src/idea/Keymap_Default.xml
@@ -855,7 +855,7 @@
-
+
diff --git a/platform/platform-resources/src/idea/Keymap_Mac.xml b/platform/platform-resources/src/idea/Keymap_Mac.xml
index e85e5ebb0d35..7a4604016ba9 100644
--- a/platform/platform-resources/src/idea/Keymap_Mac.xml
+++ b/platform/platform-resources/src/idea/Keymap_Mac.xml
@@ -211,7 +211,7 @@
-
+
diff --git a/platform/platform-resources/src/idea/Keymap_MacClassic.xml b/platform/platform-resources/src/idea/Keymap_MacClassic.xml
index 101e6dfb4c37..a30701b02bd3 100644
--- a/platform/platform-resources/src/idea/Keymap_MacClassic.xml
+++ b/platform/platform-resources/src/idea/Keymap_MacClassic.xml
@@ -214,7 +214,7 @@
-
+
diff --git a/platform/platform-resources/src/idea/Keymap_XWin.xml b/platform/platform-resources/src/idea/Keymap_XWin.xml
index 7daa90cfee8c..bc052e454b47 100644
--- a/platform/platform-resources/src/idea/Keymap_XWin.xml
+++ b/platform/platform-resources/src/idea/Keymap_XWin.xml
@@ -7,7 +7,7 @@
-
+
diff --git a/platform/platform-resources/src/idea/Keymap_Xcode.xml b/platform/platform-resources/src/idea/Keymap_Xcode.xml
index 1cd87cd29a90..c7daf306dd5d 100644
--- a/platform/platform-resources/src/idea/Keymap_Xcode.xml
+++ b/platform/platform-resources/src/idea/Keymap_Xcode.xml
@@ -24,7 +24,7 @@
-
+
diff --git a/platform/testFramework/testSrc/com/intellij/openapi/keymap/KeymapsTestCase.java b/platform/testFramework/testSrc/com/intellij/openapi/keymap/KeymapsTestCase.java
index 5bbad292ed80..40a8ad98fab2 100644
--- a/platform/testFramework/testSrc/com/intellij/openapi/keymap/KeymapsTestCase.java
+++ b/platform/testFramework/testSrc/com/intellij/openapi/keymap/KeymapsTestCase.java
@@ -491,7 +491,7 @@ public abstract class KeymapsTestCase extends PlatformTestCase {
}
@NonNls private static final Set unknownActionIds = new THashSet(Arrays.asList(
- "ActivateChangesToolWindow", "ActivateFavoritesToolWindow", "ActivateCommanderToolWindow", "ActivateDebugToolWindow", "ActivateFindToolWindow",
+ "ActivateVersionControlToolWindow", "ActivateFavoritesToolWindow", "ActivateCommanderToolWindow", "ActivateDebugToolWindow", "ActivateFindToolWindow",
"ActivateHierarchyToolWindow", "ActivateMessagesToolWindow", "ActivateProjectToolWindow", "ActivateRunToolWindow",
"ActivateStructureToolWindow", "ActivateTODOToolWindow", "ActivateWebToolWindow","ActivatePaletteToolWindow",
"ActivateTerminalToolWindow",
diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties
index 16e2df56292b..8cd99cf0776d 100644
--- a/platform/util/resources/misc/registry.properties
+++ b/platform/util/resources/misc/registry.properties
@@ -454,10 +454,6 @@ cvs.roots.refresh.uses.vfs=true
cvs.roots.refresh.uses.vfs.description=Should CVS roots refresh after update use VFS
vcs.add.remove.silent=true
-vcs.merge.toolwindows=true
-vcs.merge.toolwindows.description=Merges Changes and Version Control tool windows into one
-vcs.merge.toolwindows.restartRequired=true
-
ide.open.file.in.temp.project.dir=true
ide.open.file.in.temp.project.dir.description=Enables opening file in temp project directory
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesViewContentManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesViewContentManager.java
index 5923ed170556..7d4d84648486 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesViewContentManager.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesViewContentManager.java
@@ -29,10 +29,8 @@ import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Key;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
-import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.openapi.vcs.VcsListener;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowAnchor;
@@ -53,7 +51,7 @@ import java.util.concurrent.CountDownLatch;
* @author yole
*/
public class ChangesViewContentManager extends AbstractProjectComponent implements ChangesViewContentI {
- public static final String TOOLWINDOW_ID = Registry.is("vcs.merge.toolwindows") ? ToolWindowId.VCS : VcsBundle.message("changes.toolwindow.name");
+ public static final String TOOLWINDOW_ID = ToolWindowId.VCS;
private static final Key myEPKey = Key.create("ChangesViewContentEP");
private static final Logger LOG = Logger.getInstance(ChangesViewContentManager.class);
@@ -283,7 +281,7 @@ public class ChangesViewContentManager extends AbstractProjectComponent implemen
}
}
- public static final String LOCAL_CHANGES = Registry.is("vcs.merge.toolwindows") ? "Local Changes" : "Local";
+ public static final String LOCAL_CHANGES = "Local Changes";
public static final String REPOSITORY = "Repository";
public static final String INCOMING = "Incoming";
public static final String SHELF = "Shelf";
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
index 0737c97057f4..29b4820f582e 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
@@ -15,7 +15,6 @@
*/
package com.intellij.openapi.vcs.impl;
-import com.intellij.icons.AllIcons;
import com.intellij.ide.impl.ProjectUtil;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
@@ -53,7 +52,6 @@ import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.ToolWindow;
-import com.intellij.openapi.wm.ToolWindowAnchor;
import com.intellij.openapi.wm.ToolWindowId;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.ui.content.Content;
@@ -227,18 +225,7 @@ public class ProjectLevelVcsManagerImpl extends ProjectLevelVcsManagerEx impleme
manager.registerPostStartupActivity(new DumbAwareRunnable() {
@Override
public void run() {
- ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
- if (toolWindowManager != null) { // Can be null in tests
- if (!Registry.is("vcs.merge.toolwindows")) {
- ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.VCS, true, ToolWindowAnchor.BOTTOM, myProject, true);
- myContentManager = toolWindow.getContentManager();
- toolWindow.setIcon(AllIcons.Toolwindows.VcsSmallTab);
- toolWindow.installWatcher(myContentManager);
- }
- }
- else {
- myContentManager = ContentFactory.SERVICE.getInstance().createContentManager(true, myProject);
- }
+ myContentManager = ContentFactory.SERVICE.getInstance().createContentManager(true, myProject);
}
});
@@ -368,8 +355,8 @@ public class ProjectLevelVcsManagerImpl extends ProjectLevelVcsManagerEx impleme
@Override
public ContentManager getContentManager() {
- if (myContentManager == null && Registry.is("vcs.merge.toolwindows")) {
- final ToolWindow changes = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.VCS);
+ if (myContentManager == null) {
+ ToolWindow changes = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.VCS);
myContentManager = changes == null ? null : changes.getContentManager();
}
return myContentManager;
diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/JBTerminalPanel.java b/plugins/terminal/src/org/jetbrains/plugins/terminal/JBTerminalPanel.java
index 69bbae74e525..7234b238ae47 100644
--- a/plugins/terminal/src/org/jetbrains/plugins/terminal/JBTerminalPanel.java
+++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/JBTerminalPanel.java
@@ -66,7 +66,7 @@ public class JBTerminalPanel extends TerminalPanel implements FocusListener, Ter
"ActivateTODOToolWindow",
"ActivateStructureToolWindow",
"ActivateHierarchyToolWindow",
- "ActivateChangesToolWindow",
+ "ActivateVersionControlToolWindow",
"ShowBookmarks",
"GotoBookmark0",
diff --git a/python/edu/resources/tips/ChangesView.html b/python/edu/resources/tips/ChangesView.html
index 7c1039d2b868..9ad6c84ce43a 100644
--- a/python/edu/resources/tips/ChangesView.html
+++ b/python/edu/resources/tips/ChangesView.html
@@ -4,7 +4,7 @@
The Local Changes tab of the Version Control tool window shows all deleted, modified, and unversioned files in a single view.
-Use &shortcut:ActivateChangesToolWindow; keyboard shortcut to show or hide this tool window.
+Use &shortcut:ActivateVersionControlToolWindow; keyboard shortcut to show or hide this tool window.
From the Version Control tool window you can perform all the necessary version control actions: commit changes, manage changelists, put resources under version control, examine differences and more.
diff --git a/python/resources/tips/ChangesView.html b/python/resources/tips/ChangesView.html
index 7c1039d2b868..9ad6c84ce43a 100644
--- a/python/resources/tips/ChangesView.html
+++ b/python/resources/tips/ChangesView.html
@@ -4,7 +4,7 @@
The Local Changes tab of the Version Control tool window shows all deleted, modified, and unversioned files in a single view.
-Use &shortcut:ActivateChangesToolWindow; keyboard shortcut to show or hide this tool window.
+Use &shortcut:ActivateVersionControlToolWindow; keyboard shortcut to show or hide this tool window.
From the Version Control tool window you can perform all the necessary version control actions: commit changes, manage changelists, put resources under version control, examine differences and more.