mirror of
https://github.com/elisspace/autopsy.git
synced 2026-09-06 02:24:30 +00:00
ImageAnlyzer bug fixes related to case closing.
This commit is contained in:
@@ -190,7 +190,9 @@ public final class ImageAnalyzerController {
|
||||
});
|
||||
|
||||
groupManager.getAnalyzedGroups().addListener((Observable o) -> {
|
||||
checkForGroups();
|
||||
if(Case.isCaseOpen()){
|
||||
checkForGroups();
|
||||
}
|
||||
});
|
||||
|
||||
groupManager.getUnSeenGroups().addListener((Observable observable) -> {
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.openide.util.NbBundle.Messages;
|
||||
import org.openide.windows.Mode;
|
||||
import org.openide.windows.TopComponent;
|
||||
import org.openide.windows.WindowManager;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.imageanalyzer.gui.GroupPane;
|
||||
import org.sleuthkit.autopsy.imageanalyzer.gui.MetaDataPane;
|
||||
@@ -67,6 +68,7 @@ public final class ImageAnalyzerTopComponent extends TopComponent implements Exp
|
||||
|
||||
public final static String PREFERRED_ID = "ImageAnalyzerTopComponent";
|
||||
private static final Logger LOGGER = Logger.getLogger(ImageAnalyzerTopComponent.class.getName());
|
||||
private static boolean topComponentInitialized = false;
|
||||
|
||||
public static void openTopComponent() {
|
||||
//TODO:eventually move to this model, throwing away everything and rebuilding controller groupmanager etc for each case.
|
||||
@@ -79,6 +81,7 @@ public final class ImageAnalyzerTopComponent extends TopComponent implements Exp
|
||||
// timeLineController.openTimeLine();
|
||||
final ImageAnalyzerTopComponent tc = (ImageAnalyzerTopComponent) WindowManager.getDefault().findTopComponent("ImageAnalyzerTopComponent");
|
||||
if (tc != null) {
|
||||
topComponentInitialized = true;
|
||||
WindowManager.getDefault().isTopComponentFloating(tc);
|
||||
Mode mode = WindowManager.getDefault().findMode("timeline");
|
||||
if (mode != null) {
|
||||
@@ -90,12 +93,14 @@ public final class ImageAnalyzerTopComponent extends TopComponent implements Exp
|
||||
}
|
||||
|
||||
public static void closeTopComponent() {
|
||||
final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageAnalyzerTopComponent");
|
||||
if (etc != null) {
|
||||
try {
|
||||
etc.close();
|
||||
} catch (Exception e) {
|
||||
LOGGER.log(Level.SEVERE, "failed to close ImageAnalyzerTopComponent", e);
|
||||
if(topComponentInitialized){
|
||||
final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageAnalyzerTopComponent");
|
||||
if (etc != null) {
|
||||
try {
|
||||
etc.close();
|
||||
} catch (Exception e) {
|
||||
LOGGER.log(Level.SEVERE, "failed to close ImageAnalyzerTopComponent", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,7 +133,7 @@ public final class ImageAnalyzerTopComponent extends TopComponent implements Exp
|
||||
|
||||
setName(Bundle.CTL_ImageAnalyzerTopComponent());
|
||||
setToolTipText(Bundle.HINT_ImageAnalyzerTopComponent());
|
||||
|
||||
|
||||
initComponents();
|
||||
|
||||
Platform.runLater(() -> {//initialize jfx ui
|
||||
|
||||
@@ -162,7 +162,11 @@ public enum ThumbnailCache {
|
||||
try (InputStream inputStream = new BufferedInputStream(new ReadContentInputStream(file.getAbstractFile()))) {
|
||||
final Image thumbnail = new Image(inputStream, MAX_ICON_SIZE, MAX_ICON_SIZE, true, true);
|
||||
if (thumbnail.isError()) { //if there was an error loading the image via JFX, fall back on Swing
|
||||
LOGGER.log(Level.WARNING, "problem loading image: " + file.getName() + " .", thumbnail.getException());
|
||||
LOGGER.log(Level.WARNING, "problem loading thumbnail for image: " + file.getName() + " .");
|
||||
// Doing it this way puts the whole stack trace in the console output, which is probably not
|
||||
// needed. There are a significant number of cases where this is expected to fail (bitmaps,
|
||||
// empty files, etc.)
|
||||
//LOGGER.log(Level.WARNING, "problem loading image: " + file.getName() + " .", thumbnail.getException());
|
||||
return fallbackToSwingImage(file);
|
||||
} else { //if the load went successfully, save the thumbnail to disk on a background thread
|
||||
imageSaver.execute(() -> {
|
||||
|
||||
@@ -618,6 +618,11 @@ public class GroupManager implements FileUpdateEvent.FileUpdateListener {
|
||||
* @param force true to force a full db query regroup
|
||||
*/
|
||||
public <A extends Comparable<A>> void regroup(final DrawableAttribute<A> groupBy, final GroupSortBy sortBy, final SortOrder sortOrder, Boolean force) {
|
||||
|
||||
if(! Case.isCaseOpen()){
|
||||
return;
|
||||
}
|
||||
|
||||
//only re-query the db if the group by attribute changed or it is forced
|
||||
if (groupBy != getGroupBy() || force == true) {
|
||||
setGroupBy(groupBy);
|
||||
|
||||
Reference in New Issue
Block a user