mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
7471 tweak startup window behavior
This commit is contained in:
parent
b5c841a1d9
commit
9dd4abfc49
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user