From afdbedeebb0d25c81454a817607f44cc9573afc1 Mon Sep 17 00:00:00 2001 From: loy Date: Fri, 31 Aug 2018 11:25:24 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-10988=20=E4=BF=AE=E5=A4=8D=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E9=85=8D=E7=BD=AE=E7=94=A8=E6=B3=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index aec3f42f3e..325df90e09 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -1,6 +1,7 @@ package com.fr.design.actions.file; import com.fr.base.BaseUtils; +import com.fr.config.Configuration; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.dialog.BasicDialog; @@ -28,6 +29,8 @@ import com.fr.general.Inter; import com.fr.general.log.Log4jConfig; import com.fr.locale.InterProviderFactory; import com.fr.third.apache.log4j.Level; +import com.fr.transaction.Configurations; +import com.fr.transaction.Worker; import javax.swing.*; import java.awt.*; @@ -347,8 +350,17 @@ public class PreferencePane extends BasicPane { logLevelPane.add(logLevelComboBox); logLevelComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + Configurations.update(new Worker() { + @Override + public void run() { + Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem()); + } - Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem()); + @Override + public Class[] targets() { + return new Class[]{Log4jConfig.class}; + } + }); } }); } @@ -635,7 +647,17 @@ public class PreferencePane extends BasicPane { designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); } - Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem())); + Configurations.update(new Worker() { + @Override + public void run() { + Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem())); + } + + @Override + public Class[] targets() { + return new Class[]{Log4jConfig.class}; + } + }); }