Fix up Static method references due to changes to Setting class.

This commit is contained in:
Dale Schultz 2012-06-14 18:56:22 -04:00
parent ff935ee165
commit 34c31f87be
7 changed files with 17 additions and 9 deletions

View File

@ -338,7 +338,7 @@ public class Settings implements Serializable {
}
public void setLoggerDefinitionFilePath(String loggerDefinitionFilePath) {
this.loggerDefinitionFilePath = loggerDefinitionFilePath;
Settings.loggerDefinitionFilePath = loggerDefinitionFilePath;
}
public String getLoggerOutputDirPath() {
@ -382,7 +382,7 @@ public class Settings implements Serializable {
}
public void setLoggerProfileFilePath(String loggerProfileFilePath) {
this.loggerProfileFilePath = loggerProfileFilePath;
Settings.loggerProfileFilePath = loggerProfileFilePath;
}
public void setLoggerOutputDirPath(String loggerOutputDirPath) {

View File

@ -19,6 +19,7 @@
package com.romraider.logger.ecu.ui.swing.menubar.action;
import com.romraider.Settings;
import com.romraider.logger.ecu.EcuLogger;
import static com.romraider.logger.ecu.ui.swing.menubar.util.FileHelper.getDefinitionFileChooser;
import static com.romraider.logger.ecu.ui.swing.menubar.util.FileHelper.getFile;
@ -44,7 +45,8 @@ public final class LoggerDefinitionLocationAction extends AbstractAction {
}
private void setDefinitionLocationDialog() throws Exception {
File lastConfigPath = getFile(logger.getSettings().getLoggerDefinitionFilePath());
logger.getSettings();
File lastConfigPath = getFile(Settings.getLoggerDefinitionFilePath());
JFileChooser fc = getDefinitionFileChooser(lastConfigPath);
if (fc.showOpenDialog(logger) == APPROVE_OPTION) {
String path = fc.getSelectedFile().getAbsolutePath();

View File

@ -19,6 +19,7 @@
package com.romraider.logger.ecu.ui.swing.menubar.action;
import com.romraider.Settings;
import com.romraider.logger.ecu.EcuLogger;
import com.romraider.swing.menubar.action.AbstractAction;
import java.awt.event.ActionEvent;
@ -31,7 +32,8 @@ public final class ReloadProfileAction extends AbstractAction {
public void actionPerformed(ActionEvent actionEvent) {
try {
logger.loadUserProfile(logger.getSettings().getLoggerProfileFilePath());
logger.getSettings();
logger.loadUserProfile(Settings.getLoggerProfileFilePath());
} catch (Exception e) {
logger.reportError(e);
}

View File

@ -19,6 +19,7 @@
package com.romraider.logger.ecu.ui.swing.menubar.action;
import com.romraider.Settings;
import com.romraider.logger.ecu.EcuLogger;
import static com.romraider.logger.ecu.ui.swing.menubar.util.FileHelper.saveProfileToFile;
import com.romraider.swing.menubar.action.AbstractAction;
@ -40,7 +41,8 @@ public final class SaveProfileAction extends AbstractAction {
}
private void saveProfile() throws Exception {
File lastProfileFile = new File(logger.getSettings().getLoggerProfileFilePath());
logger.getSettings();
File lastProfileFile = new File(Settings.getLoggerProfileFilePath());
String profileFilePath = saveProfileToFile(logger.getCurrentProfile(), lastProfileFile);
logger.getSettings().setLoggerProfileFilePath(profileFilePath);
logger.reportMessageInTitleBar("Profile: " + profileFilePath);

View File

@ -19,6 +19,7 @@
package com.romraider.logger.ecu.ui.swing.menubar.action;
import com.romraider.Settings;
import com.romraider.logger.ecu.EcuLogger;
import static com.romraider.logger.ecu.ui.swing.menubar.util.FileHelper.getFile;
import static com.romraider.logger.ecu.ui.swing.menubar.util.FileHelper.getProfileFileChooser;
@ -46,7 +47,8 @@ public final class SaveProfileAsAction extends AbstractAction {
}
private void saveProfileAs() throws Exception {
File lastProfileFile = getFile(logger.getSettings().getLoggerProfileFilePath());
logger.getSettings();
File lastProfileFile = getFile(Settings.getLoggerProfileFilePath());
JFileChooser fc = getProfileFileChooser(lastProfileFile);
if (fc.showSaveDialog(logger) == APPROVE_OPTION) {
File selectedFile = fc.getSelectedFile();

View File

@ -272,12 +272,12 @@ public final class DOMSettingsBuilder {
// definition path
IIOMetadataNode definition = new IIOMetadataNode("definition");
definition.setAttribute("path", settings.getLoggerDefinitionFilePath());
definition.setAttribute("path", Settings.getLoggerDefinitionFilePath());
loggerSettings.appendChild(definition);
// profile path
IIOMetadataNode profile = new IIOMetadataNode("profile");
profile.setAttribute("path", settings.getLoggerProfileFilePath());
profile.setAttribute("path", Settings.getLoggerProfileFilePath());
loggerSettings.appendChild(profile);
// file logging

View File

@ -239,7 +239,7 @@ public final class DOMSettingsUnmarshaller {
settings.setLoggerParameterListState(unmarshallAttribute(n, "showlist", true));
} else if (n.getNodeType() == ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("definition")) {
settings.setLoggerDefinitionFilePath(unmarshallAttribute(n, "path", settings.getLoggerDefinitionFilePath()));
settings.setLoggerDefinitionFilePath(unmarshallAttribute(n, "path", Settings.getLoggerDefinitionFilePath()));
} else if (n.getNodeType() == ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("profile")) {
settings.setLoggerProfileFilePath(unmarshallAttribute(n, "path", ""));