From cbc7614e096b0a129e3c319f11724470347fbfbd Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 18 Oct 2012 20:13:19 +0400 Subject: [PATCH 1/2] IDEA-93113 Don't show incoming changes and warn about outdated version if incoming changes are not supported by the VCS committed changes provider. --- .../vcs/changes/committed/IncomingChangesIndicator.java | 8 +++----- .../vcs/changes/committed/OutdatedVersionNotifier.java | 9 +++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/IncomingChangesIndicator.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/IncomingChangesIndicator.java index 225d9089ea35..6ff8cee677f1 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/IncomingChangesIndicator.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/IncomingChangesIndicator.java @@ -22,10 +22,7 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; -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.vcs.*; import com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; import com.intellij.openapi.wm.*; @@ -98,7 +95,8 @@ public class IncomingChangesIndicator { private boolean needIndicator() { final AbstractVcs[] vcss = ProjectLevelVcsManager.getInstance(myProject).getAllActiveVcss(); for (AbstractVcs vcs : vcss) { - if (vcs.getCachingCommittedChangesProvider() != null) { + CachingCommittedChangesProvider provider = vcs.getCachingCommittedChangesProvider(); + if (provider != null && provider.supportsIncomingChanges()) { return true; } } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/OutdatedVersionNotifier.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/OutdatedVersionNotifier.java index 7554afd4f093..03df6d2e2fd6 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/OutdatedVersionNotifier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/OutdatedVersionNotifier.java @@ -25,6 +25,7 @@ import com.intellij.openapi.fileEditor.FileEditorManagerListener; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.Pair; +import com.intellij.openapi.vcs.CachingCommittedChangesProvider; import com.intellij.openapi.vcs.VcsBundle; import com.intellij.openapi.vcs.changes.Change; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; @@ -150,6 +151,9 @@ public class OutdatedVersionNotifier implements ProjectComponent { } private void initPanel(final CommittedChangeList list, final Change c, final FileEditor editor) { + if (!isIncomingChangesSupported(list)) { + return; + } final OutdatedRevisionPanel component = new OutdatedRevisionPanel(list, c); editor.putUserData(PANEL_KEY, component); myFileEditorManager.addTopComponent(editor, component); @@ -205,4 +209,9 @@ public class OutdatedVersionNotifier implements ProjectComponent { updateLabelText(c); } } + + private static boolean isIncomingChangesSupported(@NotNull CommittedChangeList list) { + CachingCommittedChangesProvider provider = list.getVcs().getCachingCommittedChangesProvider(); + return provider != null && provider.supportsIncomingChanges(); + } } From 9d8fc403abb2a64cc28efdb78a1a8028b3caa772 Mon Sep 17 00:00:00 2001 From: Vassiliy Kudryashov Date: Thu, 18 Oct 2012 20:19:51 +0400 Subject: [PATCH 2/2] IDEA-90515 Editor tab dragged by dragging Configuration Menu pop-out items --- .../src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java index c7c9638a39c7..184e00782636 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java @@ -25,6 +25,7 @@ import com.intellij.openapi.ui.impl.GlassPaneDialogWrapperPeer; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.wm.IdeGlassPane; import com.intellij.openapi.wm.IdeGlassPaneUtil; +import com.intellij.ui.popup.AbstractPopup; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; @@ -254,7 +255,8 @@ public class IdeGlassPaneImpl extends JPanel implements IdeGlassPaneEx, IdeEvent if (window != null) { for (Component component : window.getComponents()) { if (component instanceof JComponent - && UIUtil.findComponentOfType((JComponent)component, JPopupMenu.class) != null) { + && ((UIUtil.findComponentOfType((JComponent)component, JPopupMenu.class) != null) + || (UIUtil.findComponentOfType((JComponent)component, AbstractPopup.MyContentPanel.class) != null))) { return true; } }