From 61085af49caeb40c9e2888cd13990c5bc5cb1f5d Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Wed, 18 Mar 2015 13:58:18 +0300 Subject: [PATCH] use product name #WEB-15766 fixed --- .../src/messages/VcsBundle.properties | 3 +++ .../vcs/checkin/CodeAnalysisBeforeCheckinHandler.java | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/platform/platform-resources-en/src/messages/VcsBundle.properties b/platform/platform-resources-en/src/messages/VcsBundle.properties index b3415ed35026..9757fa024738 100644 --- a/platform/platform-resources-en/src/messages/VcsBundle.properties +++ b/platform/platform-resources-en/src/messages/VcsBundle.properties @@ -229,6 +229,9 @@ update.directories.scope.name=Directories update.project.scope.name=Project dialog.title.changes.browser=Changes Browser code.smells.error.messages.tab.name=Code Analysis +code.smells.error.indexing=Code analysis is not possible right now +code.smells.error.indexing.message=Code analysis can''t be performed while {0} updates the indices in background.\n\ + You can commit the changes without running inspections, or you can wait until indices are built. searching.for.code.smells.processing.file.progress.text=Processing {0} checking.code.smells.progress.title=Performing Code Analysis before.commit.files.contain.code.smells.edit.them.confirm.text=Some files contain problems.\n\ diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeAnalysisBeforeCheckinHandler.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeAnalysisBeforeCheckinHandler.java index 00f5970de790..d3630fb638d4 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeAnalysisBeforeCheckinHandler.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeAnalysisBeforeCheckinHandler.java @@ -19,6 +19,7 @@ package com.intellij.openapi.vcs.checkin; import com.intellij.CommonBundle; import com.intellij.codeInsight.CodeSmellInfo; import com.intellij.lang.annotation.HighlightSeverity; +import com.intellij.openapi.application.ApplicationNamesInfo; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.project.DumbService; @@ -32,11 +33,13 @@ import com.intellij.openapi.vcs.changes.CommitExecutor; import com.intellij.openapi.vcs.ui.RefreshableOnComponent; import com.intellij.ui.NonFocusableCheckBox; import com.intellij.util.PairConsumer; +import com.intellij.util.PlatformUtils; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; +import java.text.MessageFormat; import java.util.List; /** @@ -126,10 +129,9 @@ public class CodeAnalysisBeforeCheckinHandler extends CheckinHandler { public ReturnResult beforeCheckin(CommitExecutor executor, PairConsumer additionalDataConsumer) { if (getSettings().CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT) { if (DumbService.getInstance(myProject).isDumb()) { - if (Messages.showOkCancelDialog(myProject, - "Code analysis can't be performed while IntelliJ IDEA updates the indices in background.\n" + - "You can commit the changes without running inspections, or you can wait until indices are built.", - "Code analysis is not possible right now", + if (Messages.showOkCancelDialog(myProject, VcsBundle.message("code.smells.error.indexing.message", + ApplicationNamesInfo.getInstance().getProductName()), + VcsBundle.message("code.smells.error.indexing"), "&Wait", "&Commit", null) == Messages.OK) { return ReturnResult.CANCEL; }