mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 02:07:42 +00:00
Merge pull request #1316 from millmanorama/delete_followup_refreshes_tags
refresh tags tree when removing FollowUp tag;
This commit is contained in:
commit
b15dcbd7c0
@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.imagegallery;
|
|||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
|
import com.google.common.util.concurrent.UncheckedExecutionException;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -89,7 +90,7 @@ public enum ThumbnailCache {
|
|||||||
public final void clearCache() {
|
public final void clearCache() {
|
||||||
cache.invalidateAll();
|
cache.invalidateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** get the cached thumbnail for the given file or generate a new one if
|
/** get the cached thumbnail for the given file or generate a new one if
|
||||||
* needed
|
* needed
|
||||||
*
|
*
|
||||||
@ -101,8 +102,8 @@ public enum ThumbnailCache {
|
|||||||
public Image get(DrawableFile<?> file) {
|
public Image get(DrawableFile<?> file) {
|
||||||
try {
|
try {
|
||||||
return cache.get(file.getId(), () -> load(file)).orElse(null);
|
return cache.get(file.getId(), () -> load(file)).orElse(null);
|
||||||
} catch (CacheLoader.InvalidCacheLoadException | ExecutionException ex) {
|
} catch (UncheckedExecutionException | CacheLoader.InvalidCacheLoadException | ExecutionException ex) {
|
||||||
LOGGER.log(Level.WARNING, "failed to load icon for file: " + file.getName(), ex);
|
LOGGER.log(Level.WARNING, "failed to load icon for file: " + file.getName(), ex.getCause());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ import javafx.scene.paint.Color;
|
|||||||
import javafx.util.Duration;
|
import javafx.util.Duration;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
|
||||||
import org.controlsfx.control.GridCell;
|
import org.controlsfx.control.GridCell;
|
||||||
import org.controlsfx.control.GridView;
|
import org.controlsfx.control.GridView;
|
||||||
import org.controlsfx.control.SegmentedButton;
|
import org.controlsfx.control.SegmentedButton;
|
||||||
|
@ -60,7 +60,6 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
|||||||
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
||||||
import org.sleuthkit.autopsy.coreutils.ThreadConfined.ThreadType;
|
import org.sleuthkit.autopsy.coreutils.ThreadConfined.ThreadType;
|
||||||
import org.sleuthkit.autopsy.datamodel.FileNode;
|
import org.sleuthkit.autopsy.datamodel.FileNode;
|
||||||
import org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent;
|
|
||||||
import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
|
import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
|
||||||
import org.sleuthkit.autopsy.directorytree.ExtractAction;
|
import org.sleuthkit.autopsy.directorytree.ExtractAction;
|
||||||
import org.sleuthkit.autopsy.directorytree.NewWindowViewAction;
|
import org.sleuthkit.autopsy.directorytree.NewWindowViewAction;
|
||||||
@ -76,6 +75,9 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.Category;
|
|||||||
import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute;
|
import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute;
|
||||||
import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile;
|
import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile;
|
||||||
import org.sleuthkit.autopsy.imagegallery.grouping.GroupKey;
|
import org.sleuthkit.autopsy.imagegallery.grouping.GroupKey;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestServices;
|
||||||
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.ContentTag;
|
import org.sleuthkit.datamodel.ContentTag;
|
||||||
import org.sleuthkit.datamodel.TagName;
|
import org.sleuthkit.datamodel.TagName;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
@ -260,7 +262,7 @@ public abstract class SingleDrawableViewBase extends AnchorPane implements Drawa
|
|||||||
try {
|
try {
|
||||||
AddDrawableTagAction.getInstance().addTag(TagUtils.getFollowUpTagName(), "");
|
AddDrawableTagAction.getInstance().addTag(TagUtils.getFollowUpTagName(), "");
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Exceptions.printStackTrace(ex);
|
LOGGER.log(Level.SEVERE, "Failed to add follow up tag. Could not load TagName.", ex);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//TODO: convert this to an action!
|
//TODO: convert this to an action!
|
||||||
@ -273,13 +275,12 @@ public abstract class SingleDrawableViewBase extends AnchorPane implements Drawa
|
|||||||
for (ContentTag ct : contentTagsByContent) {
|
for (ContentTag ct : contentTagsByContent) {
|
||||||
if (ct.getName().getDisplayName().equals(TagUtils.getFollowUpTagName().getDisplayName())) {
|
if (ct.getName().getDisplayName().equals(TagUtils.getFollowUpTagName().getDisplayName())) {
|
||||||
Case.getCurrentCase().getServices().getTagsManager().deleteContentTag(ct);
|
Case.getCurrentCase().getServices().getTagsManager().deleteContentTag(ct);
|
||||||
SwingUtilities.invokeLater(() -> DirectoryTreeTopComponent.findInstance().refreshContentTreeSafe());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent("TagAction", BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_FILE)); //NON-NLS
|
||||||
controller.getGroupManager().handleFileUpdate(FileUpdateEvent.newUpdateEvent(Collections.singleton(fileID), DrawableAttribute.TAGS));
|
controller.getGroupManager().handleFileUpdate(FileUpdateEvent.newUpdateEvent(Collections.singleton(fileID), DrawableAttribute.TAGS));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Exceptions.printStackTrace(ex);
|
LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user