1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00

Merge pull request #3034 from wschaeferB/2970-FixCentralRepoOptionsPanel

2970 fix central repo options panel
This commit is contained in:
Richard Cordovano
2017-09-07 14:44:59 -04:00
committed by GitHub
2 changed files with 15 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ public class EamDbSettingsDialog extends JDialog {
private final SqliteEamDbSettings dbSettingsSqlite;
private DatabaseTestResult testingStatus;
private EamDbPlatformEnum selectedPlatform;
private boolean configurationChanged = false;
/**
* Creates new form EamDbSettingsDialog
@@ -406,6 +407,14 @@ public class EamDbSettingsDialog extends JDialog {
testingStatus = DatabaseTestResult.TESTEDOK;
valid();
}
/**
* Returns if changes to the central repository configuration were successfully applied
*
* @return true if the database configuration was successfully changed false if it was not
*/
boolean wasConfigurationChanged() {
return configurationChanged;
}
@Messages({"EamDbSettingsDialog.okButton.errorTitle.text=Restart Required.",
"EamDbSettingsDialog.okButton.errorMsg.text=Please restart Autopsy to begin using the new database platform.",
@@ -483,6 +492,7 @@ public class EamDbSettingsDialog extends JDialog {
// in case we are still using the same instance.
try {
EamDb.getInstance().updateSettings();
configurationChanged = true;
} catch (EamDbException ex) {
LOGGER.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
@@ -497,6 +507,7 @@ public class EamDbSettingsDialog extends JDialog {
// in case we are still using the same instance.
try {
EamDb.getInstance().updateSettings();
configurationChanged = true;
} catch (EamDbException ex) {
LOGGER.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));

View File

@@ -260,6 +260,9 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
store();
EamDbSettingsDialog dialog = new EamDbSettingsDialog();
load(); // reload db settings content and update buttons
if (dialog.wasConfigurationChanged()) {
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}
}//GEN-LAST:event_bnDbConfigureActionPerformed
private void cbUseCentralRepoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbUseCentralRepoActionPerformed
@@ -314,7 +317,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
* @return true if it's okay, false otherwise.
*/
public boolean valid() {
return true;
return !cbUseCentralRepo.isSelected() || !lbDbPlatformValue.getText().equals(DISABLED.toString());
}
@Override