JAL-3141 Added Presets options in the Backups Preferences pane, with several presets...
[jalview.git] / src / jalview / gui / Preferences.java
index 8e02c2c..c8f8b25 100755 (executable)
@@ -547,6 +547,38 @@ public class Preferences extends GPreferences
 
     annotations_actionPerformed(null); // update the display of the annotation
                                        // settings
+    
+    
+    /*
+     * Set Backups tab defaults
+     */
+    enableBackupFiles
+            .setSelected(Cache.getDefault(BackupFiles.ENABLED, true));
+    suffixTemplate.setText(Cache.getDefault(BackupFiles.SUFFIX,
+            ".v" + BackupFiles.NUM_PLACEHOLDER));
+    suffixDigitsSpinner
+            .setValue(Cache.getDefault(BackupFiles.SUFFIX_DIGITS, 3));
+    suffixReverse.setSelected(
+            Cache.getDefault(BackupFiles.REVERSE_ORDER, false));
+    backupfilesKeepAll
+            .setSelected(Cache.getDefault(BackupFiles.NO_MAX, false));
+    backupfilesRollMaxSpinner
+            .setValue(Cache.getDefault(BackupFiles.ROLL_MAX, 4));
+    backupfilesConfirmDelete.setSelected(
+            Cache.getDefault(BackupFiles.CONFIRM_DELETE_OLD, true));
+    setComboIntStringKey(backupfilesPresetsCombo, Cache.getDefault(BackupFiles.NS+"_PRESET", 0));
+    backupsOptionsSetEnabled(enableBackupFiles.isSelected());
+    
+    updateBackupFilesExampleLabel();
+    /*
+    suffixPanel.setPreferredSize(
+            new Dimension(width, suffixPanel.getHeight()));
+    keepfilesPanel.setPreferredSize(
+            new Dimension(width, keepfilesPanel.getHeight()));
+    exampleFilesPanel.setPreferredSize(
+            new Dimension(width, exampleFilesPanel.getHeight()));
+            */
+
   }
 
   /**
@@ -813,6 +845,8 @@ public class Preferences extends GPreferences
             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)));
 
     Cache.saveProperties();
     Desktop.instance.doConfigureStructurePrefs();