Browse Source

Merge pull request #427 in DESIGN/design from ~LOY/design:release/10.0 to release/10.0

* commit 'afdbedeebb0d25c81454a817607f44cc9573afc1':
  REPORT-10988 修复保存配置用法问题
final/10.0
loy 6 years ago
parent
commit
543b4bc435
  1. 26
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

26
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,6 +1,7 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.config.Configuration;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -28,6 +29,8 @@ import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -347,8 +350,17 @@ public class PreferencePane extends BasicPane {
logLevelPane.add(logLevelComboBox); logLevelPane.add(logLevelComboBox);
logLevelComboBox.addActionListener(new ActionListener() { logLevelComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { 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<? extends Configuration>[] targets() {
return new Class[]{Log4jConfig.class};
}
});
} }
}); });
} }
@ -635,7 +647,17 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); 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<? extends Configuration>[] targets() {
return new Class[]{Log4jConfig.class};
}
});
} }

Loading…
Cancel
Save