X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPreferences.java;h=5769bb7c55398d0a6c827ecfcae2b381388b7d20;hb=4468c1e39c57fbb67192207b4c8750dab1b1dedd;hp=493deee2bdc7594df032bba3d8828ec6077d8400;hpb=3659ecfe7bb17dd25a0a6b5c94a7d9dab4525136;p=jalview.git diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 493deee..5769bb7 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -34,7 +34,7 @@ import java.util.concurrent.CompletableFuture; import javax.help.HelpSetException; import javax.swing.JComboBox; -import javax.swing.JInternalFrame; +import jalview.gui.JalviewInternalFrame; import javax.swing.JPanel; import javax.swing.ListSelectionModel; import javax.swing.RowFilter; @@ -156,6 +156,9 @@ public class Preferences extends GPreferences public static List groupURLLinks; static { + // don't populate with session properties + Cache.disableSessionProperties(); + // get links selected to be in the menu (SEQUENCE_LINKS) // and links entered by the user but not selected (STORED_LINKS) String inMenuString = Cache.getDefault("SEQUENCE_LINKS", ""); @@ -180,15 +183,18 @@ public class Preferences extends GPreferences */ groupURLLinks = new ArrayList<>(); + + // reenable + Cache.enableSessionProperties(); } - JInternalFrame frame; + JalviewInternalFrame frame; private WsPreferences wsPrefs; private OptionsParam promptEachTimeOpt = new OptionsParam( MessageManager.getString("label.prompt_each_time"), - "Prompt each time"); + LineartOptions.PROMPT_EACH_TIME); private OptionsParam lineArtOpt = new OptionsParam( MessageManager.getString("label.lineart"), "Lineart"); @@ -248,7 +254,10 @@ public class Preferences extends GPreferences private Preferences() { super(); - frame = new JInternalFrame(); + // don't populate with session properties + Cache.disableSessionProperties(); + + frame = new JalviewInternalFrame(); frame.setFrameIcon(null); frame.setContentPane(this); if (!Platform.isJS()) @@ -689,6 +698,8 @@ public class Preferences extends GPreferences * Set Startup tab defaults */ + // re-enable + Cache.enableSessionProperties(); } /** @@ -701,6 +712,8 @@ public class Preferences extends GPreferences protected void setupOutputCombo(JComboBox comboBox, String propertyKey) { + Cache.disableSessionProperties(); + comboBox.addItem(promptEachTimeOpt); comboBox.addItem(lineArtOpt); comboBox.addItem(textOpt); @@ -722,6 +735,8 @@ public class Preferences extends GPreferences { comboBox.setSelectedItem(promptEachTimeOpt); } + + Cache.enableSessionProperties(); } /** @@ -733,6 +748,8 @@ public class Preferences extends GPreferences @Override public void ok_actionPerformed(ActionEvent e) { + Cache.disableSessionProperties(); + if (!validateSettings()) { return; @@ -746,6 +763,7 @@ public class Preferences extends GPreferences /* * Save Visual settings */ + Cache.applicationProperties.setProperty("SHOW_JVSUFFIX", Boolean.toString(seqLimit.isSelected())); Cache.applicationProperties.setProperty("RIGHT_ALIGN_IDS", @@ -1020,10 +1038,14 @@ public class Preferences extends GPreferences } catch (Exception ex) { } + + Cache.enableSessionProperties(); } public void saveProxySettings() { + Cache.disableSessionProperties(); + String newProxyType = customProxy.isSelected() ? Cache.PROXYTYPE_CUSTOM : noProxy.isSelected() ? Cache.PROXYTYPE_NONE : Cache.PROXYTYPE_SYSTEM; @@ -1044,6 +1066,8 @@ public class Preferences extends GPreferences wsPrefs.update++; } previousProxyType = newProxyType; + + Cache.enableSessionProperties(); } /** @@ -1075,6 +1099,8 @@ public class Preferences extends GPreferences @Override public void startupFileTextfield_mouseClicked() { + Cache.disableSessionProperties(); + // TODO: JAL-3048 not needed for Jalview-JS String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT"); JalviewFileChooser chooser = JalviewFileChooser @@ -1096,6 +1122,8 @@ public class Preferences extends GPreferences startupFileTextfield .setText(chooser.getSelectedFile().getAbsolutePath()); } + + Cache.enableSessionProperties(); } /** @@ -1405,6 +1433,7 @@ public class Preferences extends GPreferences */ String viewerPath = ""; List paths = null; + Cache.disableSessionProperties(); try { ViewerType viewerType = ViewerType.valueOf(selectedItem); @@ -1430,6 +1459,7 @@ public class Preferences extends GPreferences { // only valid entries should be in the drop-down } + Cache.enableSessionProperties(); structureViewerPath.setText(viewerPath); paths.add(0, structureViewerPath.getText());