From fa5122e989f94f8ede6f07b42a14b123a8814561 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 3 Jun 2015 14:24:48 -0400 Subject: [PATCH 1/3] Provisional change to Case API to allow public publishing of data source added --- Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 33a2b00386..dc6c417d22 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -534,7 +534,7 @@ public class Case implements SleuthkitCase.ErrorObserver { * * @param newDataSource new data source added */ - void notifyNewDataSource(Content newDataSource) { + public void notifyNewDataSource(Content newDataSource) { eventPublisher.publish(new DataSourceAddedEvent(newDataSource)); CoreComponentControl.openCoreWindows(); } From e8b207f5fb19239322e4ca59172f07286b6402f3 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 3 Jun 2015 16:55:27 -0400 Subject: [PATCH 2/3] Make Case.notifyNewDataSource() not attempt window ops if not running interactively --- Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 5 ++++- Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index dc6c417d22..050a1a6304 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -61,6 +61,7 @@ import org.sleuthkit.autopsy.coreutils.Version; import org.sleuthkit.autopsy.events.AutopsyEvent; import org.sleuthkit.autopsy.events.AutopsyEventException; import org.sleuthkit.autopsy.events.AutopsyEventPublisher; +import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.datamodel.*; import org.sleuthkit.datamodel.SleuthkitJNI.CaseDbHandle.AddImageProcess; @@ -536,7 +537,9 @@ public class Case implements SleuthkitCase.ErrorObserver { */ public void notifyNewDataSource(Content newDataSource) { eventPublisher.publish(new DataSourceAddedEvent(newDataSource)); - CoreComponentControl.openCoreWindows(); + if (IngestManager.getInstance().isRunningInteractively()) { + CoreComponentControl.openCoreWindows(); + } } /** diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index a3dc8dade9..2dc5b92c6e 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -337,6 +337,15 @@ public class IngestManager { this.runInteractively = runInteractively; } + /** + * The ingest manager can be directed to forgo use of message boxes, the + * ingest message box, NetBeans progress handles, etc. Running interactively + * is the default. + */ + public synchronized boolean isRunningInteractively() { + return this.runInteractively; + } + /** * Called by the custom installer for this package once the window system is * initialized, allowing the ingest manager to get the top component used to From a9c95d60c702aeb7b53c6bd2ad9a05eab5e9f076 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 4 Jun 2015 10:22:47 -0400 Subject: [PATCH 3/3] remove error observer from case --- Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 050a1a6304..e1a4fe6e9b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -70,8 +70,7 @@ import org.sleuthkit.datamodel.SleuthkitJNI.CaseDbHandle.AddImageProcess; * open at a time. Use getCurrentCase() to retrieve the object for the current * case. */ -@SuppressWarnings("deprecation") // TODO: Remove this when ErrorObserver is replaced. -public class Case implements SleuthkitCase.ErrorObserver { +public class Case { private static final String autopsyVer = Version.getVersion(); // current version of autopsy. Change it when the version is changed private static final String EVENT_CHANNEL_NAME = "%s-Case-Events"; @@ -224,7 +223,6 @@ public class Case implements SleuthkitCase.ErrorObserver { * constructor. */ private void init() { - db.addErrorObserver(this); } /** @@ -1342,11 +1340,6 @@ public class Case implements SleuthkitCase.ErrorObserver { } } - @Override - public void receiveError(String context, String errorMessage) { - MessageNotifyUtil.Notify.error(context, errorMessage); - } - /** * Adds a report to the case. *