diff --git a/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java b/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java index a127425651..7197c9a7aa 100755 --- a/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java @@ -36,8 +36,11 @@ import org.sleuthkit.autopsy.coreutils.Logger; /** * The action associated with the Help/Open Log Folder menu item. It opens a - * file explorer window for the log subdirectory for the currently open case, or - * the log subdirectory of the user directory if there is no current case. + * file explorer window for either the log subdirectory for the currently open + * case, or the log subdirectory of the user directory, if there is no current + * case. + * + * This action should only be invoked in the event dispatch thread (EDT). */ @ActionRegistration(displayName = "#CTL_OpenLogFolder", iconInMenu = true) @ActionReference(path = "Menu/Help", position = 1750) @@ -51,11 +54,15 @@ public final class OpenLogFolderAction implements ActionListener { File logDir; if (Case.isCaseOpen()) { try { + /* + * Open the log directory for the case. + */ Case currentCase = Case.getCurrentCase(); logDir = new File(currentCase.getLogDirectoryPath()); } catch (IllegalStateException ex) { /* - * The case + * There is no open case, open the application level log + * directory. */ logDir = new File(Places.getUserDirectory().getAbsolutePath() + File.separator + "var" + File.separator + "log"); } @@ -64,14 +71,14 @@ public final class OpenLogFolderAction implements ActionListener { } try { - if (logDir.exists() == false) { - logger.log(Level.SEVERE, String.format("The log subdirectory %s does not exist", logDir)); + if (logDir.exists()) { + Desktop.getDesktop().open(logDir); + } else { + logger.log(Level.SEVERE, String.format("The log directory %s does not exist", logDir)); NotifyDescriptor notifyDescriptor = new NotifyDescriptor.Message( NbBundle.getMessage(this.getClass(), "OpenLogFolder.error1", logDir.getAbsolutePath()), NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(notifyDescriptor); - } else { - Desktop.getDesktop().open(logDir); } } catch (IOException ex) { logger.log(Level.SEVERE, String.format("Could not open log directory %s", logDir), ex); diff --git a/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java b/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java index 93b5b7527e..4294170070 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java @@ -40,6 +40,8 @@ import org.sleuthkit.autopsy.coreutils.Logger; * case. If the case is a single-user case, this is the case directory. If the * case is a multi-user case, this is a subdirectory of the case directory * specific to the host machine. + * + * This action should only be invoked in the event dispatch thread (EDT). */ @ActionRegistration(displayName = "#CTL_OpenOutputFolder", iconInMenu = true, lazy = true) @ActionReference(path = "Menu/Tools", position = 1850, separatorBefore = 1849) diff --git a/Core/src/org/sleuthkit/autopsy/actions/ShowIngestProgressSnapshotAction.java b/Core/src/org/sleuthkit/autopsy/actions/ShowIngestProgressSnapshotAction.java index 68c86f2a44..20bdd9753a 100755 --- a/Core/src/org/sleuthkit/autopsy/actions/ShowIngestProgressSnapshotAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/ShowIngestProgressSnapshotAction.java @@ -32,6 +32,8 @@ import org.sleuthkit.autopsy.ingest.IngestProgressSnapshotDialog; /** * The action associated with the Help/Get Ingest Progress Snapshot menu item. * It opens a the Ingest Progress Snapshot dialog. + * + * This action should only be invoked in the event dispatch thread (EDT). */ @ActionID(category = "Help", id = "org.sleuthkit.autopsy.actions.ShowIngestProgressSnapshotAction") @ActionRegistration(displayName = "#CTL_ShowIngestProgressSnapshotAction", lazy = false) @@ -44,7 +46,7 @@ public final class ShowIngestProgressSnapshotAction extends CallableSystemAction @Override public void performAction() { - IngestProgressSnapshotDialog dialog = new IngestProgressSnapshotDialog(); + new IngestProgressSnapshotDialog(); } @Override diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 486e751f83..50e3b21d90 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -811,12 +811,11 @@ public class Case { * thrown. */ logger.log(Level.INFO, "Closed case with metadata file path {0}", currentCase.getCaseMetadata().getFilePath()); //NON-NLS - Case closedCase = currentCase; + eventPublisher.publishLocally(new AutopsyEvent(Events.CURRENT_CASE.toString(), currentCase, null)); currentCase = null; if (RuntimeProperties.runningWithGUI()) { updateGUIForCaseClosed(); } - eventPublisher.publishLocally(new AutopsyEvent(Events.CURRENT_CASE.toString(), closedCase, null)); progressIndicator.finish(Bundle.Case_progressMessage_finshing()); if (RuntimeProperties.runningWithGUI()) { SwingUtilities.invokeLater(() -> ((ModalDialogProgressIndicator) progressIndicator).setVisible(false)); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java index 5c69c40091..475ef1fcc8 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java @@ -46,6 +46,8 @@ import org.sleuthkit.autopsy.ingest.IngestManager; * The action associated with the Case/Close Case menu item and the Close Case * toolbar button. It closes the current case and pops up the start up window * that allows a user to open another case. + * + * This action should only be invoked in the event dispatch thread (EDT). */ @ActionID(category = "Tools", id = "org.sleuthkit.autopsy.casemodule.CaseCloseAction") @ActionRegistration(displayName = "#CTL_CaseCloseAct", lazy = false)