mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Fix: when no files indexed, user could still press enter and start search
This commit is contained in:
parent
e145d545ca
commit
338662fc90
@ -37,15 +37,20 @@ public class KeywordSearchDataExplorer implements DataExplorer {
|
|||||||
|
|
||||||
private static KeywordSearchDataExplorer theInstance;
|
private static KeywordSearchDataExplorer theInstance;
|
||||||
private KeywordSearchTabsTopComponent tc;
|
private KeywordSearchTabsTopComponent tc;
|
||||||
|
private int filesIndexed;
|
||||||
|
|
||||||
public KeywordSearchDataExplorer() {
|
public KeywordSearchDataExplorer() {
|
||||||
this.setTheInstance();
|
this.setTheInstance();
|
||||||
|
this.filesIndexed = 0;
|
||||||
this.tc = new KeywordSearchTabsTopComponent();
|
this.tc = new KeywordSearchTabsTopComponent();
|
||||||
|
|
||||||
this.tc.addSearchButtonListener(new ActionListener() {
|
this.tc.addSearchButtonListener(new ActionListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (filesIndexed == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
tc.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
tc.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -124,6 +129,7 @@ public class KeywordSearchDataExplorer implements DataExplorer {
|
|||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
if (changed.equals(KeywordSearch.NUM_FILES_CHANGE_EVT)) {
|
if (changed.equals(KeywordSearch.NUM_FILES_CHANGE_EVT)) {
|
||||||
int newFilesIndexed = ((Integer) newValue).intValue();
|
int newFilesIndexed = ((Integer) newValue).intValue();
|
||||||
|
filesIndexed = newFilesIndexed;
|
||||||
tc.setFilesIndexed(newFilesIndexed);
|
tc.setFilesIndexed(newFilesIndexed);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user