mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-18 02:27:42 +00:00
improved conditions for enabling frequency percentage search
This commit is contained in:
parent
6fa58b9ca7
commit
41797943c2
@ -87,11 +87,15 @@ public final class CommonAttributePanel extends javax.swing.JDialog {
|
|||||||
this.errorText.setVisible(false);
|
this.errorText.setVisible(false);
|
||||||
this.setupDataSources();
|
this.setupDataSources();
|
||||||
|
|
||||||
if (CommonAttributePanel.isEamDbAvailable()) {
|
if (CommonAttributePanel.isEamDbAvailableForIntercaseSearch()) {
|
||||||
this.setupCases();
|
this.setupCases();
|
||||||
this.enablePercentageOptions();
|
|
||||||
} else {
|
} else {
|
||||||
this.disableIntercaseSearch();
|
this.disableIntercaseSearch();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(CommonAttributePanel.isEamDbAvailableForPercentageFrequencyCalculations()){
|
||||||
|
this.enablePercentageOptions();
|
||||||
|
} else {
|
||||||
this.disablePercentageOptions();
|
this.disablePercentageOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +129,7 @@ public final class CommonAttributePanel extends javax.swing.JDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isEamDbAvailable() {
|
private static boolean isEamDbAvailableForIntercaseSearch() {
|
||||||
try {
|
try {
|
||||||
return EamDb.isEnabled()
|
return EamDb.isEnabled()
|
||||||
&& EamDb.getInstance() != null
|
&& EamDb.getInstance() != null
|
||||||
@ -139,6 +143,17 @@ public final class CommonAttributePanel extends javax.swing.JDialog {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isEamDbAvailableForPercentageFrequencyCalculations(){
|
||||||
|
try {
|
||||||
|
return EamDb.isEnabled()
|
||||||
|
&& EamDb.getInstance() != null
|
||||||
|
&& EamDb.getInstance().getCases().size() > 0;
|
||||||
|
} catch (EamDbException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Unexpected exception while checking for EamDB enabled.", ex);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void disableIntercaseSearch() {
|
private void disableIntercaseSearch() {
|
||||||
this.intraCaseRadio.setSelected(true);
|
this.intraCaseRadio.setSelected(true);
|
||||||
this.interCaseRadio.setEnabled(false);
|
this.interCaseRadio.setEnabled(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user