X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2FSaveConfig.java;h=6c0e4d089cedcfc43e9b17ef7f5c0f328efcd6fb;hb=f35b6d628f68e3b5ef19965ad8988d0dd1eb8efa;hp=0f2339f7ea84708cdd44eeb30d08927516d7cbc2;hpb=112bb0c9b46894adca9a33ed8c99ea712b253185;p=GpsPrune.git diff --git a/tim/prune/function/SaveConfig.java b/tim/prune/function/SaveConfig.java index 0f2339f..6c0e4d0 100644 --- a/tim/prune/function/SaveConfig.java +++ b/tim/prune/function/SaveConfig.java @@ -20,9 +20,9 @@ import javax.swing.JLabel; import javax.swing.JPanel; import tim.prune.App; -import tim.prune.Config; import tim.prune.GenericFunction; import tim.prune.I18nManager; +import tim.prune.config.Config; /** * Class to provide the function to save the config settings @@ -135,14 +135,19 @@ public class SaveConfig extends GenericFunction if (response == JFileChooser.APPROVE_OPTION) { File saveFile = chooser.getSelectedFile(); + FileOutputStream outStream = null; try { - Config.getAllConfig().store(new FileOutputStream(saveFile), "Prune config file"); + outStream = new FileOutputStream(saveFile); + Config.getAllConfig().store(outStream, "Prune config file"); } catch (IOException ioe) { _app.showErrorMessageNoLookup(getNameKey(), I18nManager.getText("error.save.failed") + " : " + ioe.getMessage()); } + finally { + try {outStream.close();} catch (Exception e) {} + } } _dialog.dispose(); _dialog = null;