mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
graceful handling in the event that no datasources are available
This commit is contained in:
parent
62c5f037b5
commit
f29af7e012
@ -85,7 +85,8 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
||||
"CommonFilesPanel.buildDataSourceMap.done.noCurrentCaseException=Unable to open case file.",
|
||||
"CommonFilesPanel.buildDataSourceMap.done.exception=Unexpected exception building data sources map.",
|
||||
"CommonFilesPanel.buildDataSourceMap.done.interupted=Something went wrong building the Common Files Search dialog box.",
|
||||
"CommonFilesPanel.buildDataSourceMap.done.sqlException=Unable to query db for data sources."})
|
||||
"CommonFilesPanel.buildDataSourceMap.done.sqlException=Unable to query db for data sources.",
|
||||
"CommonFilesPanel.buildDataSourcesMap.updateUi.noDataSources=No data sources were found."})
|
||||
private void setupDataSources() {
|
||||
|
||||
new SwingWorker<Map<Long, String>, Void>() {
|
||||
@ -95,6 +96,9 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
||||
private void updateUi() {
|
||||
|
||||
String[] dataSourcesNames = new String[CommonFilesPanel.this.dataSourceMap.size()];
|
||||
|
||||
//only enable all this stuff if we actually have datasources
|
||||
if (dataSourcesNames.length > 0) {
|
||||
dataSourcesNames = CommonFilesPanel.this.dataSourceMap.values().toArray(dataSourcesNames);
|
||||
CommonFilesPanel.this.dataSourcesList = new DataSourceComboBoxModel(dataSourcesNames);
|
||||
CommonFilesPanel.this.selectDataSourceComboBox.setModel(CommonFilesPanel.this.dataSourcesList);
|
||||
@ -109,6 +113,10 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
CommonFilesPanel.this.searchButton.setEnabled(true);
|
||||
} else {
|
||||
MessageNotifyUtil.Message.error(Bundle.CommonFilesPanel_buildDataSourcesMap_updateUi_noDataSources());
|
||||
CommonFilesPanel.this.cancelButtonActionPerformed(null);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean caseHasMultipleSources() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user