From c5f8285eab974a6a7994476f8652f1ad30edf3ec Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 7 Dec 2016 10:25:44 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-875=20=E4=BF=AE=E5=A4=8D=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E9=87=8D=E5=90=AF=E6=97=B6=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E4=BF=9D=E5=AD=98xml=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferenceAction.java | 1 + .../design/actions/file/PreferencePane.java | 39 ++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/file/PreferenceAction.java b/designer_base/src/com/fr/design/actions/file/PreferenceAction.java index f3f5ef3250..71c25837db 100644 --- a/designer_base/src/com/fr/design/actions/file/PreferenceAction.java +++ b/designer_base/src/com/fr/design/actions/file/PreferenceAction.java @@ -38,6 +38,7 @@ public class PreferenceAction extends UpdateAction { DesignerEnvManager.getEnvManager().saveXMLFile(); JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); jt.refreshToolArea(); + preferencePane.showRestartDialog(); } }); diff --git a/designer_base/src/com/fr/design/actions/file/PreferencePane.java b/designer_base/src/com/fr/design/actions/file/PreferencePane.java index 3407b6ccac..965cf415a0 100644 --- a/designer_base/src/com/fr/design/actions/file/PreferencePane.java +++ b/designer_base/src/com/fr/design/actions/file/PreferencePane.java @@ -83,6 +83,8 @@ public class PreferencePane extends BasicPane { }; private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言 + private boolean languageChanged; // 是否修改了设计器语言设置 + //设置是否支持undo private UICheckBox supportUndoCheckBox; //设置最大撤销次数 @@ -627,26 +629,35 @@ public class PreferencePane extends BasicPane { return l; } + // 如果语言设置改变了,则显示重启对话框 + public void showRestartDialog() { + if (!languageChanged) { + return; + } + int rv = JOptionPane.showOptionDialog( + null, + Inter.getLocText("FR-Designer_Language_Change_Successful"), + Inter.getLocText("FR-Designer-Plugin_Warning"), + JOptionPane.YES_NO_OPTION, + JOptionPane.INFORMATION_MESSAGE, + null, + new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, + null + ); + if (rv == JOptionPane.OK_OPTION) { + RestartHelper.restart(); + } + } + @Override public BasicDialog showWindow(Window window) { return showWindow(window, new DialogActionAdapter() { @Override public void doOk() { if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) { - int rv = JOptionPane.showOptionDialog( - null, - Inter.getLocText("FR-Designer_Language_Change_Successful"), - Inter.getLocText("FR-Designer-Plugin_Warning"), - JOptionPane.YES_NO_OPTION, - JOptionPane.INFORMATION_MESSAGE, - null, - new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, - null - ); - if (rv == JOptionPane.OK_OPTION) { - DesignerEnvManager.getEnvManager().saveXMLFile(); - RestartHelper.restart(); - } + languageChanged = true; + } else { + languageChanged = false; } } });