vcs: show "patch applied approximately" notification in diff
authorAleksey Pivovarov <AMPivovarov@gmail.com>
Tue, 7 Jul 2015 16:28:46 +0000 (19:28 +0300)
committerAleksey Pivovarov <AMPivovarov@gmail.com>
Tue, 7 Jul 2015 16:46:27 +0000 (19:46 +0300)
* this notification was not shown in MultiLevelDiffTool

platform/platform-impl/src/com/intellij/openapi/diff/impl/external/FrameDiffTool.java

index 9fbb0b2cae553c7a8c61687919f41905a9e5b96d..036881cc098d3b7a6b584cc3b7dc56a1c9fc9e2a 100644 (file)
@@ -50,9 +50,6 @@ public class FrameDiffTool implements DiffTool {
         Disposer.dispose(builder);
         return;
       }
-      if (hints.contains(DiffTool.HINT_DIFF_IS_APPROXIMATE)) {
-        diffPanel.setPatchAppliedApproximately(); // todo read only and not variants
-      }
       final Runnable onOkRunnable = request.getOnOkRunnable();
       if (onOkRunnable != null){
         builder.setOkOperation(new Runnable() {
@@ -85,9 +82,6 @@ public class FrameDiffTool implements DiffTool {
         Disposer.dispose(frameWrapper);
         return;
       }
-      if (hints.contains(DiffTool.HINT_DIFF_IS_APPROXIMATE)) {
-        diffPanel.setPatchAppliedApproximately();
-      }
       frameWrapper.setTitle(request.getWindowTitle());
       DiffUtil.initDiffFrame(diffPanel.getProject(), frameWrapper, diffPanel, diffPanel.getComponent());
 
@@ -142,7 +136,11 @@ public class FrameDiffTool implements DiffTool {
   }
 
   protected DiffPanelImpl createDiffPanelImpl(@NotNull DiffRequest request, @Nullable Window window, @NotNull Disposable parentDisposable) {
-    return (DiffPanelImpl) DiffManagerImpl.createDiffPanel(request, window, parentDisposable, this);
+    DiffPanelImpl panel = (DiffPanelImpl)DiffManagerImpl.createDiffPanel(request, window, parentDisposable, this);
+    if (request.getHints().contains(DiffTool.HINT_DIFF_IS_APPROXIMATE)) {
+      panel.setPatchAppliedApproximately(); // todo read only and not variants
+    }
+    return panel;
   }
 
   static void showDiffDialog(DialogBuilder builder, Collection hints) {