import jalview.gui.Help.HelpId;
import jalview.gui.StructureViewer.ViewerType;
import jalview.io.BackupFiles;
+import jalview.io.BackupFilesPresetEntry;
import jalview.io.FileFormatI;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
/*
* Set Backups tab defaults
*/
- loadLastSavedBackupsOptions();
+ if (!Platform.isJS())
+ {
+ loadLastSavedBackupsOptions();
+ }
}
/**
/*
* Save Backups settings
*/
- Cache.applicationProperties.setProperty(BackupFiles.CONFIRM_DELETE_OLD,
- Boolean.toString(backupfilesConfirmDelete.isSelected()));
Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
- Boolean.toString(enableBackupFiles.isSelected()));
- Cache.applicationProperties.setProperty(BackupFiles.NO_MAX,
- Boolean.toString(backupfilesKeepAll.isSelected()));
- Cache.applicationProperties.setProperty(BackupFiles.REVERSE_ORDER,
- Boolean.toString(suffixReverse.isSelected()));
- Cache.applicationProperties.setProperty(BackupFiles.SUFFIX,
- suffixTemplate.getText());
- Cache.applicationProperties.setProperty(BackupFiles.ROLL_MAX,
- 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)));
+ Platform.isJS() ? Boolean.FALSE.toString()
+ : Boolean.toString(enableBackupFiles.isSelected()));
+ if (!Platform.isJS())
+ {
+ int preset = getComboIntStringKey(backupfilesPresetsCombo);
+ Cache.applicationProperties.setProperty(BackupFiles.NS + "_PRESET",
+ Integer.toString(preset));
+
+ 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.getInstance().doConfigureStructurePrefs();
+ Desktop.instance.doConfigureStructurePrefs();
try
{
frame.setClosed(true);
boolean valid = false;
while (!valid)
{
- if (JvOptionPane.showInternalConfirmDialog(Desktop.getDesktopPane(), link,
+ if (JvOptionPane.showInternalConfirmDialog(Desktop.desktop, link,
MessageManager.getString("label.new_sequence_url_link"),
JvOptionPane.OK_CANCEL_OPTION, -1,
null) == JvOptionPane.OK_OPTION)
boolean valid = false;
while (!valid)
{
- if (JvOptionPane.showInternalConfirmDialog(Desktop.getDesktopPane(), link,
+ if (JvOptionPane.showInternalConfirmDialog(Desktop.desktop, link,
MessageManager.getString("label.edit_sequence_url_link"),
JvOptionPane.OK_CANCEL_OPTION, -1,
null) == JvOptionPane.OK_OPTION)
} catch (NumberFormatException x)
{
userIdWidth.setText("");
- JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager
.getString("warn.user_defined_width_requirements"),
MessageManager.getString("label.invalid_id_column_width"),
File f = new File(chimeraPath.getText());
if (!f.canExecute())
{
- JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager.getString("label.invalid_chimera_path"),
MessageManager.getString("label.invalid_name"),
JvOptionPane.ERROR_MESSAGE);
if (!found)
{
String[] options = { "OK", "Help" };
- int showHelp = JvOptionPane.showInternalOptionDialog(Desktop.getDesktopPane(),
+ int showHelp = JvOptionPane.showInternalOptionDialog(Desktop.desktop,
JvSwingUtils.wrapTooltip(true,
MessageManager.getString("label.chimera_missing")),
"", JvOptionPane.YES_NO_OPTION, JvOptionPane.WARNING_MESSAGE,