mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Disabled image tagging for non-windows OS and if OpenCV failed to load.
This commit is contained in:
parent
357c70fcee
commit
812aed56e1
@ -42,11 +42,15 @@ MediaFileViewer.toolTip=Displays supported multimedia files (images, videos, aud
|
|||||||
MediaPlayerPanel.noSupport=File not supported.
|
MediaPlayerPanel.noSupport=File not supported.
|
||||||
MediaPlayerPanel.timeFormat=%02d:%02d:%02d
|
MediaPlayerPanel.timeFormat=%02d:%02d:%02d
|
||||||
MediaPlayerPanel.unknownTime=Unknown
|
MediaPlayerPanel.unknownTime=Unknown
|
||||||
|
MediaViewImagePanel.createTagOption=Create
|
||||||
|
MediaViewImagePanel.deleteTagOption=Delete
|
||||||
MediaViewImagePanel.errorLabel.OOMText=Could not load file into Media View: insufficent memory.
|
MediaViewImagePanel.errorLabel.OOMText=Could not load file into Media View: insufficent memory.
|
||||||
MediaViewImagePanel.errorLabel.text=Could not load file into Media View.
|
MediaViewImagePanel.errorLabel.text=Could not load file into Media View.
|
||||||
MediaViewImagePanel.exportSaveText=Save
|
MediaViewImagePanel.exportSaveText=Save
|
||||||
|
MediaViewImagePanel.exportTagOption=Export
|
||||||
MediaViewImagePanel.externalViewerButton.text=Open in External Viewer Ctrl+E
|
MediaViewImagePanel.externalViewerButton.text=Open in External Viewer Ctrl+E
|
||||||
MediaViewImagePanel.fileChooserTitle=Choose a save location
|
MediaViewImagePanel.fileChooserTitle=Choose a save location
|
||||||
|
MediaViewImagePanel.hideTagOption=Hide
|
||||||
MediaViewImagePanel.successfulExport=Tagged image was successfully saved.
|
MediaViewImagePanel.successfulExport=Tagged image was successfully saved.
|
||||||
MediaViewImagePanel.unsuccessfulExport=Unable to export tagged image to disk.
|
MediaViewImagePanel.unsuccessfulExport=Unable to export tagged image to disk.
|
||||||
MediaViewVideoPanel.pauseButton.text=\u25ba
|
MediaViewVideoPanel.pauseButton.text=\u25ba
|
||||||
|
@ -83,8 +83,10 @@ import org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTagRegion;
|
|||||||
import org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTagCreator;
|
import org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTagCreator;
|
||||||
import org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTag;
|
import org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTag;
|
||||||
import org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTagsGroup;
|
import org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTagsGroup;
|
||||||
|
import org.sleuthkit.autopsy.corelibs.OpenCvLoader;
|
||||||
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
import org.sleuthkit.autopsy.datamodel.FileNode;
|
import org.sleuthkit.autopsy.datamodel.FileNode;
|
||||||
import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
|
import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
@ -116,7 +118,7 @@ class MediaViewImagePanel extends JPanel implements MediaFileViewer.MediaViewPan
|
|||||||
private final ProgressBar progressBar = new ProgressBar();
|
private final ProgressBar progressBar = new ProgressBar();
|
||||||
private final MaskerPane maskerPane = new MaskerPane();
|
private final MaskerPane maskerPane = new MaskerPane();
|
||||||
|
|
||||||
private final JPopupMenu popupMenu = new JPopupMenu();
|
private final JPopupMenu imageTaggingOptions = new JPopupMenu();
|
||||||
private final JMenuItem createTagMenuItem;
|
private final JMenuItem createTagMenuItem;
|
||||||
private final JMenuItem deleteTagMenuItem;
|
private final JMenuItem deleteTagMenuItem;
|
||||||
private final JMenuItem hideTagsMenuItem;
|
private final JMenuItem hideTagsMenuItem;
|
||||||
@ -158,6 +160,12 @@ class MediaViewImagePanel extends JPanel implements MediaFileViewer.MediaViewPan
|
|||||||
/**
|
/**
|
||||||
* Creates new form MediaViewImagePanel
|
* Creates new form MediaViewImagePanel
|
||||||
*/
|
*/
|
||||||
|
@NbBundle.Messages({
|
||||||
|
"MediaViewImagePanel.createTagOption=Create",
|
||||||
|
"MediaViewImagePanel.deleteTagOption=Delete",
|
||||||
|
"MediaViewImagePanel.hideTagOption=Hide",
|
||||||
|
"MediaViewImagePanel.exportTagOption=Export"
|
||||||
|
})
|
||||||
public MediaViewImagePanel() {
|
public MediaViewImagePanel() {
|
||||||
initComponents();
|
initComponents();
|
||||||
fxInited = org.sleuthkit.autopsy.core.Installer.isJavaFxInited();
|
fxInited = org.sleuthkit.autopsy.core.Installer.isJavaFxInited();
|
||||||
@ -166,29 +174,35 @@ class MediaViewImagePanel extends JPanel implements MediaFileViewer.MediaViewPan
|
|||||||
exportChooser.setDialogTitle(Bundle.MediaViewImagePanel_fileChooserTitle());
|
exportChooser.setDialogTitle(Bundle.MediaViewImagePanel_fileChooserTitle());
|
||||||
|
|
||||||
//Build popupMenu when Tags Menu button is pressed.
|
//Build popupMenu when Tags Menu button is pressed.
|
||||||
createTagMenuItem = new JMenuItem("Create");
|
createTagMenuItem = new JMenuItem(Bundle.MediaViewImagePanel_createTagOption());
|
||||||
createTagMenuItem.addActionListener((event) -> createTag());
|
createTagMenuItem.addActionListener((event) -> createTag());
|
||||||
popupMenu.add(createTagMenuItem);
|
imageTaggingOptions.add(createTagMenuItem);
|
||||||
|
|
||||||
popupMenu.add(new JSeparator());
|
imageTaggingOptions.add(new JSeparator());
|
||||||
|
|
||||||
deleteTagMenuItem = new JMenuItem("Delete");
|
deleteTagMenuItem = new JMenuItem(Bundle.MediaViewImagePanel_deleteTagOption());
|
||||||
deleteTagMenuItem.addActionListener((event) -> deleteTag());
|
deleteTagMenuItem.addActionListener((event) -> deleteTag());
|
||||||
popupMenu.add(deleteTagMenuItem);
|
imageTaggingOptions.add(deleteTagMenuItem);
|
||||||
|
|
||||||
popupMenu.add(new JSeparator());
|
imageTaggingOptions.add(new JSeparator());
|
||||||
|
|
||||||
hideTagsMenuItem = new JMenuItem("Hide");
|
hideTagsMenuItem = new JMenuItem(Bundle.MediaViewImagePanel_hideTagOption());
|
||||||
hideTagsMenuItem.addActionListener((event) -> showOrHideTags());
|
hideTagsMenuItem.addActionListener((event) -> showOrHideTags());
|
||||||
popupMenu.add(hideTagsMenuItem);
|
imageTaggingOptions.add(hideTagsMenuItem);
|
||||||
|
|
||||||
popupMenu.add(new JSeparator());
|
imageTaggingOptions.add(new JSeparator());
|
||||||
|
|
||||||
exportTagsMenuItem = new JMenuItem("Export");
|
exportTagsMenuItem = new JMenuItem(Bundle.MediaViewImagePanel_exportTagOption());
|
||||||
exportTagsMenuItem.addActionListener((event) -> exportTags());
|
exportTagsMenuItem.addActionListener((event) -> exportTags());
|
||||||
popupMenu.add(exportTagsMenuItem);
|
imageTaggingOptions.add(exportTagsMenuItem);
|
||||||
|
|
||||||
popupMenu.setPopupSize(300, 150);
|
imageTaggingOptions.setPopupSize(300, 150);
|
||||||
|
|
||||||
|
//Disable image tagging for non-windows users or upon failure to load OpenCV.
|
||||||
|
if (!PlatformUtil.isWindowsOS() || !OpenCvLoader.hasOpenCvLoaded()) {
|
||||||
|
tagsMenu.setEnabled(false);
|
||||||
|
imageTaggingOptions.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (fxInited) {
|
if (fxInited) {
|
||||||
Platform.runLater(new Runnable() {
|
Platform.runLater(new Runnable() {
|
||||||
@ -893,7 +907,9 @@ class MediaViewImagePanel extends JPanel implements MediaFileViewer.MediaViewPan
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void tagsMenuMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tagsMenuMousePressed
|
private void tagsMenuMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tagsMenuMousePressed
|
||||||
popupMenu.show(tagsMenu, -300 + tagsMenu.getWidth(), tagsMenu.getHeight() + 3);
|
if (imageTaggingOptions.isEnabled()) {
|
||||||
|
imageTaggingOptions.show(tagsMenu, -300 + tagsMenu.getWidth(), tagsMenu.getHeight() + 3);
|
||||||
|
}
|
||||||
}//GEN-LAST:event_tagsMenuMousePressed
|
}//GEN-LAST:event_tagsMenuMousePressed
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user