From 42e264ea68728e4eded8baf0d14fe569b366fe69 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Tue, 13 Mar 2018 17:56:59 -0400 Subject: [PATCH] Added logic to remove existing dashboard instance. --- .../AutoIngestDashboardTopComponent.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java index 19a99031f8..579315d5ff 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,16 +55,22 @@ public final class AutoIngestDashboardTopComponent extends TopComponent { topComponentInitialized = true; WindowManager.getDefault().isTopComponentFloating(tc); Mode mode = WindowManager.getDefault().findMode("dashboard"); // NON-NLS - if (mode != null) { - mode.dockInto(tc); - } - AutoIngestDashboard dashboard; try { - dashboard = AutoIngestDashboard.createDashboard(); - tc.add(dashboard); - dashboard.setSize(dashboard.getPreferredSize()); if (tc.isOpened() == false) { + if (mode != null) { + mode.dockInto(tc); + } + /* + * Make sure we have a clean-slate before attaching a new + * dashboard instance so we don't accumulate them. + */ + tc.removeAll(); + + AutoIngestDashboard dashboard = AutoIngestDashboard.createDashboard(); + tc.add(dashboard); + dashboard.setSize(dashboard.getPreferredSize()); + tc.open(); } tc.toFront();