JAL-3056 no backup preferences saved for JalviewJS merge/JAL-3210_developToJSDevelop
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 28 May 2019 13:17:26 +0000 (14:17 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 28 May 2019 13:17:26 +0000 (14:17 +0100)
src/jalview/gui/Preferences.java

index b04c3bc..94f67f6 100755 (executable)
@@ -844,24 +844,28 @@ public class Preferences extends GPreferences
      * Save Backups settings
      */
     Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
-            Boolean.toString(enableBackupFiles.isSelected()));
-    int preset = getComboIntStringKey(backupfilesPresetsCombo);
-    Cache.applicationProperties.setProperty(BackupFiles.NS + "_PRESET", Integer.toString(preset));
-
-    if (preset == BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM)
+            Platform.isJS() ? Boolean.FALSE.toString()
+                    : Boolean.toString(enableBackupFiles.isSelected()));
+    if (!Platform.isJS())
     {
-      BackupFilesPresetEntry customBFPE = getBackupfilesCurrentEntry();
-      BackupFilesPresetEntry.backupfilesPresetEntriesValues.put(
-              BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM, customBFPE);
-      Cache.applicationProperties
-              .setProperty(BackupFilesPresetEntry.CUSTOMCONFIG,
-                      customBFPE.toString());
-    }
+      int preset = getComboIntStringKey(backupfilesPresetsCombo);
+      Cache.applicationProperties.setProperty(BackupFiles.NS + "_PRESET",
+              Integer.toString(preset));
 
-    BackupFilesPresetEntry savedBFPE = BackupFilesPresetEntry.backupfilesPresetEntriesValues
-            .get(preset);
-    Cache.applicationProperties.setProperty(
-            BackupFilesPresetEntry.SAVEDCONFIG, savedBFPE.toString());
+      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();