diff --git a/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties b/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties index 747f0c82f7..573d852bd6 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties @@ -14,7 +14,7 @@ FiltersPanel.endCheckBox.text=End: FiltersPanel.refreshButton.text=Refresh FiltersPanel.deviceRequiredLabel.text=Select at least one. FiltersPanel.accountTypeRequiredLabel.text=Select at least one. -FiltersPanel.needsRefreshLabel.text=Displayed data is out of date. Press Refresh. +FiltersPanel.needsRefreshLabel.text=Displayed data maybe out of date. Press Refresh to update. VisualizationPanel.jButton1.text=Fast Organic CVTTopComponent.vizPanel.TabConstraints.tabTitle=Visualize CVTTopComponent.accountsBrowser.TabConstraints.tabTitle_1=Browse diff --git a/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties-MERGED index 59778273ab..dafb3e2ae1 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties-MERGED @@ -26,7 +26,7 @@ FiltersPanel.endCheckBox.text=End: FiltersPanel.refreshButton.text=Refresh FiltersPanel.deviceRequiredLabel.text=Select at least one. FiltersPanel.accountTypeRequiredLabel.text=Select at least one. -FiltersPanel.needsRefreshLabel.text=Displayed data is out of date. Press Refresh. +FiltersPanel.needsRefreshLabel.text=Displayed data maybe out of date. Press Refresh to update. OpenCVTAction.displayName=Communications PinAccountsAction.pluralText=Add Selected Accounts to Visualization PinAccountsAction.singularText=Add Selected Account to Visualization diff --git a/Core/src/org/sleuthkit/autopsy/communications/CVTFilterRefresher.java b/Core/src/org/sleuthkit/autopsy/communications/CVTFilterRefresher.java index 5c4ec64a24..1ba9d6c81e 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/CVTFilterRefresher.java +++ b/Core/src/org/sleuthkit/autopsy/communications/CVTFilterRefresher.java @@ -45,7 +45,6 @@ import org.sleuthkit.datamodel.TskCoreException; abstract class CVTFilterRefresher implements RefreshThrottler.Refresher { private static final Logger logger = Logger.getLogger(CVTFilterRefresher.class.getName()); - /** * contains all of the gui control specific update code. Refresh will call * this method with an involkLater so that the updating of the swing diff --git a/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java index 2f60b15d5c..fbd41b5840 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java @@ -189,8 +189,7 @@ public final class CVTTopComponent extends TopComponent { * * Re-applying the filters means we will lose the selection... */ - filtersPane.setEnabled(false); - filtersPane.updateFilters(); + filtersPane.initalizeFilters(); } @Override diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index 5c65239d00..1ebcbc6541 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -162,17 +162,23 @@ final public class FiltersPanel extends JPanel { || eventData.getBlackboardArtifactType().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT.getTypeID() || eventData.getBlackboardArtifactType().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG.getTypeID() || eventData.getBlackboardArtifactType().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID())) { - needsRefresh = true; + if(!needsRefresh) { + needsRefresh = true; + validateFilters(); + } } } }; - refreshThrottler = new RefreshThrottler(new FilterPanelRefresher()); + refreshThrottler = new RefreshThrottler(new FilterPanelRefresher(false, false)); this.ingestJobListener = pce -> { String eventType = pce.getPropertyName(); if (eventType.equals(COMPLETED.toString())) { - needsRefresh = true; + if(!needsRefresh) { + needsRefresh = true; + validateFilters(); + } } }; @@ -214,33 +220,11 @@ final public class FiltersPanel extends JPanel { } } - @Override - public void setEnabled(boolean enabled) { - this.applyFiltersButton.setEnabled(enabled); - this.refreshButton.setEnabled(enabled && needsRefresh); - this.startCheckBox.setEnabled(enabled); - this.endCheckBox.setEnabled(enabled); - - this.startDatePicker.setEnabled(enabled && startCheckBox.isSelected()); - this.endDatePicker.setEnabled(enabled && endCheckBox.isSelected()); - - this.limitComboBox.setEnabled(enabled); - - this.unCheckAllAccountTypesButton.setEnabled(enabled); - this.unCheckAllDevicesButton.setEnabled(enabled); - - this.checkAllAccountTypesButton.setEnabled(enabled); - this.checkAllDevicesButton.setEnabled(enabled); - - this.devicesListPane.setEnabled(enabled); - this.accountTypeListPane.setEnabled(enabled); - } - - void updateFilters() { + void initalizeFilters() { Runnable runnable = new Runnable() { @Override public void run() { - new FilterPanelRefresher().refresh(); + new FilterPanelRefresher(true, true).refresh(); } }; runnable.run(); @@ -289,13 +273,12 @@ final public class FiltersPanel extends JPanel { * * @return True, if a new accountType was found */ - private boolean updateAccountTypeFilter(List accountTypesInUse) { + private boolean updateAccountTypeFilter(List accountTypesInUse, boolean checkNewOnes) { boolean newOneFound = false; - boolean selected = accountTypeMap.isEmpty() || (accountTypeMap.size() == 1 && accountTypeMap.containsKey(Account.Type.DEVICE)); - + for (Account.Type type : accountTypesInUse) { if (!accountTypeMap.containsKey(type) && !type.equals(Account.Type.CREDIT_CARD)) { - CheckBoxIconPanel panel = createAccoutTypeCheckBoxPanel(type, selected); + CheckBoxIconPanel panel = createAccoutTypeCheckBoxPanel(type, checkNewOnes); accountTypeMap.put(type, panel.getCheckBox()); accountTypeListPane.add(panel); @@ -338,15 +321,14 @@ final public class FiltersPanel extends JPanel { * * @return true if a new device was found */ - private void updateDeviceFilterPanel(Map dataSourceMap) { - needsRefresh = devicesMap.isEmpty(); + private void updateDeviceFilterPanel(Map dataSourceMap, boolean checkNewOnes) { boolean newOneFound = false; for (Entry entry : dataSourceMap.entrySet()) { if (devicesMap.containsKey(entry.getValue().getDeviceId())) { continue; } - final JCheckBox jCheckBox = new JCheckBox(entry.getKey(), needsRefresh); + final JCheckBox jCheckBox = new JCheckBox(entry.getKey(), checkNewOnes); jCheckBox.addItemListener(validationListener); jCheckBox.setToolTipText(entry.getKey()); devicesListPane.add(jCheckBox); @@ -844,9 +826,10 @@ final public class FiltersPanel extends JPanel { * Post an event with the new filters. */ void applyFilters() { - validateFilters(); - CVTEvents.getCVTEventBus().post(new CVTEvents.FilterChangeEvent(getFilter(), getStartControlState(), getEndControlState())); - needsRefresh = false; + needsRefresh = false; + validateFilters(); + CVTEvents.getCVTEventBus().post(new CVTEvents.FilterChangeEvent(getFilter(), getStartControlState(), getEndControlState())); + } /** @@ -1147,22 +1130,33 @@ final public class FiltersPanel extends JPanel { */ final class FilterPanelRefresher extends CVTFilterRefresher { + private boolean selectNewOption = false; + private boolean refreshAfterUpdate = false; + + FilterPanelRefresher(boolean selectNewOptions, boolean refreshAfterUpdate) { + this.selectNewOption = selectNewOptions; + this.refreshAfterUpdate = refreshAfterUpdate; + } + @Override void updateFilterPanel(CVTFilterRefresher.FilterPanelData data) { updateDateTimePicker(data.getStartTime(), data.getEndTime()); - updateDeviceFilterPanel(data.getDataSourceMap()); - updateAccountTypeFilter(data.getAccountTypesInUse()); + updateDeviceFilterPanel(data.getDataSourceMap(), selectNewOption); + updateAccountTypeFilter(data.getAccountTypesInUse(), selectNewOption); FiltersPanel.this.repaint(); - if (needsRefresh) { + if (refreshAfterUpdate) { applyFilters(); } + if (!isEnabled()) { setEnabled(true); } validateFilters(); + + repaint(); } }