7471 tweak startup window behavior

This commit is contained in:
William Schaefer 2021-04-13 11:48:57 -04:00
parent b5c841a1d9
commit 9dd4abfc49

View File

@ -144,9 +144,12 @@ public class StartupWindowProvider implements StartupWindowInterface {
if (openPreviousCaseFile.exists()) { if (openPreviousCaseFile.exists()) {
//do actual opening on another thread //do actual opening on another thread
new Thread(() -> { new Thread(() -> {
//close the startup window as we attempt to open the case
close();
String caseFilePath = ""; String caseFilePath = "";
String unableToOpenMessage = null; String unableToOpenMessage = null;
try { try {
//avoid readFileToString having ambiguous arguments
Charset encoding = null; Charset encoding = null;
caseFilePath = FileUtils.readFileToString(openPreviousCaseFile, encoding); caseFilePath = FileUtils.readFileToString(openPreviousCaseFile, encoding);
if (new File(caseFilePath).exists()) { if (new File(caseFilePath).exists()) {
@ -168,11 +171,10 @@ public class StartupWindowProvider implements StartupWindowInterface {
final String message = unableToOpenMessage; final String message = unableToOpenMessage;
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
MessageNotifyUtil.Message.warn(message); MessageNotifyUtil.Message.warn(message);
//the case was not opened restore the startup window
open();
}); });
} else { }
close();
}
}).start(); }).start();
} }
} }