mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
2970 allow property change to be fired when cofig was modified
This commit is contained in:
parent
a3d9d7bcc9
commit
ba3338eccc
@ -51,6 +51,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
private final SqliteEamDbSettings dbSettingsSqlite;
|
private final SqliteEamDbSettings dbSettingsSqlite;
|
||||||
private DatabaseTestResult testingStatus;
|
private DatabaseTestResult testingStatus;
|
||||||
private EamDbPlatformEnum selectedPlatform;
|
private EamDbPlatformEnum selectedPlatform;
|
||||||
|
private boolean configurationChanged = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form EamDbSettingsDialog
|
* Creates new form EamDbSettingsDialog
|
||||||
@ -390,6 +391,14 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
testingStatus = DatabaseTestResult.TESTEDOK;
|
testingStatus = DatabaseTestResult.TESTEDOK;
|
||||||
valid();
|
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.",
|
@Messages({"EamDbSettingsDialog.okButton.errorTitle.text=Restart Required.",
|
||||||
"EamDbSettingsDialog.okButton.errorMsg.text=Please restart Autopsy to begin using the new database platform.",
|
"EamDbSettingsDialog.okButton.errorMsg.text=Please restart Autopsy to begin using the new database platform.",
|
||||||
@ -459,6 +468,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
// in case we are still using the same instance.
|
// in case we are still using the same instance.
|
||||||
try {
|
try {
|
||||||
EamDb.getInstance().updateSettings();
|
EamDb.getInstance().updateSettings();
|
||||||
|
configurationChanged = true;
|
||||||
} catch (EamDbException ex) {
|
} catch (EamDbException ex) {
|
||||||
LOGGER.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
|
||||||
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
@ -473,6 +483,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
// in case we are still using the same instance.
|
// in case we are still using the same instance.
|
||||||
try {
|
try {
|
||||||
EamDb.getInstance().updateSettings();
|
EamDb.getInstance().updateSettings();
|
||||||
|
configurationChanged = true;
|
||||||
} catch (EamDbException ex) {
|
} catch (EamDbException ex) {
|
||||||
LOGGER.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
|
||||||
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
|
@ -261,6 +261,9 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
|
|||||||
store();
|
store();
|
||||||
EamDbSettingsDialog dialog = new EamDbSettingsDialog();
|
EamDbSettingsDialog dialog = new EamDbSettingsDialog();
|
||||||
load(); // reload db settings content and update buttons
|
load(); // reload db settings content and update buttons
|
||||||
|
if (dialog.wasConfigurationChanged()) {
|
||||||
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
|
}
|
||||||
}//GEN-LAST:event_bnDbConfigureActionPerformed
|
}//GEN-LAST:event_bnDbConfigureActionPerformed
|
||||||
|
|
||||||
private void cbUseCentralRepoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbUseCentralRepoActionPerformed
|
private void cbUseCentralRepoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbUseCentralRepoActionPerformed
|
||||||
@ -315,7 +318,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
|
|||||||
* @return true if it's okay, false otherwise.
|
* @return true if it's okay, false otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean valid() {
|
public boolean valid() {
|
||||||
return !(cbUseCentralRepo.isSelected() && lbDbPlatformValue.getText().equals(DISABLED.toString()));
|
return !cbUseCentralRepo.isSelected() || !lbDbPlatformValue.getText().equals(DISABLED.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user