mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-20 11:26:53 +00:00
Add local/remote ingest job event filter to hash lookup and keyword search option panels
This commit is contained in:
parent
4008c3fe4f
commit
10f262ec9a
@ -66,7 +66,7 @@ public class AutopsyEvent extends PropertyChangeEvent implements Serializable {
|
|||||||
* @param sourceType The source type of the event, local or remote.
|
* @param sourceType The source type of the event, local or remote.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object getSource() {
|
public SourceType getSource() {
|
||||||
return sourceType;
|
return sourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011 - 2013 Basis Technology Corp.
|
* Copyright 2011 - 2015 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");
|
||||||
@ -38,6 +38,7 @@ import javax.swing.table.TableCellRenderer;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||||
@ -56,8 +57,8 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
.getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingPathText");
|
.getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingPathText");
|
||||||
private static final String ERROR_GETTING_INDEX_STATUS_TEXT = NbBundle
|
private static final String ERROR_GETTING_INDEX_STATUS_TEXT = NbBundle
|
||||||
.getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingIndexStatusText");
|
.getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingIndexStatusText");
|
||||||
private HashDbManager hashSetManager = HashDbManager.getInstance();
|
private final HashDbManager hashSetManager = HashDbManager.getInstance();
|
||||||
private HashSetTableModel hashSetTableModel = new HashSetTableModel();
|
private final HashSetTableModel hashSetTableModel = new HashSetTableModel();
|
||||||
|
|
||||||
public HashLookupSettingsPanel() {
|
public HashLookupSettingsPanel() {
|
||||||
initComponents();
|
initComponents();
|
||||||
@ -69,7 +70,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
IngestManager.getInstance().addIngestJobEventListener(new PropertyChangeListener() {
|
IngestManager.getInstance().addIngestJobEventListener(new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
if (isIngestJobEvent(evt)) {
|
if (isLocalIngestJobEvent(evt)) {
|
||||||
EventQueue.invokeLater(new Runnable() {
|
EventQueue.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -227,10 +228,8 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
return shortenedPath;
|
return shortenedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isIngestJobEvent(PropertyChangeEvent evt) {
|
private boolean isLocalIngestJobEvent(PropertyChangeEvent evt) {
|
||||||
return evt.getPropertyName().equals(IngestManager.IngestJobEvent.STARTED.toString())
|
return evt instanceof AutopsyEvent && ((AutopsyEvent)evt).getSource() == AutopsyEvent.SourceType.Local;
|
||||||
|| evt.getPropertyName().equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
|
||||||
|| evt.getPropertyName().equals(IngestManager.IngestJobEvent.CANCELLED.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -39,6 +39,7 @@ import javax.swing.table.TableColumn;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.actions.SystemAction;
|
import org.openide.util.actions.SystemAction;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager.IngestJobEvent;
|
import org.sleuthkit.autopsy.ingest.IngestManager.IngestJobEvent;
|
||||||
|
|
||||||
@ -119,10 +120,7 @@ class DropdownListSearchPanel extends KeywordSearchPanel {
|
|||||||
IngestManager.getInstance().addIngestJobEventListener(new PropertyChangeListener() {
|
IngestManager.getInstance().addIngestJobEventListener(new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
String changed = evt.getPropertyName();
|
if (evt instanceof AutopsyEvent && ((AutopsyEvent) evt).getSource() == AutopsyEvent.SourceType.Local) {
|
||||||
if (changed.equals(IngestJobEvent.STARTED.toString())
|
|
||||||
|| changed.equals(IngestJobEvent.COMPLETED.toString())
|
|
||||||
|| changed.equals(IngestJobEvent.CANCELLED.toString())) {
|
|
||||||
EventQueue.invokeLater(new Runnable() {
|
EventQueue.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -42,6 +42,7 @@ import javax.swing.filechooser.FileNameExtensionFilter;
|
|||||||
import javax.swing.table.AbstractTableModel;
|
import javax.swing.table.AbstractTableModel;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
||||||
|
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager.IngestJobEvent;
|
import org.sleuthkit.autopsy.ingest.IngestManager.IngestJobEvent;
|
||||||
|
|
||||||
@ -93,7 +94,7 @@ class GlobalEditListPanel extends javax.swing.JPanel implements ListSelectionLis
|
|||||||
lsm.addListSelectionListener(new ListSelectionListener() {
|
lsm.addListSelectionListener(new ListSelectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void valueChanged(ListSelectionEvent e) {
|
public void valueChanged(ListSelectionEvent e) {
|
||||||
if (lsm.isSelectionEmpty() || currentKeywordList.isLocked() || IngestManager.getInstance().isIngestRunning() ) {
|
if (lsm.isSelectionEmpty() || currentKeywordList.isLocked() || IngestManager.getInstance().isIngestRunning()) {
|
||||||
deleteWordButton.setEnabled(false);
|
deleteWordButton.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
deleteWordButton.setEnabled(true);
|
deleteWordButton.setEnabled(true);
|
||||||
@ -129,10 +130,7 @@ class GlobalEditListPanel extends javax.swing.JPanel implements ListSelectionLis
|
|||||||
IngestManager.getInstance().addIngestJobEventListener(new PropertyChangeListener() {
|
IngestManager.getInstance().addIngestJobEventListener(new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
String changed = evt.getPropertyName();
|
if (evt instanceof AutopsyEvent && ((AutopsyEvent) evt).getSource() == AutopsyEvent.SourceType.Local) {
|
||||||
if (changed.equals(IngestJobEvent.STARTED.toString())
|
|
||||||
|| changed.equals(IngestJobEvent.COMPLETED.toString())
|
|
||||||
|| changed.equals(IngestJobEvent.CANCELLED.toString())) {
|
|
||||||
EventQueue.invokeLater(new Runnable() {
|
EventQueue.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -165,7 +163,6 @@ class GlobalEditListPanel extends javax.swing.JPanel implements ListSelectionLis
|
|||||||
keywordOptionsSeparator.setEnabled(canAddWord);
|
keywordOptionsSeparator.setEnabled(canAddWord);
|
||||||
deleteListButton.setEnabled(canAddWord);
|
deleteListButton.setEnabled(canAddWord);
|
||||||
|
|
||||||
|
|
||||||
// items that need a non-empty list
|
// items that need a non-empty list
|
||||||
if ((currentKeywordList == null) || (currentKeywordList.getKeywords().isEmpty())) {
|
if ((currentKeywordList == null) || (currentKeywordList.getKeywords().isEmpty())) {
|
||||||
saveListButton.setEnabled(false);
|
saveListButton.setEnabled(false);
|
||||||
@ -446,7 +443,7 @@ class GlobalEditListPanel extends javax.swing.JPanel implements ListSelectionLis
|
|||||||
private void exportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportButtonActionPerformed
|
private void exportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportButtonActionPerformed
|
||||||
|
|
||||||
final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
|
final String FEATURE_NAME = NbBundle.getMessage(this.getClass(),
|
||||||
"KeywordSearchEditListPanel.exportButtonAction.featureName.text");
|
"KeywordSearchEditListPanel.exportButtonAction.featureName.text");
|
||||||
|
|
||||||
JFileChooser chooser = new JFileChooser();
|
JFileChooser chooser = new JFileChooser();
|
||||||
final String EXTENSION = "xml"; //NON-NLS
|
final String EXTENSION = "xml"; //NON-NLS
|
||||||
@ -474,7 +471,7 @@ class GlobalEditListPanel extends javax.swing.JPanel implements ListSelectionLis
|
|||||||
if (selFile.exists()) {
|
if (selFile.exists()) {
|
||||||
shouldWrite = KeywordSearchUtil.displayConfirmDialog(FEATURE_NAME,
|
shouldWrite = KeywordSearchUtil.displayConfirmDialog(FEATURE_NAME,
|
||||||
NbBundle.getMessage(this.getClass(), "KeywordSearchEditListPanel.exportButtonActionPerformed.fileExistPrompt",
|
NbBundle.getMessage(this.getClass(), "KeywordSearchEditListPanel.exportButtonActionPerformed.fileExistPrompt",
|
||||||
selFile.getName()), KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN);
|
selFile.getName()), KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN);
|
||||||
}
|
}
|
||||||
if (!shouldWrite) {
|
if (!shouldWrite) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user