From 5a1aba7710bfdd6b2f7f1c48ad89e54f33c20b04 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 5 Dec 2019 19:03:21 -0500 Subject: [PATCH] 5661 Notify user that there were no results for their search --- .../autopsy/filequery/Bundle.properties-MERGED | 9 +++++++++ .../sleuthkit/autopsy/filequery/GroupListPanel.java | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED index 620e23f538..9d8a830b19 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED @@ -1,5 +1,12 @@ CTL_OpenFileDiscoveryAction=File Discovery +# {0} - dataSourceName +DataSourceModuleWrapper.exifModule.text=Exif Parser module was not run on data source: {0}\n +# {0} - dataSourceName +DataSourceModuleWrapper.fileTypeModule.text=File Type Identification module was not run on data source: {0}\n +# {0} - dataSourceName +DataSourceModuleWrapper.hashModule.text=Hash Lookup module was not run on data source: {0}\n DiscoveryTopComponent.name=\ File Discovery +DiscoveryTopComponent.resultsIncomplete.text=Results may be incomplete FileGroup.groupSortingAlgorithm.groupName.text=Group Name FileGroup.groupSortingAlgorithm.groupSize.text=Group Size # {0} - Data source name @@ -154,6 +161,8 @@ FileSorter.SortingMethod.filetype.displayName=File Type FileSorter.SortingMethod.frequency.displayName=Central Repo Frequency FileSorter.SortingMethod.fullPath.displayName=Full Path FileSorter.SortingMethod.keywordlist.displayName=Keyword List Names +GroupsListPanel.noResults.message.text=No results were found for the selected filters. +GroupsListPanel.noResults.title.text=No results found ImageThumbnailPanel.bytes.text=bytes # {0} - numberOfInstances ImageThumbnailPanel.countLabel.text=Number of Instances: {0} diff --git a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java b/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java index bcdb3d661f..ba1ed23388 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java @@ -24,6 +24,8 @@ import java.util.Map; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JList; +import javax.swing.JOptionPane; +import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey; import org.sleuthkit.autopsy.filequery.FileSearchData.FileType; @@ -59,11 +61,13 @@ class GroupListPanel extends javax.swing.JPanel { groupKeyList.setListData(new GroupKey[0]); } + @Messages({"GroupsListPanel.noResults.message.text=No results were found for the selected filters.", + "GroupsListPanel.noResults.title.text=No results found"}) /** * Subscribe to and update list of groups in response to * SearchCompleteEvents * - * @param searchCompleteEvent the SearchCompleteEvent which was recieved + * @param searchCompleteEvent the SearchCompleteEvent which was received */ @Subscribe void handleSearchCompleteEvent(DiscoveryEvents.SearchCompleteEvent searchCompleteEvent) { @@ -75,6 +79,11 @@ class GroupListPanel extends javax.swing.JPanel { groupKeyList.setListData(groupMap.keySet().toArray(new GroupKey[groupMap.keySet().size()])); if (groupKeyList.getModel().getSize() > 0) { groupKeyList.setSelectedIndex(0); + } else { + JOptionPane.showMessageDialog(DiscoveryTopComponent.getTopComponent(), + Bundle.GroupsListPanel_noResults_message_text(), + Bundle.GroupsListPanel_noResults_title_text(), + JOptionPane.INFORMATION_MESSAGE); } }