From edeaa327abd3d0db52a45014a0539fdfb78a1f4a Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Tue, 2 May 2017 18:11:37 +0300 Subject: [PATCH] more distinctive wording in the dialog --- .../vfs/encoding/IncompatibleEncodingDialog.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/encoding/IncompatibleEncodingDialog.java b/platform/platform-impl/src/com/intellij/openapi/vfs/encoding/IncompatibleEncodingDialog.java index 9e56820e7350..3204f26057f7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/encoding/IncompatibleEncodingDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/encoding/IncompatibleEncodingDialog.java @@ -54,13 +54,20 @@ public class IncompatibleEncodingDialog extends DialogWrapper { protected JComponent createCenterPanel() { JLabel label = new JLabel(XmlStringUtil.wrapInHtml( "The encoding you've chosen ('" + charset.displayName() + "') may change the contents of '" + virtualFile.getName() + "'.
" + - "Do you want to reload the file from disk or
" + - "convert the text and save in the new encoding?")); + "Do you want to
" + + "1. Reload the file from disk in the new encoding '" + charset.displayName() + "'" + warning(safeToReload) + " or
" + + "2. Convert the text and save in the new encoding" + warning(safeToConvert) + "?")); label.setIcon(Messages.getQuestionIcon()); label.setIconTextGap(10); return label; } + @NotNull + private static String warning(@NotNull EncodingUtil.Magic8 isItSafe) { + return isItSafe == EncodingUtil.Magic8.ABSOLUTELY ? "" : + isItSafe == EncodingUtil.Magic8.WELL_IF_YOU_INSIST ? " (may change contents)" : " (contents will be changed)"; + } + @NotNull @Override protected Action[] createActions() {