mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Bug fixes
This commit is contained in:
parent
5fa183482a
commit
5f9746ec59
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
@ -54,8 +55,8 @@ class SaveTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private List<TagName> tagNames;
|
private List<TagName> tagNames;
|
||||||
private Map<String, Boolean> tagNameSelections = new LinkedHashMap<>();
|
private Map<String, Boolean> tagNameSelections = new LinkedHashMap<>();
|
||||||
private TagNamesListModel tagsNamesListModel = new TagNamesListModel();
|
private TagNamesListModel tagsNamesListModel;
|
||||||
private TagsNamesListCellRenderer tagsNamesRenderer = new TagsNamesListCellRenderer();
|
private TagsNamesListCellRenderer tagsNamesRenderer;
|
||||||
private String selectedHashSetName;
|
private String selectedHashSetName;
|
||||||
private List<HashDb> updateableHashSets = new ArrayList<>();
|
private List<HashDb> updateableHashSets = new ArrayList<>();
|
||||||
|
|
||||||
@ -119,19 +120,21 @@ class SaveTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void customizeComponents() {
|
private void customizeComponents() {
|
||||||
tagNameSelections = new LinkedHashMap<>();
|
populateTagNameComponents();
|
||||||
|
|
||||||
tagsNamesListModel = new TagNamesListModel();
|
tagsNamesListModel = new TagNamesListModel();
|
||||||
tagsNamesRenderer = new TagsNamesListCellRenderer();
|
tagsNamesRenderer = new TagsNamesListCellRenderer();
|
||||||
tagNamesListBox.setModel(tagsNamesListModel);
|
tagNamesListBox.setModel(tagsNamesListModel);
|
||||||
tagNamesListBox.setCellRenderer(tagsNamesRenderer);
|
tagNamesListBox.setCellRenderer(tagsNamesRenderer);
|
||||||
tagNamesListBox.setVisibleRowCount(-1);
|
tagNamesListBox.setVisibleRowCount(-1);
|
||||||
populateTagNameComponents();
|
|
||||||
populateHashSetComponents();
|
populateHashSetComponents();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateTagNameComponents() {
|
private void populateTagNameComponents() {
|
||||||
// Get the tag names in use for the current case.
|
// Get the tag names in use for the current case.
|
||||||
tagNames = new ArrayList<>();
|
tagNames = new ArrayList<>();
|
||||||
|
Map<String, Boolean> updatedTagNameSelections = new LinkedHashMap<>();
|
||||||
try {
|
try {
|
||||||
// There may not be a case open when configuring report modules for Command Line execution
|
// There may not be a case open when configuring report modules for Command Line execution
|
||||||
tagNames = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse();
|
tagNames = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse();
|
||||||
@ -139,17 +142,22 @@ class SaveTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel {
|
|||||||
Logger.getLogger(SaveTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
|
Logger.getLogger(SaveTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
|
||||||
} catch (NoCurrentCaseException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
// There may not be a case open when configuring report modules for Command Line execution
|
// There may not be a case open when configuring report modules for Command Line execution
|
||||||
Logger.getLogger(SaveTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex);
|
if (Case.isCaseOpen()) {
|
||||||
|
Logger.getLogger(SaveTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark the tag names as unselected. Note that tagNameSelections is a
|
// Preserve the previous selections. Note that tagNameSelections is a
|
||||||
// LinkedHashMap so that order is preserved and the tagNames and tagNameSelections
|
// LinkedHashMap so that order is preserved and the tagNames and tagNameSelections
|
||||||
// containers are "parallel" containers.
|
// containers are "parallel" containers.
|
||||||
for (TagName tagName : tagNames) {
|
for (TagName tagName : tagNames) {
|
||||||
tagNameSelections.put(tagName.getDisplayName(), Boolean.FALSE);
|
if (tagNameSelections.get(tagName.getDisplayName()) != null && Objects.equals(tagNameSelections.get(tagName.getDisplayName()), Boolean.TRUE)) {
|
||||||
|
updatedTagNameSelections.put(tagName.getDisplayName(), Boolean.TRUE);
|
||||||
|
} else {
|
||||||
|
updatedTagNameSelections.put(tagName.getDisplayName(), Boolean.FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
tagNameSelections = updatedTagNameSelections;
|
||||||
tagNamesListBox.repaint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateHashSetComponents() {
|
private void populateHashSetComponents() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user