mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Added logic to remove existing dashboard instance.
This commit is contained in:
parent
7ae70957be
commit
42e264ea68
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -55,16 +55,22 @@ public final class AutoIngestDashboardTopComponent extends TopComponent {
|
|||||||
topComponentInitialized = true;
|
topComponentInitialized = true;
|
||||||
WindowManager.getDefault().isTopComponentFloating(tc);
|
WindowManager.getDefault().isTopComponentFloating(tc);
|
||||||
Mode mode = WindowManager.getDefault().findMode("dashboard"); // NON-NLS
|
Mode mode = WindowManager.getDefault().findMode("dashboard"); // NON-NLS
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (tc.isOpened() == false) {
|
||||||
if (mode != null) {
|
if (mode != null) {
|
||||||
mode.dockInto(tc);
|
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 dashboard = AutoIngestDashboard.createDashboard();
|
||||||
try {
|
|
||||||
dashboard = AutoIngestDashboard.createDashboard();
|
|
||||||
tc.add(dashboard);
|
tc.add(dashboard);
|
||||||
dashboard.setSize(dashboard.getPreferredSize());
|
dashboard.setSize(dashboard.getPreferredSize());
|
||||||
if (tc.isOpened() == false) {
|
|
||||||
tc.open();
|
tc.open();
|
||||||
}
|
}
|
||||||
tc.toFront();
|
tc.toFront();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user