From abaefc3f0eac8adee8517f26a113c0338383a3b0 Mon Sep 17 00:00:00 2001 From: Devin148 Date: Thu, 27 Sep 2012 10:27:39 -0400 Subject: [PATCH 1/2] Fix script reading wrong ingest time. --- Testing/script/regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Testing/script/regression.py b/Testing/script/regression.py index eb2a589335..9cf93d9463 100644 --- a/Testing/script/regression.py +++ b/Testing/script/regression.py @@ -725,7 +725,7 @@ def fill_case_data(): case.heap_space = search_logs("Heap memory usage:")[0].rstrip().split(": ")[1] ingest_line = search_logs("Ingest (including enqueue)")[0] - case.total_ingest_time = get_word_at(ingest_line, 5).rstrip() + case.total_ingest_time = get_word_at(ingest_line, 6).rstrip() message_line = search_log_set("autopsy", "Ingest messages count:")[0] case.ingest_messages = int(message_line.rstrip().split(": ")[2]) From 51da2fa744d4cf3c853d6c49b9f1675334658f7d Mon Sep 17 00:00:00 2001 From: Devin148 Date: Mon, 1 Oct 2012 09:39:20 -0400 Subject: [PATCH 2/2] Fix table syncing after keyword list is saved. --- .../KeywordSearchConfigurationPanel1.java | 56 ++++++++++++++++++- .../KeywordSearchEditListPanel.form | 3 - .../KeywordSearchEditListPanel.java | 56 ++----------------- 3 files changed, 59 insertions(+), 56 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java index 94204b6312..5fb36b2c55 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java @@ -26,6 +26,8 @@ package org.sleuthkit.autopsy.keywordsearch; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.List; +import javax.swing.JOptionPane; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.corecomponents.OptionsPanel; import org.sleuthkit.autopsy.ingest.IngestManager; @@ -70,7 +72,59 @@ public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel impleme listsManagementPanel.resync(); } } - }); + }); + + editListPanel.addSaveButtonActionPerformed(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + final String FEATURE_NAME = "Save Keyword List"; + KeywordSearchListsXML writer = KeywordSearchListsXML.getCurrent(); + KeywordSearchList currentKeywordList = editListPanel.getCurrentKeywordList(); + + List keywords = currentKeywordList.getKeywords(); + if (keywords.isEmpty()) { + KeywordSearchUtil.displayDialog(FEATURE_NAME, "Keyword List is empty and cannot be saved", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO); + return; + } + + String listName = (String) JOptionPane.showInputDialog( + null, + "New keyword list name:", + FEATURE_NAME, + JOptionPane.PLAIN_MESSAGE, + null, + null, + currentKeywordList != null ? currentKeywordList : ""); + if (listName == null || listName.trim().equals("")) { + return; + } + + if (writer.listExists(listName) && writer.getList(listName).isLocked()) { + KeywordSearchUtil.displayDialog(FEATURE_NAME, "Cannot overwrite default list", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN); + return; + } + boolean shouldAdd = false; + if (writer.listExists(listName)) { + boolean replace = KeywordSearchUtil.displayConfirmDialog(FEATURE_NAME, "Keyword List <" + listName + "> already exists, do you want to replace it?", + KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN); + if (replace) { + shouldAdd = true; + } + + } else { + shouldAdd = true; + } + + if (shouldAdd) { + writer.addList(listName, keywords); + } + + currentKeywordList = writer.getList(listName); + KeywordSearchUtil.displayDialog(FEATURE_NAME, "Keyword List <" + listName + "> saved", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO); + listsManagementPanel.resync(); + } + }); mainSplitPane.setLeftComponent(listsManagementPanel); mainSplitPane.setRightComponent(editListPanel); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.form b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.form index cdb0eff6f7..0274ded2f7 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.form +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.form @@ -355,9 +355,6 @@ - - - diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.java index 1d3462ffdb..7dccd6f291 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchEditListPanel.java @@ -421,11 +421,6 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec saveListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/save16.png"))); // NOI18N saveListButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.saveListButton.text")); // NOI18N - saveListButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - saveListButtonActionPerformed(evt); - } - }); exportButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/export16.png"))); // NOI18N exportButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.exportButton.text")); // NOI18N @@ -560,53 +555,6 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec initButtons(); }//GEN-LAST:event_addWordButtonActionPerformed - private void saveListButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveListButtonActionPerformed - final String FEATURE_NAME = "Save Keyword List"; - KeywordSearchListsXML writer = KeywordSearchListsXML.getCurrent(); - - List keywords = currentKeywordList.getKeywords(); - if (keywords.isEmpty()) { - KeywordSearchUtil.displayDialog(FEATURE_NAME, "Keyword List is empty and cannot be saved", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO); - return; - } - - String listName = (String) JOptionPane.showInputDialog( - null, - "New keyword list name:", - FEATURE_NAME, - JOptionPane.PLAIN_MESSAGE, - null, - null, - currentKeywordList != null ? currentKeywordList : ""); - if (listName == null || listName.trim().equals("")) { - return; - } - - if (writer.listExists(listName) && writer.getList(listName).isLocked()) { - KeywordSearchUtil.displayDialog(FEATURE_NAME, "Cannot overwrite default list", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN); - return; - } - boolean shouldAdd = false; - if (writer.listExists(listName)) { - boolean replace = KeywordSearchUtil.displayConfirmDialog(FEATURE_NAME, "Keyword List <" + listName + "> already exists, do you want to replace it?", - KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN); - if (replace) { - shouldAdd = true; - } - - } else { - shouldAdd = true; - } - - if (shouldAdd) { - writer.addList(listName, keywords); - } - - currentKeywordList = writer.getList(listName); - KeywordSearchUtil.displayDialog(FEATURE_NAME, "Keyword List <" + listName + "> saved", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO); - - }//GEN-LAST:event_saveListButtonActionPerformed - private void deleteWordButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteWordButtonActionPerformed if (KeywordSearchUtil.displayConfirmDialog("Removing a keyword" , "This will remove a keyword from the list globally (for all Cases). " @@ -756,6 +704,10 @@ private void useForIngestCheckboxActionPerformed(java.awt.event.ActionEvent evt) void addDeleteButtonActionPerformed(ActionListener l) { deleteListButton.addActionListener(l); } + + void addSaveButtonActionPerformed(ActionListener l) { + saveListButton.addActionListener(l); + } private class KeywordTableModel extends AbstractTableModel {