From: gmungoc Date: Tue, 28 May 2019 13:00:38 +0000 (+0100) Subject: Merge branch 'develop' into trialMerge X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b419d3b17606d478c234678487ff34d97bfa83cc;p=jalview.git Merge branch 'develop' into trialMerge Conflicts: src/jalview/gui/FeatureTypeSettings.java src/jalview/io/BackupFiles.java src/jalview/jbgui/GPreferences.java --- b419d3b17606d478c234678487ff34d97bfa83cc diff --cc src/jalview/gui/FeatureTypeSettings.java index 80861ac,7456e18..cbfe80f --- a/src/jalview/gui/FeatureTypeSettings.java +++ b/src/jalview/gui/FeatureTypeSettings.java @@@ -160,15 -162,15 +161,15 @@@ public class FeatureTypeSettings extend JPanel singleColour = new JPanel(); - private JPanel minColour = new JPanel(); + JPanel minColour = new JPanel(); - private JPanel maxColour = new JPanel(); + JPanel maxColour = new JPanel(); - private JComboBox threshold = new JComboBox<>(); + private JComboBox threshold = new JComboBox<>(); - private JSlider slider = new JSlider(); + JSlider slider = new JSlider(); - private JTextField thresholdValue = new JTextField(20); + JTextField thresholdValue = new JTextField(20); private JCheckBox thresholdIsMin = new JCheckBox(); diff --cc src/jalview/gui/Preferences.java index 9d5596e,9754e0d..b04c3bc --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@@ -546,40 -553,7 +547,43 @@@ public class Preferences extends GPrefe /* * Set Backups tab defaults */ -- loadLastSavedBackupsOptions(); ++ if (!Platform.isJS()) ++ { ++ loadLastSavedBackupsOptions(); ++ } + } + + /** + * A helper method that sets the items and initial selection in a character + * rendering option list (Prompt each time/Lineart/Text) + * + * @param comboBox + * @param propertyKey + */ + protected void setupOutputCombo(JComboBox comboBox, + String propertyKey) + { + comboBox.addItem(promptEachTimeOpt); + comboBox.addItem(lineArtOpt); + comboBox.addItem(textOpt); + + /* + * JalviewJS doesn't support Lineart so force it to Text + */ + String defaultOption = Platform.isJS() ? "Text" + : Cache.getDefault(propertyKey, "Prompt each time"); + if (defaultOption.equalsIgnoreCase("Text")) + { + comboBox.setSelectedItem(textOpt); + } + else if (defaultOption.equalsIgnoreCase("Lineart")) + { + comboBox.setSelectedItem(lineArtOpt); + } + else + { + comboBox.setSelectedItem(promptEachTimeOpt); + } } /** diff --cc src/jalview/io/BackupFiles.java index dae1c02,7bb5d31..06c2fc9 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@@ -145,8 -121,10 +122,10 @@@ public class BackupFile public static void classInit() { - setEnabled(Cache.getDefault(ENABLED, true)); + setEnabled(Cache.getDefault(ENABLED, !Platform.isJS())); - setConfirmDelete(Cache.getDefault(CONFIRM_DELETE_OLD, true)); + BackupFilesPresetEntry bfpe = BackupFilesPresetEntry + .getSavedBackupEntry(); + setConfirmDelete(bfpe.confirmDelete); } public static void setEnabled(boolean flag) diff --cc src/jalview/jbgui/GPreferences.java index 3c35e4e,60bf1b7..9327569 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@@ -31,8 -31,9 +31,10 @@@ import jalview.gui.JvSwingUtils import jalview.gui.StructureViewer.ViewerType; import jalview.io.BackupFilenameParts; import jalview.io.BackupFiles; + import jalview.io.BackupFilesPresetEntry; + import jalview.io.IntKeyStringValueEntry; import jalview.util.MessageManager; +import jalview.util.Platform; import java.awt.BorderLayout; import java.awt.Color; @@@ -373,11 -375,8 +380,11 @@@ public class GPreferences extends JPane tabbedPane.add(initConnectionsTab(), MessageManager.getString("label.connections")); - if (!Platform.isJS()) - { - tabbedPane.add(initBackupsTab(), - MessageManager.getString("label.backups")); - } - tabbedPane.add(initBackupsTab(), - MessageManager.getString("label.backups")); ++ if (!Platform.isJS()) ++ { ++ tabbedPane.add(initBackupsTab(), ++ MessageManager.getString("label.backups")); ++ } tabbedPane.add(initLinksTab(), MessageManager.getString("label.urllinks")); @@@ -1751,22 -1702,28 +1758,29 @@@ protected void loadLastSavedBackupsOptions() { + BackupFilesPresetEntry savedPreset = BackupFilesPresetEntry + .getSavedBackupEntry(); enableBackupFiles - .setSelected(Cache.getDefault(BackupFiles.ENABLED, !Platform.isJS())); - .setSelected(Cache.getDefault(BackupFiles.ENABLED, true)); ++ .setSelected(Cache.getDefault(BackupFiles.ENABLED, ++ !Platform.isJS())); + + BackupFilesPresetEntry backupfilesCustomEntry = BackupFilesPresetEntry + .createBackupFilesPresetEntry(Cache + .getDefault(BackupFilesPresetEntry.CUSTOMCONFIG, null)); + if (backupfilesCustomEntry == null) + { + backupfilesCustomEntry = BackupFilesPresetEntry.backupfilesPresetEntriesValues + .get(BackupFilesPresetEntry.BACKUPFILESSCHEMEDEFAULT); + } + BackupFilesPresetEntry.backupfilesPresetEntriesValues.put( + BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM, + backupfilesCustomEntry); + setComboIntStringKey(backupfilesPresetsCombo, - Cache.getDefault(BackupFiles.NS + "_PRESET", 1)); - suffixTemplate.setText(Cache.getDefault(BackupFiles.SUFFIX, - ".bak" + 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, 3)); - backupfilesConfirmDelete.setSelected( - Cache.getDefault(BackupFiles.CONFIRM_DELETE_OLD, true)); + Cache.getDefault(BackupFiles.NS + "_PRESET", + BackupFilesPresetEntry.BACKUPFILESSCHEMEDEFAULT)); + + backupsSetOptions(savedPreset); backupsOptionsSetEnabled(); updateBackupFilesExampleLabel();