From: gmungoc Date: Tue, 28 May 2019 13:17:26 +0000 (+0100) Subject: JAL-3056 no backup preferences saved for JalviewJS X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=1b8304d543a0beb003842903ce3a662d4bbe37a7 JAL-3056 no backup preferences saved for JalviewJS --- 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();