mirror of https://github.com/rusefi/RomRaider.git
updated logger workings
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@745 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
fd271af064
commit
3292a50863
|
@ -70,6 +70,7 @@ import enginuity.logger.ecu.ui.swing.menubar.EcuLoggerMenuBar;
|
||||||
import enginuity.logger.ecu.ui.swing.menubar.action.ToggleButtonAction;
|
import enginuity.logger.ecu.ui.swing.menubar.action.ToggleButtonAction;
|
||||||
import static enginuity.util.ParamChecker.checkNotNull;
|
import static enginuity.util.ParamChecker.checkNotNull;
|
||||||
import static enginuity.util.ParamChecker.isNullOrEmpty;
|
import static enginuity.util.ParamChecker.isNullOrEmpty;
|
||||||
|
import enginuity.util.SettingsManagerImpl;
|
||||||
import static enginuity.util.ThreadUtil.runAsDaemon;
|
import static enginuity.util.ThreadUtil.runAsDaemon;
|
||||||
import static enginuity.util.ThreadUtil.sleep;
|
import static enginuity.util.ThreadUtil.sleep;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
@ -847,9 +848,14 @@ public final class EcuLogger extends JFrame implements WindowListener, PropertyC
|
||||||
LOGGER.warn("Error stopping logger", e);
|
LOGGER.warn("Error stopping logger", e);
|
||||||
} finally {
|
} finally {
|
||||||
rememberWindowProperties();
|
rememberWindowProperties();
|
||||||
|
saveSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void saveSettings() {
|
||||||
|
new SettingsManagerImpl().save(settings);
|
||||||
|
}
|
||||||
|
|
||||||
private void rememberWindowProperties() {
|
private void rememberWindowProperties() {
|
||||||
settings.setLoggerWindowMaximized(getExtendedState() == MAXIMIZED_BOTH);
|
settings.setLoggerWindowMaximized(getExtendedState() == MAXIMIZED_BOTH);
|
||||||
settings.setLoggerWindowSize(getSize());
|
settings.setLoggerWindowSize(getSize());
|
||||||
|
|
|
@ -6,5 +6,7 @@ import enginuity.swing.JProgressPane;
|
||||||
public interface SettingsManager {
|
public interface SettingsManager {
|
||||||
Settings load(String settingsNotFoundMessage);
|
Settings load(String settingsNotFoundMessage);
|
||||||
|
|
||||||
|
void save(Settings settings);
|
||||||
|
|
||||||
void save(Settings settings, JProgressPane progress, String version);
|
void save(Settings settings, JProgressPane progress, String version);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,10 +34,13 @@ public final class SettingsManagerImpl implements SettingsManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void save(Settings settings) {
|
||||||
|
save(settings, new JProgressPane(), "");
|
||||||
|
}
|
||||||
|
|
||||||
public void save(Settings settings, JProgressPane progress, String version) {
|
public void save(Settings settings, JProgressPane progress, String version) {
|
||||||
DOMSettingsBuilder builder = new DOMSettingsBuilder();
|
DOMSettingsBuilder builder = new DOMSettingsBuilder();
|
||||||
try {
|
try {
|
||||||
//JProgressPane progress = new JProgressPane(this, "Saving settings...", "Saving settings...");
|
|
||||||
builder.buildSettings(settings, new File("./settings.xml"), progress, version);
|
builder.buildSettings(settings, new File("./settings.xml"), progress, version);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// ignore
|
// ignore
|
||||||
|
|
Loading…
Reference in New Issue