From 8f437e30533d06ac46a86b4aaaac2a264b78af33 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Fri, 27 May 2016 11:15:32 +0100 Subject: [PATCH] JAL-1911 further improvement to bugfix - do not save i18n text in preference file --- src/jalview/gui/Preferences.java | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 84baa1c..117f103 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -164,6 +164,16 @@ public class Preferences extends GPreferences private WsPreferences wsPrefs; + private OptionsParam promptEachTimeOpt = new OptionsParam( + MessageManager.getString("label.prompt_each_time"), + "Prompt each time"); + + private OptionsParam lineArtOpt = new OptionsParam( + MessageManager.getString("label.lineart"), "Lineart"); + + private OptionsParam textOpt = new OptionsParam( + MessageManager.getString("action.text"), "Text"); + /** * Creates a new Preferences object. */ @@ -359,23 +369,19 @@ public class Preferences extends GPreferences /* * Set Output tab defaults */ - epsRendering.addItem(new OptionsParam(MessageManager - .getString("label.prompt_each_time"), "Prompt each time")); - epsRendering.addItem(new OptionsParam(MessageManager - .getString("label.lineart"), "Lineart")); - epsRendering.addItem(new OptionsParam(MessageManager - .getString("action.text"), "Text")); + + epsRendering.addItem(promptEachTimeOpt); + epsRendering.addItem(lineArtOpt); + epsRendering.addItem(textOpt); String defaultEPS = Cache.getDefault("EPS_RENDERING", "Prompt each time"); if (defaultEPS.equalsIgnoreCase("Text")) { - epsRendering.setSelectedItem(new OptionsParam(MessageManager - .getString("action.text"), "Text")); + epsRendering.setSelectedItem(textOpt); } else if (defaultEPS.equalsIgnoreCase("Lineart")) { - epsRendering.setSelectedItem(new OptionsParam(MessageManager - .getString("label.lineart"), "Lineart")); + epsRendering.setSelectedItem(lineArtOpt); } else { @@ -532,15 +538,8 @@ public class Preferences extends GPreferences /* * Save Output settings */ - if (epsRendering.getSelectedItem().equals("Prompt each time")) - { - Cache.applicationProperties.remove("EPS_RENDERING"); - } - else - { Cache.applicationProperties.setProperty("EPS_RENDERING", ((OptionsParam) epsRendering.getSelectedItem()).getCode()); - } /* * Save Connections settings -- 1.7.10.2