Merge branch 'develop' into Jalview-JS/develop
[jalview.git] / src / jalview / gui / Preferences.java
index cd3b9e5..04b83a3 100755 (executable)
@@ -25,6 +25,7 @@ import jalview.bin.Cache;
 import jalview.gui.Help.HelpId;
 import jalview.gui.StructureViewer.ViewerType;
 import jalview.io.BackupFiles;
+import jalview.io.BackupFilesPresetEntry;
 import jalview.io.FileFormatI;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
@@ -190,6 +191,11 @@ public class Preferences extends GPreferences
     frame = new JInternalFrame();
     frame.setContentPane(this);
     if (!Platform.isJS())
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     */
     {
       wsPrefs = new WsPreferences();
       wsTab.add(wsPrefs, BorderLayout.CENTER);
@@ -254,7 +260,7 @@ public class Preferences extends GPreferences
     fontStyleCB.setSelectedItem(
             Cache.getDefault("FONT_STYLE", Font.PLAIN + ""));
 
-    smoothFont.setSelected(Cache.getDefault("ANTI_ALIAS", false));
+    smoothFont.setSelected(Cache.getDefault("ANTI_ALIAS", true));
     scaleProteinToCdna
             .setSelected(Cache.getDefault(SCALE_PROTEIN_TO_CDNA, false));
 
@@ -834,22 +840,25 @@ public class Preferences extends GPreferences
     /*
      * Save Backups settings
      */
-    Cache.applicationProperties.setProperty(BackupFiles.CONFIRM_DELETE_OLD,
-            Boolean.toString(backupfilesConfirmDelete.isSelected()));
     Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
             Boolean.toString(enableBackupFiles.isSelected()));
-    Cache.applicationProperties.setProperty(BackupFiles.NO_MAX,
-            Boolean.toString(backupfilesKeepAll.isSelected()));
-    Cache.applicationProperties.setProperty(BackupFiles.REVERSE_ORDER,
-            Boolean.toString(suffixReverse.isSelected()));
-    Cache.applicationProperties.setProperty(BackupFiles.SUFFIX,
-            suffixTemplate.getText());
-    Cache.applicationProperties.setProperty(BackupFiles.ROLL_MAX,
-            Integer.toString(getSpinnerInt(backupfilesRollMaxSpinner, 4)));
-    Cache.applicationProperties.setProperty(BackupFiles.SUFFIX_DIGITS,
-            Integer.toString(getSpinnerInt(suffixDigitsSpinner, 3)));
-    Cache.applicationProperties.setProperty(BackupFiles.NS+"_PRESET",
-            Integer.toString(getComboIntStringKey(backupfilesPresetsCombo)));
+    int preset = getComboIntStringKey(backupfilesPresetsCombo);
+    Cache.applicationProperties.setProperty(BackupFiles.NS + "_PRESET", Integer.toString(preset));
+
+    if (preset == BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM)
+    {
+      BackupFilesPresetEntry customBFPE = getBackupfilesCurrentEntry();
+      BackupFilesPresetEntry.backupfilesPresetEntriesValues.put(
+              BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM, customBFPE);
+      Cache.applicationProperties
+              .setProperty(BackupFilesPresetEntry.CUSTOMCONFIG,
+                      customBFPE.toString());
+    }
+
+    BackupFilesPresetEntry savedBFPE = BackupFilesPresetEntry.backupfilesPresetEntriesValues
+            .get(preset);
+    Cache.applicationProperties.setProperty(
+            BackupFilesPresetEntry.SAVEDCONFIG, savedBFPE.toString());
 
     Cache.saveProperties();
     Desktop.instance.doConfigureStructurePrefs();
@@ -1068,8 +1077,11 @@ public class Preferences extends GPreferences
   public void defaultBrowser_mouseClicked(MouseEvent e)
   {
     // TODO: JAL-3048 not needed for j2s
-    /*
-     * @j2sNative
+    if (!Platform.isJS()) // BH 2019
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
      */
     {
       JFileChooser chooser = new JFileChooser(".");