}
// Thread off a new instance of the file chooser - this reduces the time
- // it
- // takes to open it later on.
+ // it takes to open it later on.
new Thread(new Runnable()
{
@Override
public void run()
{
jalview.bin.Console.debug("Filechooser init thread started.");
- String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
+ String fileFormat = FileLoader.getUseDefaultFileFormat()
+ ? Cache.getProperty("DEFAULT_FILE_FORMAT")
+ : null;
JalviewFileChooser.forRead(Cache.getProperty("LAST_DIRECTORY"),
fileFormat);
jalview.bin.Console.debug("Filechooser init thread finished.");
@Override
public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport)
{
- String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
+ String fileFormat = FileLoader.getUseDefaultFileFormat()
+ ? Cache.getProperty("DEFAULT_FILE_FORMAT")
+ : null;
JalviewFileChooser chooser = JalviewFileChooser.forRead(
Cache.getProperty("LAST_DIRECTORY"), fileFormat,
BackupFiles.getEnabled());
private File selectedFile;
+ private static boolean useDefaultFileFormat = false;
+
/**
* default constructor always raised errors in GUI dialog boxes
*/
}
this.setShouldBeSaved();
+ // after first file loaded we revert to assuming a default file format
+ useDefaultFileFormat = true;
}
/**
QuitHandler.Message.UNSAVED_ALIGNMENTS);
}
+ public static boolean getUseDefaultFileFormat()
+ {
+ return useDefaultFileFormat;
+ }
+
}
alljvf.setExtensionListInDescription(false);
addChoosableFileFilter(alljvf);
+ if (selected == null)
+ {
+ chosen = alljvf;
+ }
+
for (String[] format : formats)
{
JalviewFileFilter jvf = new JalviewFileFilter(format[0], format[1]);