From 1b8304d543a0beb003842903ce3a662d4bbe37a7 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 28 May 2019 14:17:26 +0100 Subject: [PATCH] JAL-3056 no backup preferences saved for JalviewJS --- src/jalview/gui/Preferences.java | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index b04c3bc..94f67f6 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -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(); -- 1.7.10.2